using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel.DataAnnotations; using System.Web.Mvc; using System.ComponentModel; namespace EMIS.ViewModel.SystemView { public class ChangePasswordView { [Required(ErrorMessage = "请输入原密码")] [DataType(DataType.Password)] [DisplayName("原密码")] public string OldPassword { get; set; } [Required] [DataType(DataType.Password)] [RegularExpression("^(?=.*?[0-9])(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-]).{8,}$", ErrorMessage = "密码须包含大小写英文、特殊字符、数字且长度大于或等于8位")] [DisplayName("新密码")] public string Password { get; set; } [Required] [DataType(DataType.Password)] [DisplayName("确认新密码")] public string PasswordRep { get; set; } } }