示例#1
0
        public ActionResult AlterarMenu(MenuModelView menu)
        {
            if (menu == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (!ModelState.IsValid)
            {
                ViewBag.Role = new SelectList(roleDAO.List(), "Id", "Description", menu.Role);
                return(View(menu));
            }


            var model = MenuFactory.BuildModel(menu);

            model.Role = roleDAO.GetById(menu.Role);
            menuDAO.Alter(model);

            return(RedirectToAction("IndexMenus"));
        }