public ActionResult Edit(Environment environment, int categoryId) { if (ModelState.IsValid) { Environment env = _environmentDao.GetById(environment.Id); env.Code = environment.Code; env.Name = environment.Name; env.Address = environment.Address; env.Description = environment.Description; env.Category = _environmentCategoryDao.GetById(categoryId); _environmentDao.Update(env); return(RedirectToAction("Index", "Environment")); } InitViewBag(); Environment e = _environmentDao.GetById(environment.Id); return(View("Detail", e)); }
public ActionResult Detail(int id) { EnvironmentCategory environmentCategory = _environmentCategoryDao.GetById(id); return(View(environmentCategory)); }