Esempio n. 1
0
        public ActionResult Index(int?page)
        {
            List <OptionVO> objOptionList = _OptionBizManager.GetAllOption(null, null);

            var pager = new Pager(objOptionList.Count(), page);

            var viewModel = new OptionList
            {
                Options = objOptionList.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(),
                Pager   = pager
            };

            ViewBag.OptionDll = objOptionList.Select(x => new SelectListItem {
                Text = x.OptionName, Value = x.OptionId.ToString()
            }).ToList();
            return(View("../Admin/Option/Index", viewModel));
        }
Esempio n. 2
0
        private void SetCategoryDropDown()
        {
            List <CategoryVO> objCategoryList = _categoryBizManager.GetAllCategory(null, null).OrderBy(x => x.CategoryOrder).ToList();

            ViewBag.CategoryDll = objCategoryList.Select(x => new SelectListItem {
                Text = x.CategoryName, Value = x.CategoryId.ToString()
            }).ToList();

            List <OptionVO> objOptionList = _optionBizManager.GetAllOption(null, null);

            ViewBag.OptionDll = objOptionList.Select(x => new SelectListItem {
                Text = x.OptionName, Value = x.OptionId.ToString()
            }).ToList();
        }