using CZFW.Core; using CZFW.Framework.Attributes; using CZFW.Framework.Model.Entity; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace CZKJ.GBRS2.Entity { [Table("cz_gbrs2_position")] /// /// 招聘职位 /// public class PositionEntity : EntityBase,ISeo,IShare { /// /// 名称 /// [Display(Name = "名称")] [StringLength(32)] [Required(ErrorMessage = "不能为空")] public string Name { get; set; } [Display(Name = "人数")] [Required] public int Number { get; set; } /// /// 部门Id /// [Display(Name = "部门")] [Invisible(AddVisible = true, FormVisible = true)] [DictSrc(Mark = "DepartmentMark")] [Required] public int DepartmentId { get; set; } /// /// 类型 /// [Display(Name = "类型")] [Invisible] [DropdownSrc(SrcUrl = "/Manage/Type/GetListByParentId?parentId=73")] public int TypeId { get; set; } [Display(Name = "地点")] [Invisible(AddVisible = true, FormVisible = true)] [DictSrc(Mark = "AddressMark")] [Required] public int AddressId { get; set; } /// /// 岗位职责 /// [Display(Name = "岗位职责")] [DataType(DataType.Html)] [Invisible(AddVisible = true, FormVisible = true)] public string Respons { get; set; } /// /// 岗位要求 /// [Display(Name = "岗位要求")] [DataType(DataType.Html)] [Invisible(AddVisible = true, FormVisible = true)] public string Requirement { get; set; } [NotMapped] [Display(Name = "类型")] [Invisible(TableVisible = true, ViewVisible = true)] public string TypeName { get; set; } /// /// 地点 /// [Display(Name = "地点")] [NotMapped] [Invisible(TableVisible = true, ViewVisible = true)] public string Address { get; set; } /// /// 所属部门 /// [Display(Name = "所属部门")] [NotMapped] [Invisible(TableVisible = true, ViewVisible = true)] public string Department { get; set; } #region SEO及分享 [NotMapped] private string seotitle; [NotMapped] private string seodescription; [NotMapped] private string seokeywords; [NotMapped] private string sharetitle; [NotMapped] private string sharedescription; [NotMapped] private string shareurl; [NotMapped] private string shareimage; [StringLength(128)] [Display(Name = "SEO标题")] [Invisible(FormVisible = true, AddVisible = true)] public string SeoTitle { get { return string.IsNullOrEmpty(seotitle) ? Name : seotitle; } set { seotitle = value; } } /// /// SEO描述 /// [StringLength(512)] [Display(Name = @"SEO描述")] [DataType(DataType.MultilineText)] [Invisible(FormVisible = true, AddVisible = true)] public string SeoDescription { get { return string.IsNullOrEmpty(seodescription) ? Name : seodescription; } set { seodescription = value; } } /// /// SEO关键词 /// [StringLength(128)] [Display(Name = @"SEO关键词")] [Invisible(FormVisible = true, AddVisible = true)] public string SeoKeywords { get { return string.IsNullOrEmpty(seokeywords) ? Name : seokeywords; } set { seokeywords = value; } } /// /// 分享图片 /// [StringLength(512)] [Display(Name = @"分享图片")] [DataType(DataType.ImageUrl)] [Invisible(FormVisible = true, AddVisible = true)] public string ShareImage { get { return string.IsNullOrEmpty(shareimage) ? "/assets/image/logo-lg.png" : shareimage; } set { shareimage = value; } } /// /// 分享标题 /// [StringLength(128)] [Display(Name = @"分享标题")] [Invisible(FormVisible = true, AddVisible = true)] public string ShareTitle { get { return string.IsNullOrEmpty(sharetitle) ? Name : sharetitle; } set { sharetitle = value; } } /// /// 分享URL /// [StringLength(512)] [Display(Name = @"分享URL")] [Invisible(FormVisible = true, AddVisible = true)] public string ShareUrl { get { return string.IsNullOrEmpty(shareurl) ? ConfigHelper.GetValue("SystemInfo:Website") : shareurl; } set { shareurl = value; } } /// /// 分享描述 /// [StringLength(512)] [Display(Name = @"分享描述")] [Invisible(FormVisible = true, AddVisible = true)] public string ShareDescription { get { return string.IsNullOrEmpty(sharedescription) ? Name : sharedescription; } set { sharedescription = value; } } #endregion } }