コード例 #1
0
        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);
        }
コード例 #2
0
        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);
            }
        }