删除重复的枚举扩展
添加Theme到字典数据库 更新字典数据库
This commit is contained in:
parent
c556ed05a3
commit
139f000b39
@ -20,26 +20,3 @@ public class ThemeAttribute : Attribute
|
||||
this.Theme = theme;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ThemeExtend
|
||||
{
|
||||
/// <summary>
|
||||
/// 扩展方法
|
||||
/// </summary>
|
||||
/// <param name="enumValue"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetTheme(this Enum enumValue)
|
||||
{
|
||||
Type type = enumValue.GetType();
|
||||
FieldInfo field = type.GetField(enumValue.ToString());
|
||||
if (field.IsDefined(typeof(ThemeAttribute), true))
|
||||
{
|
||||
var themeAttribute = (ThemeAttribute)field.GetCustomAttribute(typeof(ThemeAttribute));
|
||||
return themeAttribute.Theme;
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -60,6 +60,7 @@ public class EnumToDictJob : IJob
|
||||
dictData.Code = enumData.Name;
|
||||
dictData.OrderNo = enumData.Value + 10;
|
||||
dictData.Name = enumData.Describe;
|
||||
dictData.TagType = enumData.Theme;
|
||||
uSysDictData.Add(dictData);
|
||||
}
|
||||
});
|
||||
@ -113,7 +114,7 @@ public class EnumToDictJob : IJob
|
||||
Code = u.Name,
|
||||
Remark = t2.Remark,
|
||||
OrderNo = u.Value + 10,
|
||||
TagType = "info"
|
||||
TagType = u.Theme ?? "info"
|
||||
}).ToList()
|
||||
}).ToList();
|
||||
var iDictData = new List<SysDictData>();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user