PositionEntity.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. using CZFW.Core;
  2. using CZFW.Framework.Attributes;
  3. using CZFW.Framework.Model.Entity;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.ComponentModel.DataAnnotations.Schema;
  6. namespace CZKJ.GBRS2.Entity
  7. {
  8. [Table("cz_gbrs2_position")]
  9. /// <summary>
  10. /// 招聘职位
  11. /// </summary>
  12. public class PositionEntity : EntityBase,ISeo,IShare
  13. {
  14. /// <summary>
  15. /// 名称
  16. /// </summary>
  17. [Display(Name = "名称")]
  18. [StringLength(32)]
  19. [Required(ErrorMessage = "不能为空")]
  20. public string Name { get; set; }
  21. [Display(Name = "人数")]
  22. [Required]
  23. public int Number { get; set; }
  24. /// <summary>
  25. /// 部门Id
  26. /// </summary>
  27. [Display(Name = "部门")]
  28. [Invisible(AddVisible = true, FormVisible = true)]
  29. [DictSrc(Mark = "DepartmentMark")]
  30. [Required]
  31. public int DepartmentId { get; set; }
  32. /// <summary>
  33. /// 类型
  34. /// </summary>
  35. [Display(Name = "类型")]
  36. [Invisible]
  37. [DropdownSrc(SrcUrl = "/Manage/Type/GetListByParentId?parentId=73")]
  38. public int TypeId { get; set; }
  39. [Display(Name = "地点")]
  40. [Invisible(AddVisible = true, FormVisible = true)]
  41. [DictSrc(Mark = "AddressMark")]
  42. [Required]
  43. public int AddressId { get; set; }
  44. /// <summary>
  45. /// 岗位职责
  46. /// </summary>
  47. [Display(Name = "岗位职责")]
  48. [DataType(DataType.Html)]
  49. [Invisible(AddVisible = true, FormVisible = true)]
  50. public string Respons { get; set; }
  51. /// <summary>
  52. /// 岗位要求
  53. /// </summary>
  54. [Display(Name = "岗位要求")]
  55. [DataType(DataType.Html)]
  56. [Invisible(AddVisible = true, FormVisible = true)]
  57. public string Requirement { get; set; }
  58. [NotMapped]
  59. [Display(Name = "类型")]
  60. [Invisible(TableVisible = true, ViewVisible = true)]
  61. public string TypeName { get; set; }
  62. /// <summary>
  63. /// 地点
  64. /// </summary>
  65. [Display(Name = "地点")]
  66. [NotMapped]
  67. [Invisible(TableVisible = true, ViewVisible = true)]
  68. public string Address { get; set; }
  69. /// <summary>
  70. /// 所属部门
  71. /// </summary>
  72. [Display(Name = "所属部门")]
  73. [NotMapped]
  74. [Invisible(TableVisible = true, ViewVisible = true)]
  75. public string Department { get; set; }
  76. #region SEO及分享
  77. [NotMapped]
  78. private string seotitle;
  79. [NotMapped]
  80. private string seodescription;
  81. [NotMapped]
  82. private string seokeywords;
  83. [NotMapped]
  84. private string sharetitle;
  85. [NotMapped]
  86. private string sharedescription;
  87. [NotMapped]
  88. private string shareurl;
  89. [NotMapped]
  90. private string shareimage;
  91. [StringLength(128)]
  92. [Display(Name = "SEO标题")]
  93. [Invisible(FormVisible = true, AddVisible = true)]
  94. public string SeoTitle
  95. {
  96. get { return string.IsNullOrEmpty(seotitle) ? Name : seotitle; }
  97. set { seotitle = value; }
  98. }
  99. /// <summary>
  100. /// SEO描述
  101. /// </summary>
  102. [StringLength(512)]
  103. [Display(Name = @"SEO描述")]
  104. [DataType(DataType.MultilineText)]
  105. [Invisible(FormVisible = true, AddVisible = true)]
  106. public string SeoDescription
  107. {
  108. get { return string.IsNullOrEmpty(seodescription) ? Name : seodescription; }
  109. set { seodescription = value; }
  110. }
  111. /// <summary>
  112. /// SEO关键词
  113. /// </summary>
  114. [StringLength(128)]
  115. [Display(Name = @"SEO关键词")]
  116. [Invisible(FormVisible = true, AddVisible = true)]
  117. public string SeoKeywords
  118. {
  119. get { return string.IsNullOrEmpty(seokeywords) ? Name : seokeywords; }
  120. set { seokeywords = value; }
  121. }
  122. /// <summary>
  123. /// 分享图片
  124. /// </summary>
  125. [StringLength(512)]
  126. [Display(Name = @"分享图片")]
  127. [DataType(DataType.ImageUrl)]
  128. [Invisible(FormVisible = true, AddVisible = true)]
  129. public string ShareImage
  130. {
  131. get { return string.IsNullOrEmpty(shareimage) ? "/assets/image/logo-lg.png" : shareimage; }
  132. set { shareimage = value; }
  133. }
  134. /// <summary>
  135. /// 分享标题
  136. /// </summary>
  137. [StringLength(128)]
  138. [Display(Name = @"分享标题")]
  139. [Invisible(FormVisible = true, AddVisible = true)]
  140. public string ShareTitle
  141. {
  142. get { return string.IsNullOrEmpty(sharetitle) ? Name : sharetitle; }
  143. set { sharetitle = value; }
  144. }
  145. /// <summary>
  146. /// 分享URL
  147. /// </summary>
  148. [StringLength(512)]
  149. [Display(Name = @"分享URL")]
  150. [Invisible(FormVisible = true, AddVisible = true)]
  151. public string ShareUrl
  152. {
  153. get { return string.IsNullOrEmpty(shareurl) ? ConfigHelper.GetValue<string>("SystemInfo:Website") : shareurl; }
  154. set { shareurl = value; }
  155. }
  156. /// <summary>
  157. /// 分享描述
  158. /// </summary>
  159. [StringLength(512)]
  160. [Display(Name = @"分享描述")]
  161. [Invisible(FormVisible = true, AddVisible = true)]
  162. public string ShareDescription
  163. {
  164. get { return string.IsNullOrEmpty(sharedescription) ? Name : sharedescription; }
  165. set { sharedescription = value; }
  166. }
  167. #endregion
  168. }
  169. }