Exemplo n.º 1
0
        public ActionResult Index()
        {
            var model = new TableViewModel
            {
                TableCategory = TableCategoryEnum.CagegoryA,
                CategorySelectItemList = this.GetCatogorySelectItemList()
            };

            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Index(TableViewModel model)
        {
            model.CategorySelectItemList = this.GetCatogorySelectItemList();

            if (!ModelState.IsValid)
            {
                return View(model);
            }

            if (model.TableCategory == TableCategoryEnum.CagegoryA)
            {
                model.CategoryAList = this.GetCategoryAList();
            }
            else if (model.TableCategory == TableCategoryEnum.CategoryB)
            {
                model.CategoryBList = this.GetCategoryBList();
            }
            else if (model.TableCategory == TableCategoryEnum.CategoryC)
            {
                model.CategoryCList = this.GetCategoryCList();
            }

            return View(model);
        }