iotgateway/IoTGateway.Model/FrameworkUser.cs

38 lines
1.4 KiB
C#
Raw Normal View History

2021-12-12 14:55:48 +08:00
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace WalkingTec.Mvvm.Core
{
/// <summary>
/// FrameworkUser
/// </summary>
[Table("FrameworkUsers")]
public class FrameworkUser : FrameworkUserBase
{
[Display(Name = "_Admin.Email")]
[RegularExpression("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$", ErrorMessage = "Validate.{0}formaterror")]
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Email { get; set; }
[Display(Name = "_Admin.Gender")]
public GenderEnum? Gender { get; set; }
[Display(Name = "_Admin.CellPhone")]
[RegularExpression("^[1][3-9]\\d{9}$", ErrorMessage = "Validate.{0}formaterror")]
public string CellPhone { get; set; }
[Display(Name = "_Admin.HomePhone")]
[StringLength(30, ErrorMessage = "Validate.{0}stringmax{1}")]
[RegularExpression("^[-0-9\\s]{8,30}$", ErrorMessage = "Validate.{0}formaterror")]
public string HomePhone { get; set; }
[Display(Name = "_Admin.Address")]
[StringLength(200, ErrorMessage = "Validate.{0}stringmax{1}")]
public string Address { get; set; }
[Display(Name = "_Admin.ZipCode")]
[RegularExpression("^[0-9]{6,6}$", ErrorMessage = "Validate.{0}formaterror")]
public string ZipCode { get; set; }
}
}