public ActionResult Menu(MenuModelView model) { if (!User.Identity.IsAuthenticated) { return(RedirectToAction("Login", "Account", null)); } if (ModelState.IsValid) { model.user = User.Identity.Name; model.status = Convert.ToInt16(model.statusb); if (model.menuid != 0) //update { ServiceMenu.UpdateMenu(model); } else //insert { ServiceMenu.InsertMenu(model); } return(Redirect(Domain.Util.config.UrlSite + "Meni/Menu")); } model.menus = ServiceMenu.getMenu(); return(View(model)); }
public ActionResult Menu(Int16 id = 0) { var model = new MenuModelView(); if (id != 0) { //busca as informações para edição model = ServiceMenu.GetMenuId(id); } model.menus = ServiceMenu.getMenu(); return(View(model)); }
public ActionResult UsuarioMenu(Int16 id = 0) { var model = new UsuarioMenuModelView(); if (id != 0) { //busca as informações para edição model = ServiceUsuarioMenu.GetUsuarioMenuId(id); } model.UsuariosTipos = ServiceUsuarioTipo.getUsuarioTipo(); model.Menus = ServiceMenu.getMenu(); model.UsuariosMenus = ServiceUsuarioMenu.getUsuarioMenu(); return(View(model)); }