public string GetType(string state) { List <Tm_Enum> list = GetSystemEnumByTypeKey("YCYYLX", false); Tm_Enum objEnum = list.Find(obj => obj.EnumValue == state); return(objEnum.EnumKey); }
/// <summary> /// 根据枚举类型和枚举值获取枚举描述 /// </summary> /// <param name="typeKey"></param> protected string GetSystemEnumValue(string typeKey, string enumValue) { string enumKey = ""; IList <ICriterion> qryList = new List <ICriterion>(); if (!string.IsNullOrEmpty(typeKey)) { qryList.Add(Expression.Eq("EnumTypeCode", typeKey)); } if (!string.IsNullOrEmpty(typeKey)) { qryList.Add(Expression.Eq("EnumValue", enumValue)); } Tm_Enum objType = Core.Container.Instance.Resolve <IServiceEnums>().GetEntityByFields(qryList); if (objType != null) { enumKey = objType.EnumKey; } return(enumKey); }