123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414 |
- using FluentValidation;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace OASystem.Domain.Dtos.System
- {
-
-
-
- public class UserDto : DtoBase
- {
-
-
-
- public int CompanyId { get; set; }
-
-
-
- public int DepId { get;set; }
-
-
-
- public int JobPostId { get; set; }
- }
-
-
-
- public class EditUserDto
- {
-
-
-
- public int CurrUserId { get; set; }
-
-
-
- public int Id { get; set; }
-
-
-
- public string Number { get; set; }
-
-
-
- public int CompanyId { get; set; }
-
-
-
- public int DepId { get; set; }
-
-
-
- public int JobPostId { get; set; }
-
-
-
- public string Ext { get; set; }
-
-
-
- public string UsePeriod { get; set; }
-
-
-
-
- }
-
-
-
- public class EditMyUserDto
- {
-
-
-
- public int Id { get; set; }
-
-
-
- public string CnName { get; set; }
-
-
-
- public string EnName { get; set; }
-
-
-
- public int Sex { get; set; }
- private string phone;
-
-
-
- public string Phone
- {
- get
- {
- return phone;
- }
- set
- {
- if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
- {
- phone = value;
- }
- else
- {
- phone = "";
- }
- }
- }
- private string urgentPhone;
-
-
-
- public string UrgentPhone
- {
- get { return urgentPhone; }
- set
- {
- if (Regex.IsMatch(value, @"^[1]+[2,3,4,5,6,7,8,9]+\d{9}"))
- {
- urgentPhone = value;
- }
- else
- {
- urgentPhone = "";
- }
- }
- }
- private string email;
-
-
-
- public string Email
- {
- get { return email; }
- set
- {
- if (Regex.IsMatch(value, @"^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(com|cn|net)$"))
- {
- email = value;
- }
- else
- {
- email = "";
- }
- }
- }
-
-
-
- public string Address { get; set; }
-
-
-
- public DateTime Edate { get; set; }
-
-
-
- public DateTime Birthday { get; set; }
-
-
-
- public string IDCard { get; set; }
-
-
-
- public string GraduateInstitutions { get; set; }
-
-
-
- public string Professional { get; set; }
-
-
-
- public int Education { get; set; }
-
-
-
- public int TheOrAdultEducation { get; set; }
-
-
-
- public string MaritalStatus { get; set; }
-
-
-
- public string HomeAddress { get; set; }
-
-
-
- public string WorkExperience { get; set; }
-
-
-
- public string Certificate { get; set; }
- }
-
-
-
-
- public class UserDelDto : PortDtoBase
- {
-
-
-
- public int Id { get; set; }
-
-
-
- public int OperateUserId { get; set; }
- }
- public class PersonnelAuditDto
- {
- public int UserId { get; set; }
-
-
-
- public int Id { get; set; }
-
-
-
- public int IsAudit { get; set; }
- }
- public class QueryUserByDepartDto
- {
- public int DepartId { get; set; }
- }
- public class UserInfoDto : PortDtoBase
- {
- public int Id { get; set; }
- }
- public class EditUserInfoDto
- {
- public int CurrUserId { get; set; }
- public int Id { get; set; }
-
-
-
- public string CnName { get; set; }
-
-
-
- public string EnName { get; set; }
-
-
-
- public string Number { get; set; }
-
-
-
- public int CompanyId { get; set; }
-
-
-
- public int DepId { get; set; }
-
-
-
- public int JobPostId { get; set; }
-
-
-
- public string Password { get; set; }
-
-
-
- public string ComfirmPassword { get; set; }
-
-
-
- public int Sex { get; set; }
-
-
-
- public string Ext { get; set; }
-
-
-
- public string Phone { get; set; }
-
-
-
- public string UrgentPhone { get; set; }
-
-
-
- public string Email { get; set; }
-
-
-
- public string Address { get; set; }
-
-
-
- public string? Edate { get; set; } = null;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public string IDCard { get; set; }
-
-
-
-
-
-
-
- public string GraduateInstitutions { get; set; }
-
-
-
- public string Professional { get; set; }
-
-
-
-
- public int Education { get; set; }
-
-
-
-
- public int TheOrAdultEducation { get; set; }
-
-
-
- public string MaritalStatus { get; set; }
-
-
-
- public string HomeAddress { get; set; }
-
-
-
- public string UsePeriod { get; set; }
-
-
-
- public string WorkExperience { get; set; }
-
-
-
- public string Certificate { get; set; }
-
-
-
-
-
-
-
- public string Remark { get; set; }
- }
- public class EditUserInfoDtoValidator : AbstractValidator<EditUserInfoDto>
- {
- public EditUserInfoDtoValidator()
- {
-
- RuleFor(x => x.CnName).NotEmpty().WithMessage("姓名不能为空!");
- RuleFor(x => x.EnName).NotEmpty().WithMessage("英文名不能为空!");
- RuleFor(x => x.Number).NotEmpty().WithMessage("工号不能为空!");
- RuleFor(x => x.Password).NotEmpty().WithMessage("密码不能为空!")
- .Length(6, 20).WithMessage("密码长度必须在6到20个字符之间!");
- RuleFor(x => x.ComfirmPassword).NotEmpty().WithMessage("确认密码不能为空!")
- .Equal(x => x.Password).WithMessage("两次密码输入不一致!");
- RuleFor(x => x.Sex).InclusiveBetween(0,2).WithMessage("性别:0 男;1 女;2 未设置;");
- RuleFor(x => x.Phone).NotEmpty().WithMessage("手机号不能为空!");
- RuleFor(x => x.UrgentPhone).NotEmpty().WithMessage("手机号不能为空!");
- RuleFor(x => x.Email).NotEmpty().WithMessage("邮箱不能为空!");
- RuleFor(x => x.Address).NotEmpty().WithMessage("住址不能为空!");
-
-
- RuleFor(x => x.IDCard).NotEmpty().WithMessage("身份证号码不能为空!");
- RuleFor(x => x.TheOrAdultEducation).InclusiveBetween(0, 3).WithMessage("学历类型 0 未设置 1 成教 2 统招 3 留学");
- RuleFor(x => x.Education).InclusiveBetween(0, 6).WithMessage("学历 0 未设置 1 小学、2 初中、3 高中、4 专科、5 本科、6 研究生");
- }
- }
- }
|