public enuDrugAttribute GetIDFromName(string Name) { enuDrugAttribute c = new enuDrugAttribute(); for (int i = 0; i < 100; i++) { c = (enuDrugAttribute)i; if (c.ToString() == Name) { return(c); } } return((enuDrugAttribute)int.Parse(Name)); }
/// <summary> /// 返回中文 /// </summary> /// <summary> /// 获得全部列表 /// </summary> /// <returns>ArrayList(DrugAttribute)</returns> public static ArrayList List() { DrugAttribute o; enuDrugAttribute e = new enuDrugAttribute(); ArrayList alReturn = new ArrayList(); int i; for (i = 0; i <= System.Enum.GetValues(e.GetType()).GetUpperBound(0); i++) { o = new DrugAttribute(); o.ID = (enuDrugAttribute)i; o.Memo = i.ToString(); alReturn.Add(o); } return(alReturn); }