| | |
| | | using System.ComponentModel; |
| | | using System.ComponentModel.DataAnnotations; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | |
| | | public string managerID { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 审批人名称用,分割 |
| | | /// </summary> |
| | | [Display(Name = "审批人名称用,分割")] |
| | | [SugarColumn(ColumnDescription = "审批人名称", IsNullable = true)] |
| | | public string managerName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 审批角色ID,号分割 |
| | | /// </summary> |
| | | [Display(Name = "审批角色ID")] |
| | |
| | | [Display(Name = "类型")] |
| | | [SugarColumn(ColumnDescription = "类型")] |
| | | public applyType aType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 类型 |
| | | /// </summary> |
| | | [Display(Name = "审批状态")] |
| | | [SugarColumn(ColumnDescription = "审批状态")] |
| | | public applyStataType ayStataType { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 用户ID |
| | | /// </summary> |
| | | [Display(Name = "用户ID")] |
| | | [SugarColumn(ColumnDescription = "用户ID")] |
| | | public int userID { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | [Display(Name = "调整数据")] |
| | | [SugarColumn(ColumnDescription = "调整数据")] |
| | | public string data { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 创建人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnDescription = "创建人", IsNullable = true)] |
| | | public int createById { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 修改人 |
| | | /// </summary> |
| | | [SugarColumn(ColumnDescription = "修改人", IsNullable = true)] |
| | | public int upDataById { get; set; } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取Description |
| | | /// </summary> |
| | | public static class EnumExtensions |
| | | { |
| | | /// <summary> |
| | | /// 获取Description |
| | | /// </summary> |
| | | 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; |
| | | } |
| | | } |
| | | } |