Example #1
0
        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));
        }
Example #2
0
        public ActionResult Detail(int id)
        {
            EnvironmentCategory environmentCategory = _environmentCategoryDao.GetById(id);

            return(View(environmentCategory));
        }