Church.Net.API/Chruch.Net/Areas/dashboard/Models/FamilyMemberCreateViewModel.cs
2022-09-08 08:04:32 -07:00

65 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using Church.Net.Entity;
namespace Chruch.Net.Areas.dashboard.Models
{
public class FamilyMemberCreateViewModel
{
[StringLength(50)]
public string FirstName { get; set; }
[StringLength(50)]
public string LastName { get; set; }
public Enumeration.Gender Gender { get; set; }
public bool Married { get; set; }
public bool Baptized { get; set; }
public Enumeration.Month BaptizedMonth { get; set; }
public int BaptizedDay { get; set; }
public int BaptizedYear { get; set; }
public Enumeration.Month BirthMonth { get; set; }
public int BirthDay { get; set; }
public int BirthYear { get; set; }
[StringLength(500)]
public string Address { get; set; }
[StringLength(50)]
public string ComunityAppId { get; set; }
public string PhoneNumber { get; set; }
[StringLength(500)]
public string Email { get; set; }
public string ProfileImage { get; set; }
[Required]
[StringLength(100, ErrorMessage = "{0} 的長度至少必須為 {2} 個字元。", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "密碼")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "確認密碼")]
[System.ComponentModel.DataAnnotations.Compare("Password", ErrorMessage = "密碼和確認密碼不相符。")]
public string ConfirmPassword { get; set; }
public DateTime GetBirthDate()
{
return new DateTime(BirthYear,(int)BirthMonth,BirthDay);
}
public DateTime GetBaptizedDate()
{
return new DateTime(BaptizedYear, (int)BaptizedMonth, BaptizedDay);
}
}
}