StaffView.cs 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  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. using EMIS.ViewModel.CacheManage;
  8. namespace EMIS.ViewModel.UniversityManage.TeacherManage
  9. {
  10. public class StaffView
  11. {
  12. /// <summary>
  13. /// 主键ID
  14. /// </summary>
  15. [DisplayName("主键ID")]
  16. public Guid UserID { get; set; }
  17. /// <summary>
  18. /// 教职工号
  19. /// </summary>
  20. [Required]
  21. [DisplayName("教职工号")]
  22. [RegularExpression(@"^[0-9a-zA-Z\s?]+$", ErrorMessage = "请输入数字或英文字母")]
  23. public string StaffCode { get; set; }
  24. /// <summary>
  25. /// 姓名
  26. /// </summary>
  27. [Required]
  28. [DisplayName("姓名")]
  29. public string Name { get; set; }
  30. /// <summary>
  31. /// 校区ID
  32. /// </summary>
  33. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")]
  34. public Guid? CampusID { get; set; }
  35. /// <summary>
  36. /// 校区代码
  37. /// </summary>
  38. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CampusCode")]
  39. public string CampusCode { get; set; }
  40. /// <summary>
  41. /// 校区名称
  42. /// </summary>
  43. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")]
  44. public string CampusName { get; set; }
  45. /// <summary>
  46. /// 院系所ID
  47. /// </summary>
  48. [Required]
  49. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  50. public Guid? CollegeID { get; set; }
  51. /// <summary>
  52. /// 院系所代码
  53. /// </summary>
  54. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CollegeCode")]
  55. public string CollegeNo { get; set; }
  56. /// <summary>
  57. /// 院系所
  58. /// </summary>
  59. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  60. public string CollegeName { get; set; }
  61. /// <summary>
  62. /// 所属教研室ID
  63. /// </summary>
  64. [DisplayName("所属教研室ID")]
  65. public Guid? DepartmentID { get; set; }
  66. /// <summary>
  67. /// 所属教研室代码
  68. /// </summary>
  69. [DisplayName("所属教研室代码")]
  70. public string DepartmentCode { get; set; }
  71. /// <summary>
  72. /// 所属教研室
  73. /// </summary>
  74. [DisplayName("所属教研室")]
  75. public string DepartmentName { get; set; }
  76. /// <summary>
  77. /// 曾用名
  78. /// </summary>
  79. [DisplayName("曾用名")]
  80. public string UsedName { get; set; }
  81. /// <summary>
  82. /// 国籍
  83. /// </summary>
  84. [DisplayName("国籍")]
  85. public string Nationality { get; set; }
  86. /// <summary>
  87. /// 籍贯
  88. /// </summary>
  89. [DisplayName("籍贯")]
  90. public string Place { get; set; }
  91. /// <summary>
  92. /// 性别
  93. /// </summary>
  94. [Required]
  95. [DisplayName("性别")]
  96. public int? SexID { get; set; }
  97. /// <summary>
  98. /// 性别(Excel导入)
  99. /// </summary>
  100. [DisplayName("性别")]
  101. public string SexStr { get; set; }
  102. /// <summary>
  103. /// 性别
  104. /// </summary>
  105. [DisplayName("性别")]
  106. public string SexName
  107. {
  108. get
  109. {
  110. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Sex.ToString()).Where(x => x.Value == SexID).Select(x => x.Name).FirstOrDefault();
  111. }
  112. }
  113. /// <summary>
  114. /// 出生日期
  115. /// </summary>
  116. [DisplayName("出生日期")]
  117. [DataType(DataType.DateTime)]
  118. [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")]
  119. public DateTime? BirthDate { get; set; }
  120. /// <summary>
  121. /// 出生日期(Excel导入)
  122. /// </summary>
  123. [DisplayName("出生日期")]
  124. public string BirthDateStr { get; set; }
  125. /// <summary>
  126. /// 民族
  127. /// </summary>
  128. [DisplayName("民族")]
  129. public int? NationID { get; set; }
  130. /// <summary>
  131. /// 民族(Excel导入)
  132. /// </summary>
  133. [DisplayName("民族")]
  134. public string NationStr { get; set; }
  135. /// <summary>
  136. /// 民族
  137. /// </summary>
  138. [DisplayName("民族")]
  139. public string NationName
  140. {
  141. get
  142. {
  143. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Nation.ToString()).Where(x => x.Value == NationID).Select(x => x.Name).FirstOrDefault();
  144. }
  145. }
  146. /// <summary>
  147. /// 政治面貌
  148. /// </summary>
  149. [DisplayName("政治面貌")]
  150. public int? PoliticsID { get; set; }
  151. /// <summary>
  152. /// 政治面貌(Excel导入)
  153. /// </summary>
  154. [DisplayName("政治面貌")]
  155. public string PoliticsStr { get; set; }
  156. /// <summary>
  157. /// 政治面貌
  158. /// </summary>
  159. [DisplayName("政治面貌")]
  160. public string PoliticsName
  161. {
  162. get
  163. {
  164. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Politics.ToString()).Where(x => x.Value == PoliticsID).Select(x => x.Name).FirstOrDefault();
  165. }
  166. }
  167. /// <summary>
  168. /// 证件类型
  169. /// </summary>
  170. [DisplayName("证件类型")]
  171. public int? CertificatesType { get; set; }
  172. /// <summary>
  173. /// 证件类型(Excel导入)
  174. /// </summary>
  175. [DisplayName("证件类型")]
  176. public string CertificatesTypeStr { get; set; }
  177. /// <summary>
  178. /// 证件类型
  179. /// </summary>
  180. [DisplayName("证件类型")]
  181. public string CertificatesTypeName
  182. {
  183. get
  184. {
  185. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CertificatesType.ToString()).Where(x => x.Value == CertificatesType).Select(x => x.Name).FirstOrDefault();
  186. }
  187. }
  188. /// <summary>
  189. /// 证件号码
  190. /// </summary>
  191. [DisplayName("证件号码")]
  192. [RegularExpression(@"^[0-9a-zA-Z\s?]+$", ErrorMessage = "请输入正确的证件号码格式")]
  193. public string CertificatesNum { get; set; }
  194. /// <summary>
  195. /// 教师类型
  196. /// </summary>
  197. [Required]
  198. [DisplayName("教师类型")]
  199. public int? TeacherTypeID { get; set; }
  200. /// <summary>
  201. /// 教师类型(Excel导入)
  202. /// </summary>
  203. [DisplayName("教师类型")]
  204. public string TeacherTypeStr { get; set; }
  205. /// <summary>
  206. /// 教师类型
  207. /// </summary>
  208. [DisplayName("教师类型")]
  209. public string TeacherTypeName
  210. {
  211. get
  212. {
  213. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeacherType.ToString()).Where(x => x.Value == TeacherTypeID).Select(x => x.Name).FirstOrDefault();
  214. }
  215. }
  216. /// <summary>
  217. /// 在职状态
  218. /// </summary>
  219. [Required]
  220. [DisplayName("在职状态")]
  221. public int? IncumbencyState { get; set; }
  222. /// <summary>
  223. /// 在职状态(Excel导入)
  224. /// </summary>
  225. [DisplayName("在职状态")]
  226. public string IncumbencyStateStr { get; set; }
  227. /// <summary>
  228. /// 在职状态
  229. /// </summary>
  230. [DisplayName("在职状态")]
  231. public string IncumbencyStateName
  232. {
  233. get
  234. {
  235. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_IncumbencyState.ToString()).Where(x => x.Value == IncumbencyState).Select(x => x.Name).FirstOrDefault();
  236. }
  237. }
  238. /// <summary>
  239. /// 任课状况
  240. /// </summary>
  241. [DisplayName("任课状况")]
  242. public int? SituationID { get; set; }
  243. /// <summary>
  244. /// 任课状况(Excel导入)
  245. /// </summary>
  246. [DisplayName("任课状况")]
  247. public string SituationStr { get; set; }
  248. /// <summary>
  249. /// 任课状况
  250. /// </summary>
  251. [DisplayName("任课状况")]
  252. public string SituationName
  253. {
  254. get
  255. {
  256. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Situation.ToString()).Where(x => x.Value == SituationID).Select(x => x.Name).FirstOrDefault();
  257. }
  258. }
  259. /// <summary>
  260. /// 职称
  261. /// </summary>
  262. [DisplayName("职称")]
  263. public int? TitleID { get; set; }
  264. /// <summary>
  265. /// 职称(Excel导入)
  266. /// </summary>
  267. [DisplayName("职称")]
  268. public string TitleStr { get; set; }
  269. /// <summary>
  270. /// 职称
  271. /// </summary>
  272. [DisplayName("职称")]
  273. public string TitleName
  274. {
  275. get
  276. {
  277. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Title.ToString()).Where(x => x.Value == TitleID).Select(x => x.Name).FirstOrDefault();
  278. }
  279. }
  280. /// <summary>
  281. /// 文化程度
  282. /// </summary>
  283. [DisplayName("文化程度")]
  284. public int? LiteracyLevelID { get; set; }
  285. /// <summary>
  286. /// 文化程度(Excel导入)
  287. /// </summary>
  288. [DisplayName("文化程度")]
  289. public string LiteracyLevelStr { get; set; }
  290. /// <summary>
  291. /// 文化程度
  292. /// </summary>
  293. [DisplayName("文化程度")]
  294. public string LiteracyLevelName
  295. {
  296. get
  297. {
  298. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_LiteracyLevel.ToString()).Where(x => x.Value == LiteracyLevelID).Select(x => x.Name).FirstOrDefault();
  299. }
  300. }
  301. /// <summary>
  302. /// 学位
  303. /// </summary>
  304. [DisplayName("学位")]
  305. public int? LearnPositionID { get; set; }
  306. /// <summary>
  307. /// 学位(Excel导入)
  308. /// </summary>
  309. [DisplayName("学位")]
  310. public string LearnPositionStr { get; set; }
  311. /// <summary>
  312. /// 学位
  313. /// </summary>
  314. [DisplayName("学位")]
  315. public string LearnPositionName
  316. {
  317. get
  318. {
  319. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_LearnPosition.ToString()).Where(x => x.Value == LearnPositionID).Select(x => x.Name).FirstOrDefault();
  320. }
  321. }
  322. /// <summary>
  323. /// 是否双师型
  324. /// </summary>
  325. [DisplayName("是否双师型")]
  326. public bool IsDualTeacher { get; set; }
  327. /// <summary>
  328. /// 是否双师型(Excel导入)
  329. /// </summary>
  330. [DisplayName("是否双师型")]
  331. public string IsDualTeacherStr { get; set; }
  332. /// <summary>
  333. /// 是否双师型
  334. /// </summary>
  335. [DisplayName("是否双师型")]
  336. public string IsDualTeacherName
  337. {
  338. get { return this.IsDualTeacher == true ? "是" : "否"; }
  339. }
  340. /// <summary>
  341. /// 课酬级别
  342. /// </summary>
  343. [DisplayName("课酬级别")]
  344. public int? PaymentLevelID { get; set; }
  345. /// <summary>
  346. /// 课酬级别(Excel导入)
  347. /// </summary>
  348. [DisplayName("课酬级别")]
  349. public string PaymentLevelStr { get; set; }
  350. /// <summary>
  351. /// 课酬级别
  352. /// </summary>
  353. [DisplayName("课酬级别")]
  354. public string PaymentLevelName
  355. {
  356. get
  357. {
  358. return IdNameExt.GetDictionaryItem(DictionaryItem.TP_PaymentLevel.ToString()).Where(x => x.Value == PaymentLevelID).Select(x => x.Name).FirstOrDefault();
  359. }
  360. }
  361. /// <summary>
  362. /// 参加工作年月
  363. /// </summary>
  364. [DisplayName("参加工作年月")]
  365. [DataType(DataType.DateTime)]
  366. public DateTime? WorkDate { get; set; }
  367. /// <summary>
  368. /// 参加工作年月(Excel导入)
  369. /// </summary>
  370. [DisplayName("参加工作年月")]
  371. public string WorkDateStr { get; set; }
  372. /// <summary>
  373. /// 来校年月
  374. /// </summary>
  375. [DisplayName("来校年月")]
  376. [DataType(DataType.DateTime)]
  377. public DateTime? ComeSchoolDate { get; set; }
  378. /// <summary>
  379. /// 来校年月(Excel导入)
  380. /// </summary>
  381. [DisplayName("来校年月")]
  382. public string ComeSchoolDateStr { get; set; }
  383. /// <summary>
  384. /// 电子邮箱
  385. /// </summary>
  386. [DisplayName("电子邮箱")]
  387. [RegularExpression(@"^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$", ErrorMessage = "请输入正确的格式")]
  388. public string Email { get; set; }
  389. /// <summary>
  390. /// 邮政编码
  391. /// </summary>
  392. [DisplayName("邮政编码")]
  393. [RegularExpression(@"[1-9]\d{5}(?!\d)", ErrorMessage = "请输入正确的格式")]
  394. public string ZIPCode { get; set; }
  395. /// <summary>
  396. /// 微信号
  397. /// </summary>
  398. [DisplayName("微信号")]
  399. public string WeChatNum { get; set; }
  400. /// <summary>
  401. /// QQ
  402. /// </summary>
  403. [DisplayName("QQ")]
  404. [RegularExpression(@"[1-9][0-9]{4,}", ErrorMessage = "请输入正确的格式")]
  405. public string QQ { get; set; }
  406. /// <summary>
  407. /// 家庭电话
  408. /// </summary>
  409. [DisplayName("家庭电话")]
  410. public string Telephone { get; set; }
  411. /// <summary>
  412. /// 办公电话
  413. /// </summary>
  414. [DisplayName("办公电话")]
  415. public string OfficeTelephone { get; set; }
  416. /// <summary>
  417. /// 住宅电话
  418. /// </summary>
  419. [DisplayName("住宅电话")]
  420. public string HousePhone { get; set; }
  421. /// <summary>
  422. /// 移动电话
  423. /// </summary>
  424. [DisplayName("移动电话")]
  425. public string Mobile { get; set; }
  426. /// <summary>
  427. /// 健康状况
  428. /// </summary>
  429. [DisplayName("健康状况")]
  430. public int? HealthStateID { get; set; }
  431. /// <summary>
  432. /// 健康状况(Excel导入)
  433. /// </summary>
  434. [DisplayName("健康状况")]
  435. public string HealthStateStr { get; set; }
  436. /// <summary>
  437. /// 健康状况
  438. /// </summary>
  439. [DisplayName("健康状况")]
  440. public string HealthStateName
  441. {
  442. get
  443. {
  444. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_HealthState.ToString()).Where(x => x.Value == HealthStateID).Select(x => x.Name).FirstOrDefault();
  445. }
  446. }
  447. /// <summary>
  448. /// 宗教信仰
  449. /// </summary>
  450. [DisplayName("宗教信仰")]
  451. public int? ReligionID { get; set; }
  452. /// <summary>
  453. /// 宗教信仰(Excel导入)
  454. /// </summary>
  455. [DisplayName("宗教信仰")]
  456. public string ReligionStr { get; set; }
  457. /// <summary>
  458. /// 宗教信仰
  459. /// </summary>
  460. [DisplayName("宗教信仰")]
  461. public string ReligionName
  462. {
  463. get
  464. {
  465. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Religion.ToString()).Where(x => x.Value == ReligionID).Select(x => x.Name).FirstOrDefault();
  466. }
  467. }
  468. /// <summary>
  469. /// 特长
  470. /// </summary>
  471. [DisplayName("特长")]
  472. public string Speciality { get; set; }
  473. /// <summary>
  474. /// 银行卡号
  475. /// </summary>
  476. [DisplayName("银行卡号")]
  477. [RegularExpression(@"^[0-9]*$", ErrorMessage = "只能输入数字")]
  478. public string Account { get; set; }
  479. /// <summary>
  480. /// 户口所在地
  481. /// </summary>
  482. [DisplayName("户口所在地")]
  483. public string Residence { get; set; }
  484. /// <summary>
  485. /// 家庭住址
  486. /// </summary>
  487. [DisplayName("家庭住址")]
  488. public string HomeAddress { get; set; }
  489. /// <summary>
  490. /// 通信地址
  491. /// </summary>
  492. [DisplayName("通信地址")]
  493. public string Address { get; set; }
  494. /// <summary>
  495. /// 现住地址
  496. /// </summary>
  497. [DisplayName("现住地址")]
  498. public string NowAddress { get; set; }
  499. /// <summary>
  500. /// 照片
  501. /// </summary>
  502. [DisplayName("照片")]
  503. public string PhotoUrl { get; set; }
  504. /// <summary>
  505. /// 照片
  506. /// </summary>
  507. [DisplayName("照片")]
  508. public string PhotoUrlStr
  509. {
  510. get
  511. {
  512. if (string.IsNullOrWhiteSpace(this.PhotoUrl))
  513. {
  514. return "/Content/images/noPhoto.png";
  515. }
  516. else
  517. {
  518. return this.PhotoUrl;
  519. }
  520. }
  521. }
  522. /// <summary>
  523. /// 照片有无
  524. /// </summary>
  525. [DisplayName("照片有无")]
  526. public bool PhotoHasValue { get; set; }
  527. /// <summary>
  528. /// 照片有无
  529. /// </summary>
  530. [DisplayName("照片有无")]
  531. public string PhotoHasValueName
  532. {
  533. get { return this.PhotoHasValue != true ? "无" : "有"; }
  534. }
  535. /// <summary>
  536. /// 简介
  537. /// </summary>
  538. [DisplayName("简介")]
  539. public string Profile { get; set; }
  540. /// <summary>
  541. /// 角色数
  542. /// </summary>
  543. [DisplayName("角色数")]
  544. public int? RoleCount { get; set; }
  545. /// <summary>
  546. /// 帐号状态
  547. /// </summary>
  548. [DisplayName("帐号状态")]
  549. public int? AccountStatus { get; set; }
  550. /// <summary>
  551. /// 帐号状态
  552. /// </summary>
  553. [DisplayName("帐号状态")]
  554. public string AccountStatusName
  555. {
  556. get
  557. {
  558. return IdNameExt.GetDictionaryItem(DictionaryItem.SYS_STATUS.ToString()).Where(x => x.Value == AccountStatus).Select(x => x.Name).FirstOrDefault();
  559. }
  560. }
  561. /// <summary>
  562. /// 备注
  563. /// </summary>
  564. [DisplayName("备注")]
  565. public string Remark { get; set; }
  566. /// <summary>
  567. /// 错误信息(Excel导入)
  568. /// </summary>
  569. [DisplayName("未导入原因")]
  570. public string ErrorMessage { get; set; }
  571. /// <summary>
  572. /// 状态
  573. /// </summary>
  574. [DisplayName("状态")]
  575. public int? RecordStatus { get; set; }
  576. /// <summary>
  577. /// 创建人
  578. /// </summary>
  579. [DisplayName("创建人")]
  580. public Guid? CreateUserID { get; set; }
  581. /// <summary>
  582. /// 创建时间
  583. /// </summary>
  584. [DisplayName("创建时间")]
  585. public DateTime? CreateTime { get; set; }
  586. /// <summary>
  587. /// 修改人
  588. /// </summary>
  589. [DisplayName("修改人")]
  590. public Guid? ModifyUserID { get; set; }
  591. /// <summary>
  592. /// 修改时间
  593. /// </summary>
  594. [DisplayName("修改时间")]
  595. public DateTime? ModifyTime { get; set; }
  596. }
  597. }