예제 #1
0
        public ActionResult pagarparcela(int id)
        {
            if (Session["idVendedor"] != null)
            {
                ParcelasDAO    objPD  = new ParcelasDAO();
                PagamentoDAO   objPgD = new PagamentoDAO();
                Parcelas       objP   = new Parcelas();
                VendaaPrazoDAO objVPD = new VendaaPrazoDAO();

                //retorna a idPagamento
                int idPagamento = objPgD.realizaPagamento(id);
                objP.idPagamento = idPagamento;
                objP.idParcela   = id;
                objPD.pagarParcela(objP);

                TempData["idPag"] = idPagamento;
                // string retorno = Request["idPagamento"].ToString();
                //ViewBag.retorno = idPagamento.ToString();


                //atualizar as parcelas restantes da vendaaprazo
                int idvendaaprazo = objPD.selecionaidVendaaPrazo(id);
                objVPD.atualizaVendaaprazo(idvendaaprazo);

                return(RedirectToAction("sucessopg/" + idPagamento + ""));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }