public void ReloadCategoryList(Contain.CatType catType) { if (categories.ContainsKey(catType)) { categories.Remove(catType); this.ReloadData(); this.GetCategoryList(catType); } }
public IEnumerable <SelectListItem> GetCategoryList(Contain.CatType catType) { lock (locked) { if (!categories.ContainsKey(catType)) { categories.Add(catType, catRepository.GetCategoriesByTypeForView((int)catType)); } } return(categories[catType]); }
public string GetCategoryName(int cateValue, Contain.CatType catType) { lock (this) { IEnumerable <SelectListItem> list = this.GetCategoryList(catType); var cat = list.Where <SelectListItem>(c => c.Value == cateValue.ToString()).FirstOrDefault(); if (cat == null) { return(String.Empty); } return(cat.Text); } }