using Chuanyin.Attribute; using CoreCms.Net.Model.Entities.baseModel; using SqlSugar; using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace CoreCms.Net.Model.Entities.baifenbingfa.apply { /// /// 审批流程 /// //[SqlCodeFirst] public class applyModel: BFBaseModel { /// /// id /// [SugarColumn(ColumnDescription = "id",IsIdentity =true,IsPrimaryKey =true)] [Display(Name = "id")] public int id { get; set; } /// /// 审批人ID用,分割 /// [Display(Name = "审批人ID用,分割")] [SugarColumn(ColumnDescription = "审批人ID", IsNullable = true)] public string managerID { get; set; } /// /// 审批人名称用,分割 /// [Display(Name = "审批人名称用,分割")] [SugarColumn(ColumnDescription = "审批人名称", IsNullable = true)] public string managerName { get; set; } /// /// 审批角色ID,号分割 /// [Display(Name = "审批角色ID")] [SugarColumn(ColumnDescription = "审批角色ID")] public string roleID { get; set; } /// /// 审核人数数量 /// [Display(Name = "审核人数数量")] [SugarColumn(ColumnDescription = "审核人数数量")] public int managerApplyCount { get; set; } /// /// 类型 /// [Display(Name = "类型")] [SugarColumn(ColumnDescription = "类型")] public applyType aType { get; set; } /// /// 类型 /// [Display(Name = "审批状态")] [SugarColumn(ColumnDescription = "审批状态")] public applyStataType ayStataType { get; set; } /// /// 用户ID /// [Display(Name = "用户ID")] [SugarColumn(ColumnDescription = "用户ID")] public int userID { get; set; } /// /// 内容 /// [Display(Name = "内容")] [SugarColumn(ColumnDescription = "内容")] public string dec { get; set; } /// /// 备注 /// [Display(Name = "备注")] [SugarColumn(ColumnDescription = "备注",IsNullable =true)] public string reMake { get; set; } /// /// 调整前数据 /// [Display(Name = "调整前数据")] [SugarColumn(ColumnDescription = "调整前数据", IsNullable = true)] public string oldData { get; set; } /// /// 调整数据 /// [Display(Name = "调整数据")] [SugarColumn(ColumnDescription = "调整数据")] public string data { get; set; } /// /// 创建人 /// [SugarColumn(ColumnDescription = "创建人", IsNullable = true)] public int createById { get; set; } /// /// 修改人 /// [SugarColumn(ColumnDescription = "修改人", IsNullable = true)] public int upDataById { get; set; } } /// /// 审批申请类型 /// public enum applyType { /// /// 积分 /// [Description("积分")] points, /// /// 余额 /// [Description("余额")] Balance, /// /// 推荐人 /// [Description("推荐人")] Referrer, } /// /// 审批状态 /// public enum applyStataType { /// /// 同意 /// [Description("同意")] ok, /// /// 审核中 /// [Description("审批中")] applying, /// /// 拒绝 /// [Description("拒绝")] no } /// /// 获取Description /// public static class EnumExtensions { /// /// 获取Description /// public static string GetDescription(this Enum value, bool nameInstead = true) { Type type = value.GetType(); string name = Enum.GetName(type, value); if (name == null) { return null; } FieldInfo field = type.GetField(name); DescriptionAttribute attribute = field.GetCustomAttribute(typeof(DescriptionAttribute)) as DescriptionAttribute; if (attribute == null && nameInstead == true) { return name; } return attribute?.Description; } } }