using System; using System.Collections.Generic; using System.Linq; using System.Text; using SCC.Models; namespace SCC.Common { /// /// 枚举帮助类 /// public static class EnumHelper { /// /// 获取彩种对应数据库表名称 /// /// 彩种枚举类型 /// public static string GetSCCLotteryTableName(Enum value) { if (value == null) { throw new ArgumentException("value"); } string TableName = value.ToString(); var fieldInfo = value.GetType().GetField(TableName); var attributes = (TableNameAttribute[])fieldInfo.GetCustomAttributes(typeof(TableNameAttribute), false); if (attributes != null && attributes.Length > 0) { TableName = attributes[0].TableName; } return TableName; } } }