コード例 #1
0
        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"));
        }
コード例 #2
0
 public ActionResult Excluir(PermissoesDaSimulacaoModelView modelView)
 {
     permissaoDAO.Delete(PermissoesFactory.BuildModel(modelView));
     return(RedirectToAction("Index"));
 }