Пример #1
0
        public IActionResult ExcluirPlanoConta(int id)
        {
            PlanoDeConta plano = new PlanoDeConta(HttpContextAccessor);

            plano.ExcluirPlanoConta(id);
            return(RedirectToAction("ListaPlanoConta"));
        }
Пример #2
0
        public IActionResult ListaPlanoConta()
        {
            PlanoDeConta planoDeConta = new PlanoDeConta(HttpContextAccessor);

            ViewBag.ListaPlanoContas = planoDeConta.ListaPlanoContas();
            return(View());
        }
Пример #3
0
 public ActionResult NovoPlanoDeContas(int?id)
 {
     if (id != null)
     {
         PlanoDeConta planoDeConta = new PlanoDeConta(HttpContextAccessor);
         ViewBag.Registro = planoDeConta.BuscarPorId(id);
     }
     return(View());
 }
Пример #4
0
        private bool PlanoDeContaValido(PlanoDeConta planoDeConta)
        {
            if (planoDeConta.EhValido())
            {
                return(true);
            }

            NotificarValidacoesErro(planoDeConta.ValidationResult);
            return(false);
        }
Пример #5
0
 public IActionResult NovoPlanoDeContas(PlanoDeConta planoDeConta)
 {
     if (ModelState.IsValid)
     {
         planoDeConta.HttpContextAccessor = HttpContextAccessor;
         planoDeConta.CriarPlanoConta();
         return(RedirectToAction("ListaPlanoConta"));
     }
     return(View());
 }