public override void Validate() { base.Validate(); ProjectId.HasValue("项目编码不能为空").MaxLength(50, "项目编码限制长度50"); GroupId.HasValue("用户组不能为空").MaxLength(50, "用户组限制长度50"); UserId.HasValue("用户编码不能为空").MaxLength(50, "用户编码限制长度50"); UserName.HasValue("用户名不能为空").MaxLength(50, "用户名限制长度50"); Phone.HasValue("手机号不能为空").MaxLength(50, "手机号限制长度50"); Email.HasValue("邮箱不能为空").MaxLength(50, "邮箱限制长度50"); Company.HasValue("公司不能为空").MaxLength(50, "公司限制长度50"); }
public string QueryString() { var result = string.Empty; var queryList = new List <string>(); if (UserId.HasValue()) { queryList.Add("UserId =" + "'" + UserId + "'"); } if (FirstName.HasValue()) { queryList.Add("FirstName =" + "'" + FirstName + "'"); } if (Surname.HasValue()) { queryList.Add("Surname =" + "'" + Surname + "'"); } if (Gender.HasValue()) { queryList.Add("Gender =" + "'" + Gender + "'"); } if (Mobile.HasValue()) { queryList.Add("Mobile =" + "'" + Mobile + "'"); } if (Email.HasValue()) { queryList.Add("Email =" + "'" + Email + "'"); } if (queryList.Any()) { result = "Where " + string.Join(" AND ", queryList); } return(result); }
public string QueryString() { var result = string.Empty; var queryList = new List <string>(); if (UserId.HasValue()) { queryList.Add("UserId =" + "'" + UserId + "'"); } if (Address.HasValue()) { queryList.Add("Address =" + "'" + Address + "'"); } if (AddressType.HasValue()) { queryList.Add("AddressType =" + "'" + AddressType + "'"); } if (City.HasValue()) { queryList.Add("City =" + "'" + City + "'"); } if (Province.HasValue()) { queryList.Add("Province =" + "'" + Province + "'"); } if (ZipCode_PostalCode.ToString().HasValue() && ZipCode_PostalCode != 0) { queryList.Add("Zipcode_PostalCode =" + ZipCode_PostalCode); } if (queryList.Any()) { result = "Where " + string.Join(" AND ", queryList); } return(result); }