예제 #1
0
        public IActionResult CartaoCredito(Reserva reserva, string txtHrAluguel, string nroCartaoCredito, string valorTotalPagamento, DateTime dtVeicDevolvido)
        {
            Reserva r = new Reserva();

            r = GetReserva();
            DateTime aux = DateTime.Now;

            if (string.IsNullOrWhiteSpace(nroCartaoCredito))
            {
                TempData["MsgCartaoCredito"] = "Preencha o número do cartão de crédito";
                TempDataValores(txtHrAluguel, valorTotalPagamento, dtVeicDevolvido);
                return(RedirectToAction("Pagamento"));
            }

            aux = ValidaData(txtHrAluguel, dtVeicDevolvido, aux);

            reserva.DataVeiculoDevolvido = aux;
            _pagamentoDAO.PagamentoCartaoCredito(reserva, nroCartaoCredito, r, valorTotalPagamento);

            return(RedirectToAction("Index", "Cliente"));
        }