RegistView.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.Linq;
  6. using System.Text;
  7. namespace EMIS.ViewModel.SystemView
  8. {
  9. public class RegistView
  10. {
  11. public Guid? UserID { get; set; }
  12. /// <summary>
  13. /// 证件类型
  14. /// </summary>
  15. [Required]
  16. [DisplayName("证件类型")]
  17. public int? CertificatesType { get; set; }
  18. /// <summary>
  19. /// 证件号码
  20. /// </summary>
  21. [Required]
  22. [DisplayName("证件号码")]
  23. public string LoginID { get; set; }
  24. [Required(ErrorMessage = "请输入密码。")]
  25. [DataType(DataType.Password)]
  26. [DisplayName("密码")]
  27. //[StringLength(50, ErrorMessage = "密码长度不能小于6位", MinimumLength = 6)]
  28. [RegularExpression(@"^(?=.*[0-9])(?=.*[a-zA-Z]).{6,}$", ErrorMessage = "密码必须包含英文、数字,且长度大于等于6位")]
  29. public string PCode { get; set; }
  30. [Required(ErrorMessage = "请再次输入密码。")]
  31. [DisplayName("密码确认")]
  32. [DataType(DataType.Password)]
  33. public string CPCode { get; set; }
  34. /// <summary>
  35. /// 姓名
  36. /// </summary>
  37. [Required]
  38. [DisplayName("姓名")]
  39. public string UserName { get; set; }
  40. /// <summary>
  41. /// 移动电话
  42. /// </summary>
  43. [Required]
  44. [RegularExpression(@"^[1][0-9]{10}$", ErrorMessage = "联系电话必须是11位数字")]
  45. [DisplayName("联系电话")]
  46. public string Mobile { get; set; }
  47. /// <summary>
  48. /// 考试校区
  49. /// </summary>
  50. [Required]
  51. [DisplayName("考试校区")]
  52. public int SchoolAreaID { get; set; }
  53. /// <summary>
  54. /// 照片
  55. /// </summary>
  56. [DisplayName("照片")]
  57. public string PhotoUrl { get; set; }
  58. /// <summary>
  59. /// 邮箱地址
  60. /// </summary>
  61. [Required]
  62. [DisplayName("邮箱地址")]
  63. [RegularExpression(@"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$", ErrorMessage = "请输入正确的邮箱地址")]
  64. public string Email { get; set; }
  65. /// <summary>
  66. /// 性别
  67. /// </summary>
  68. [Required]
  69. [DisplayName("性别")]
  70. public int? Sex { get; set; }
  71. /// <summary>
  72. /// 性别
  73. /// </summary>
  74. [Required]
  75. [DisplayName("性别")]
  76. public string SexName { get; set; }
  77. /// <summary>
  78. /// 出生日期
  79. /// </summary>
  80. [Required]
  81. [DisplayName("出生日期")]
  82. [DataType(DataType.Date)]
  83. [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")]
  84. public DateTime? BirthDate { get; set; }
  85. /// <summary>
  86. /// 工作单位(或院校)
  87. /// </summary>
  88. [DisplayName("工作单位(或院校)")]
  89. public string WorkUnit { get; set; }
  90. }
  91. }