public ActionResult Alterar(PermissoesDaSimulacaoModelView modelView) { if (!ModelState.IsValid) { ViewBag.Role = new SelectList(roleDAO.List(), "Id", "Description"); return(View()); } var model = PermissoesFactory.BuildModel(modelView); model.Role = roleDAO.GetById(modelView.Role); model.TipoDeCalculo = tipoDeCalculo.GetById(modelView.TipoDeCalculo); permissaoDAO.Update(model); return(RedirectToAction("Index")); }
public ActionResult Excluir(PermissoesDaSimulacaoModelView modelView) { permissaoDAO.Delete(PermissoesFactory.BuildModel(modelView)); return(RedirectToAction("Index")); }