public List <SelectListItem> GetGoodsTypeList() { var list = new List <SelectListItem>(); _goodsTypeService.GetList().ForEach(c => list.Add(new SelectListItem { Value = c.GoodsTypeID.ToString(CultureInfo.InvariantCulture), Text = c.GoodsTypeName })); return(list); }
public List <SelectListItem> GetGoodsTypeList() { if (Cache.Get("GoodsTypeList") != null) { return(Cache.Get("GoodsTypeList") as List <SelectListItem>); } else { var list = new List <SelectListItem>() { }; _goodsTypeService.GetList().ForEach(c => list.Add(new SelectListItem { Value = c.GoodsTypeID.ToString(CultureInfo.InvariantCulture), Text = c.GoodsTypeName })); Cache.Add("GoodsTypeList", list); return(list); } }