public ActionResult Index() { var model = new TableViewModel { TableCategory = TableCategoryEnum.CagegoryA, CategorySelectItemList = this.GetCatogorySelectItemList() }; return View(model); }
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); }