public ActionResult DeleteConfirmed(int id) { PermissaoMenuSet permissaoMenuSet = permissaoMenuRepository.ObterPorId(id); permissaoMenuRepository.Apagar(permissaoMenuSet); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Permissao_Id,Menu_Id")] PermissaoMenuSet permissaoMenuSet) { if (ModelState.IsValid) { permissaoMenuRepository.Atualizar(permissaoMenuSet); return(RedirectToAction("Index")); } ViewBag.Menu_Id = new SelectList(menuRepository.ObterTodos(), "Id", "nome", permissaoMenuSet.Menu_Id); ViewBag.Permissao_Id = new SelectList(permissaoRepository.ObterTodos(), "Id", "Nome", permissaoMenuSet.Permissao_Id); return(View(permissaoMenuSet)); }
// GET: PermissaoMenu/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PermissaoMenuSet permissaoMenuSet = permissaoMenuRepository.ObterPorId(id.Value); if (permissaoMenuSet == null) { return(HttpNotFound()); } return(View(permissaoMenuSet)); }
// GET: PermissaoMenu/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PermissaoMenuSet permissaoMenuSet = permissaoMenuRepository.ObterPorId(id.Value); if (permissaoMenuSet == null) { return(HttpNotFound()); } ViewBag.Menu_Id = new SelectList(menuRepository.ObterTodos(), "Id", "nome", permissaoMenuSet.Menu_Id); ViewBag.Permissao_Id = new SelectList(permissaoRepository.ObterTodos(), "Id", "Nome", permissaoMenuSet.Permissao_Id); return(View(permissaoMenuSet)); }
public void Inserir(PermissaoMenuSet entity) { try { if (entity != null) { dbcontext.PermissaoMenuSet.Add(entity); dbcontext.Entry(entity).State = System.Data.Entity.EntityState.Added; dbcontext.SaveChanges(); } } catch (Exception ex) { logger.Error(ex); } }