Ejemplo n.º 1
0
 public InputViewModel(DebtViewModel debtViewModel,
                       IncomingViewModel incomingViewModel,
                       OutcomingViewModel outcomingViewModel,
                       TransferViewModel transferViewModel)
 {
     DebtVm      = debtViewModel;
     IncomingVm  = incomingViewModel;
     OutcomingVm = outcomingViewModel;
     TransferVm  = transferViewModel;
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create(IncomingViewModel newIncoming)
        {
            if (!ModelState.IsValid)
            {
                TempData["error"] = "Houve um erro ao cadastrar a renda. Por favor, verifique os campos digitados e tente novamente";
                return(RedirectToAction("New"));
            }

            var resp = await Http.Post <IncomingViewModel>("incomings/create", newIncoming);

            if (resp.Success)
            {
                TempData["success"] = resp.Message;
                return(RedirectToAction("Incomings", "Home"));
            }
            TempData["error"] = resp.Error;
            return(RedirectToAction("New"));
        }