public static List <CategoryOption> GetOptions(string type) { return(CacheRecord.GetInstance <List <CategoryOption> >("GetOptions", (f) => { List <CategoryOption> list = new List <CategoryOption>(); XmlNodeList nodes = XmlHelper.GetXmlNodeList(f[0], "//type[@name='" + type + "']/option"); if (nodes != null) { foreach (XmlElement xe in nodes) { CategoryOption op = new CategoryOption(); op.Name = xe.GetAttribute("name"); op.Value = xe.GetAttribute("value"); list.Add(op); } } return list; }, We7Utils.GetMapPath("~/Config/CategoryOptions.config"))); }
/// <summary> /// 取得所有栏目信息 /// </summary> /// <returns></returns> public CategoryCollection GetCategorys() { return(CacheRecord.GetInstance <CategoryCollection>("GetCategorys", () => { CategoryCollection CatColl = new CategoryCollection(); List <Category> list = GetCategoryByParentID(We7Helper.EmptyGUID); foreach (Category c in list) { CatColl.Add(c); AppendChildCategory(c); } return CatColl; })); }