public ActionResult Create(EnvironmentCategory category) { if (ModelState.IsValid) { _environmentCategoryDao.Create(category); return(RedirectToAction("Index", "EnvironmentCategory")); } ViewBag.categories = _categories; return(View("Index")); }
public ActionResult Edit(EnvironmentCategory category) { if (ModelState.IsValid) { EnvironmentCategory cat = _environmentCategoryDao.GetById(category.Id); cat.Title = category.Title; cat.Description = category.Description; _environmentCategoryDao.Update(cat); return(RedirectToAction("Index", "EnvironmentCategory")); } ViewBag.categories = _categories; EnvironmentCategory ec = _environmentCategoryDao.GetById(category.Id); return(View("Detail", ec)); }
public ActionResult Detail(int id) { EnvironmentCategory environmentCategory = _environmentCategoryDao.GetById(id); return(View(environmentCategory)); }