ProductEntity.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. using CZFW.Core;
  2. using CZFW.Framework.Attributes;
  3. using CZFW.Framework.Model.Entity;
  4. using System;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel.DataAnnotations.Schema;
  7. namespace CZKJ.GBRS2.Entity
  8. {
  9. /// <summary>
  10. /// 产品中心
  11. /// </summary>
  12. [Table("cz_gbrs2_product")]
  13. public class ProductEntity : EntityBase,ISeo,IShare
  14. {
  15. /// <summary>
  16. /// 标题
  17. /// </summary>
  18. [Display(Name = "标题")]
  19. [StringLength(64)]
  20. [Required(ErrorMessage = "不能为空")]
  21. public string Title { get; set; }
  22. /// <summary>
  23. /// 类型
  24. /// </summary>
  25. [Display(Name = "类型")]
  26. [Invisible(AddVisible = true, FormVisible = true)]
  27. [DropdownSrc(SrcUrl = "/Manage/Type/GetTypeListByParentId?parentId=")]
  28. [Required]
  29. public int TypeId { get; set; }
  30. /// <summary>
  31. /// 图片
  32. /// </summary>
  33. [Display(Name = "列表图片", Description = "图片尺寸:280*200px")]
  34. [StringLength(512)]
  35. [DataType(DataType.ImageUrl)]
  36. [Required]
  37. public string Image { get; set; }
  38. /// <summary>
  39. /// 主图
  40. /// </summary>
  41. [Display(Name = "主图", Description = "图片尺寸:1920*690px")]
  42. [StringLength(512)]
  43. [DataType(DataType.ImageUrl)]
  44. public string MainImage { get; set; }
  45. /// <summary>
  46. /// 移动主图
  47. /// </summary>
  48. [Display(Name = "移动主图", Description = "图片尺寸:750*422px")]
  49. [StringLength(512)]
  50. [DataType(DataType.ImageUrl)]
  51. public string MobileMainImage { get; set; }
  52. /// <summary>
  53. /// 简介
  54. /// </summary>
  55. [Display(Name = "简介")]
  56. [StringLength(1024)]
  57. [DataType(DataType.MultilineText)]
  58. public string Summary { get; set; }
  59. /// <summary>
  60. /// 产品特色背景色
  61. /// </summary>
  62. [Display(Name = "产品特色背景色")]
  63. [StringLength(16)]
  64. [DataType("Color")]
  65. [Invisible(AddVisible = true, FormVisible = true)]
  66. public string FeatureColor { get; set; }
  67. /// <summary>
  68. /// 产品特色
  69. /// </summary>
  70. [Display(Name = "产品特色")]
  71. [DataType(DataType.Html)]
  72. [Invisible(AddVisible = true, FormVisible = true)]
  73. public string Feature { get; set; }
  74. /// <summary>
  75. /// 产品特色(Mobile)
  76. /// </summary>
  77. [Display(Name = "产品特色(Mobile)")]
  78. [DataType(DataType.Html)]
  79. [Invisible(AddVisible = true, FormVisible = true)]
  80. public string MobileFeature { get; set; }
  81. /// <summary>
  82. /// 产品说明背景色
  83. /// </summary>
  84. [Display(Name = "产品说明背景色")]
  85. [DataType("Color")]
  86. [StringLength(16)]
  87. [Invisible(AddVisible = true, FormVisible = true)]
  88. public string ExplainColor { get; set; }
  89. /// <summary>
  90. /// 产品说明
  91. /// </summary>
  92. [Display(Name = "产品说明")]
  93. [DataType(DataType.Html)]
  94. [Invisible(AddVisible = true, FormVisible = true)]
  95. public string Explain { get; set; }
  96. /// <summary>
  97. /// 产品说明(Mobile)
  98. /// </summary>
  99. [Display(Name = "产品说明(Mobile)")]
  100. [DataType(DataType.Html)]
  101. [Invisible(AddVisible = true, FormVisible = true)]
  102. public string MobileExplain { get; set; }
  103. /// <summary>
  104. /// 投保案例背景色
  105. /// </summary>
  106. [Display(Name = "投保案例背景色")]
  107. [DataType("Color")]
  108. [Invisible(AddVisible = true, FormVisible = true)]
  109. [StringLength(16)]
  110. public string CaseColor { get; set; }
  111. /// <summary>
  112. /// 投保案例
  113. /// </summary>
  114. [Display(Name = "投保案例")]
  115. [DataType(DataType.Html)]
  116. [Invisible(AddVisible = true, FormVisible = true)]
  117. public string Case { get; set; }
  118. /// <summary>
  119. /// 投保案例(Mobile)
  120. /// </summary>
  121. [Display(Name = "投保案例(Mobile)")]
  122. [DataType(DataType.Html)]
  123. [Invisible(AddVisible = true, FormVisible = true)]
  124. public string MobileCase { get; set; }
  125. /// <summary>
  126. /// 投保规则背景色
  127. /// </summary>
  128. [Display(Name = "投保规则背景色")]
  129. [DataType("Color")]
  130. [Invisible(AddVisible = true, FormVisible = true)]
  131. [StringLength(16)]
  132. public string RuleColor { get; set; }
  133. /// <summary>
  134. /// 投保规则
  135. /// </summary>
  136. [Display(Name = "投保规则")]
  137. [DataType(DataType.Html)]
  138. [Invisible(AddVisible = true, FormVisible = true)]
  139. public string Rule { get; set; }
  140. /// <summary>
  141. /// 投保规则 (Mobile)
  142. /// </summary>
  143. [Display(Name = "投保规则(Mobile)")]
  144. [DataType(DataType.Html)]
  145. [Invisible(AddVisible = true, FormVisible = true)]
  146. public string MobileRule { get; set; }
  147. /// <summary>
  148. /// 理赔流程背景色
  149. /// </summary>
  150. [Display(Name = "理赔流程背景色")]
  151. [DataType("Color")]
  152. [Invisible(AddVisible = true, FormVisible = true)]
  153. [StringLength(16)]
  154. public string FlowColor { get; set; }
  155. /// <summary>
  156. /// 理赔流程
  157. /// </summary>
  158. [Display(Name = "理赔流程")]
  159. [DataType(DataType.Html)]
  160. [Invisible(AddVisible = true, FormVisible = true)]
  161. public string Flow { get; set; }
  162. /// <summary>
  163. /// 理赔流程 (Mobile)
  164. /// </summary>
  165. [Display(Name = "理赔流程(Mobile)")]
  166. [DataType(DataType.Html)]
  167. [Invisible(AddVisible = true, FormVisible = true)]
  168. public string MobileFlow { get; set; }
  169. /// <summary>
  170. /// 产品Q&A背景色
  171. /// </summary>
  172. [Display(Name = "产品Q&A背景色")]
  173. [DataType("Color")]
  174. [Invisible(AddVisible = true, FormVisible = true)]
  175. [StringLength(16)]
  176. public string QaColor { get; set; }
  177. /// <summary>
  178. /// 产品Q&A
  179. /// </summary>
  180. [Display(Name = "产品Q&A")]
  181. [DataType(DataType.Html)]
  182. [Invisible(AddVisible = true, FormVisible = true)]
  183. public string Qa { get; set; }
  184. /// <summary>
  185. /// 产品Q&A(Mobile)
  186. /// </summary>
  187. [Display(Name = "产品Q&A(Mobile)")]
  188. [DataType(DataType.Html)]
  189. [Invisible(AddVisible = true, FormVisible = true)]
  190. public string MobileQA { get; set; }
  191. /// <summary>
  192. /// 产品条款背景色
  193. /// </summary>
  194. [Display(Name = "产品条款背景色")]
  195. [DataType("Color")]
  196. [Invisible(AddVisible = true, FormVisible = true)]
  197. [StringLength(16)]
  198. public string ProvisionColor { get; set; }
  199. /// <summary>
  200. /// 产品条款
  201. /// </summary>
  202. [Display(Name = "产品条款")]
  203. [DataType(DataType.Html)]
  204. [Invisible(AddVisible = true, FormVisible = true)]
  205. public string Provision { get; set; }
  206. /// <summary>
  207. /// 产品条款(Mobile)
  208. /// </summary>
  209. [Display(Name = "产品条款(Mobile)")]
  210. [DataType(DataType.Html)]
  211. [Invisible(AddVisible = true, FormVisible = true)]
  212. public string MobileProvision { get; set; }
  213. /// <summary>
  214. ///如何购买(渠道)背景色
  215. /// </summary>
  216. [Display(Name = "如何购买(渠道)背景色")]
  217. [DataType("Color")]
  218. [Invisible(AddVisible = true, FormVisible = true)]
  219. [StringLength(16)]
  220. public string ChannelColor { get; set; }
  221. /// <summary>
  222. /// <summary>
  223. /// 如何购买(渠道)
  224. /// </summary>
  225. [Display(Name = "如何购买(渠道)")]
  226. [DataType(DataType.Html)]
  227. [Invisible(AddVisible = true, FormVisible = true)]
  228. public string Channel { get; set; }
  229. /// 如何购买(渠道)(Mobile)
  230. /// </summary>
  231. [Display(Name = "如何购买(渠道)(Mobile)")]
  232. [DataType(DataType.Html)]
  233. [Invisible(AddVisible = true, FormVisible = true)]
  234. public string MobileChannel { get; set; }
  235. /// <summary>
  236. /// 发布时间
  237. /// </summary>
  238. [Display(Name = "发布时间")]
  239. [DataType(DataType.DateTime)]
  240. [Invisible]
  241. public DateTime PublishTime { get; set; }
  242. /// <summary>
  243. ///类型
  244. /// </summary>
  245. [NotMapped]
  246. [Display(Name = "类型")]
  247. [Invisible(TableVisible = true, ViewVisible = true)]
  248. public string TypeName { get; set; }
  249. /// <summary>
  250. /// 状态:上线 下线
  251. /// </summary>
  252. [Display(Name = "上、下线")]
  253. [EnumSrc(Name = "CZKJ.GBRS2.Enum.ProductStatusEnum")]
  254. [Invisible(AddVisible = true, FormVisible = true)]
  255. [Required]
  256. public int Status { get; set; }
  257. [NotMapped]
  258. [Display(Name = "上、下线")]
  259. [Invisible(TableVisible = true, ViewVisible = true)]
  260. public string StatusName { get; set; }
  261. #region SEO及分享
  262. [NotMapped]
  263. private string seotitle;
  264. [NotMapped]
  265. private string seodescription;
  266. [NotMapped]
  267. private string seokeywords;
  268. [NotMapped]
  269. private string sharetitle;
  270. [NotMapped]
  271. private string sharedescription;
  272. [NotMapped]
  273. private string shareurl;
  274. [NotMapped]
  275. private string shareimage;
  276. [StringLength(128)]
  277. [Display(Name = "SEO标题")]
  278. [Invisible(FormVisible = true, AddVisible = true)]
  279. public string SeoTitle
  280. {
  281. get { return string.IsNullOrEmpty(seotitle) ? Title : seotitle; }
  282. set { seotitle = value; }
  283. }
  284. /// <summary>
  285. /// SEO描述
  286. /// </summary>
  287. [StringLength(512)]
  288. [Display(Name = @"SEO描述")]
  289. [DataType(DataType.MultilineText)]
  290. [Invisible(FormVisible = true, AddVisible = true)]
  291. public string SeoDescription
  292. {
  293. get { return string.IsNullOrEmpty(seodescription) ? Summary : seodescription; }
  294. set { seodescription = value; }
  295. }
  296. /// <summary>
  297. /// SEO关键词
  298. /// </summary>
  299. [StringLength(128)]
  300. [Display(Name = @"SEO关键词")]
  301. [Invisible(FormVisible = true, AddVisible = true)]
  302. public string SeoKeywords
  303. {
  304. get { return string.IsNullOrEmpty(seokeywords) ? Title : seokeywords; }
  305. set { seokeywords = value; }
  306. }
  307. /// <summary>
  308. /// 分享图片
  309. /// </summary>
  310. [StringLength(512)]
  311. [Display(Name = @"分享图片")]
  312. [DataType(DataType.ImageUrl)]
  313. [Invisible(FormVisible = true, AddVisible = true)]
  314. public string ShareImage
  315. {
  316. get { return string.IsNullOrEmpty(shareimage) ? Image : shareimage; }
  317. set { shareimage = value; }
  318. }
  319. /// <summary>
  320. /// 分享标题
  321. /// </summary>
  322. [StringLength(128)]
  323. [Display(Name = @"分享标题")]
  324. [Invisible(FormVisible = true, AddVisible = true)]
  325. public string ShareTitle
  326. {
  327. get { return string.IsNullOrEmpty(sharetitle) ? Title : sharetitle; }
  328. set { sharetitle = value; }
  329. }
  330. /// <summary>
  331. /// 分享URL
  332. /// </summary>
  333. [StringLength(512)]
  334. [Display(Name = @"分享URL")]
  335. [Invisible(FormVisible = true, AddVisible = true)]
  336. public string ShareUrl
  337. {
  338. get { return string.IsNullOrEmpty(shareurl) ? ConfigHelper.GetValue<string>("SystemInfo:Website") : shareurl; }
  339. set { shareurl = value; }
  340. }
  341. /// <summary>
  342. /// 分享描述
  343. /// </summary>
  344. [StringLength(512)]
  345. [Display(Name = @"分享描述")]
  346. [Invisible(FormVisible = true, AddVisible = true)]
  347. public string ShareDescription
  348. {
  349. get { return string.IsNullOrEmpty(sharedescription) ? Summary : sharedescription; }
  350. set { sharedescription = value; }
  351. }
  352. #endregion
  353. }
  354. }