Example #1
0
        public List <CarrinhoItem> AtualizaItensCarrinho()
        {
            var    usuariosCarrinho = new CarrinhoActions();
            string carrinhoId       = usuariosCarrinho.GetCarrinhoId();

            int total = CarrinhoLista.Rows.Count;

            var carrinhoAtualiza = new CarrinhoActions.CarrinhoAtualiza[total];

            for (int i = 0; i < total; i++)
            {
                IOrderedDictionary rowValues = new OrderedDictionary();
                rowValues = GetValues(CarrinhoLista.Rows[i]);
                carrinhoAtualiza[i].ProdutoId = Convert.ToInt32(rowValues["ProdutoID"]);

                CheckBox cbRemover = new CheckBox();
                cbRemover = (CheckBox)CarrinhoLista.Rows[i].FindControl("Remove");
                carrinhoAtualiza[i].RemoveItem = cbRemover.Checked;

                TextBox quantidadeTextBox = new TextBox();
                quantidadeTextBox = (TextBox)CarrinhoLista.Rows[i].FindControl("QuantidadeComprada");
                carrinhoAtualiza[i].QuantidadeComprada = Convert.ToInt16(quantidadeTextBox.Text);
            }

            usuariosCarrinho.AtualizarCarrinhoBD(carrinhoId, carrinhoAtualiza);
            CarrinhoLista.DataBind();
            lblTotal.Text = string.Format("{0:c}", usuariosCarrinho.GetTotal());

            return(usuariosCarrinho.GetCarrinhoItems());
        }
Example #2
0
        public DataTable TabelaPorEstadocomSiglaComPDV(int estadoID)
        {
            List <int> EventosID = new CarrinhoLista().CarregarEventosReservados(
                System.Web.HttpContext.Current.Session["ClienteID"].ToInt32(), System.Web.HttpContext.Current.Session.SessionID);

            IRLib.PontoVenda pDV = new IRLib.PontoVenda();
            return(pDV.TabelaPorEstadocomSiglaComPDV(estadoID, EventosID));
        }
Example #3
0
        /// <summary>
        /// Os itens do Carrinho vem sempre Desagrupados, independente se tem Cota ou Não, nesta extension, o carrinho será Reagrupado
        /// Somando os valores e adicionando os cotaitem se existirem
        /// </summary>
        /// <param name="lstCarrinho"></param>
        /// <returns></returns>
        public static string ToJson(this List <Carrinho> lstCarrinho)
        {
            try
            {
                StringBuilder stb = new StringBuilder();
                if (!string.IsNullOrEmpty(lstCarrinho.FirstOrDefault().PacoteGrupo))
                {
                    foreach (string grupo in lstCarrinho.Select(c => c.PacoteGrupo).Distinct().OrderBy(c => c))
                    {
                        List <Carrinho> listaFiltrada = lstCarrinho.Where(c => c.PacoteGrupo == grupo).ToList();
                        foreach (Carrinho oCarrinho in listaFiltrada)
                        {
                            //Mantem desagrupado
                            oCarrinho.TipoLugar = (oCarrinho.TipoLugar == ((char)Setor.LugarTipo.Cadeira).ToString() ?
                                                   ((char)Pacote.TipoPacote.Assinatura).ToString() : ((char)Pacote.TipoPacote.Pista).ToString());

                            oCarrinho.PrecoValor       = listaFiltrada.Sum(c => c.PrecoValor);
                            oCarrinho.TaxaConveniencia = listaFiltrada.Sum(c => c.TaxaConveniencia);
                            oCarrinho.Total            = listaFiltrada.Sum(c => c.PrecoValor) + listaFiltrada.Sum(c => c.TaxaConveniencia);
                            (oCarrinho.ListaCotaItem = new List <CotaItem>()).AddRange(listaFiltrada.Where(c => c.CotaItem != null).Select(c => c.CotaItem));
                            oCarrinho.Estado            = listaFiltrada.FirstOrDefault().Estado;
                            oCarrinho.TaxaProcessamento = CarrinhoLista.CalcularTaxaProcessamento(listaFiltrada);
                            stb.Append(oCarrinho.ToJson() + ", ");
                            break;
                        }
                    }
                }
                //É necessáriamente uma mesa fechada
                else
                {
                    foreach (int lugarID in lstCarrinho.Select(c => c.LugarID).Distinct().OrderBy(c => c))
                    {
                        IEnumerable <Carrinho> listaFiltrada = lstCarrinho.Where(c => c.LugarID == lugarID);
                        foreach (Carrinho oCarrinho in listaFiltrada)
                        {
                            oCarrinho.PrecoValor       = listaFiltrada.Sum(c => c.PrecoValor);
                            oCarrinho.TaxaConveniencia = listaFiltrada.Sum(c => c.TaxaConveniencia);
                            oCarrinho.Total            = listaFiltrada.Sum(c => c.PrecoValor) + listaFiltrada.Sum(c => c.TaxaConveniencia);
                            oCarrinho.ListaCotaItem    = new List <CotaItem>();
                            oCarrinho.ListaCotaItem.AddRange(listaFiltrada.Where(c => c.isCota.Length > 0).Select(c => c.CotaItem));
                            stb.Append(oCarrinho.ToJson() + ", ");
                            break;
                        }
                    }
                }
                return(stb.Remove(stb.Length - 2, 2).ToString());
            }
            catch (Exception ex)
            {
                throw new Exception("Não foi possível converter o carrinho para o formato de exibição. Erro: " + ex.Message);
            }
        }
Example #4
0
        public List <PontoVenda> Lista(string estado, string cidade)
        {
            PontoVendaHorarioLista oHorarioLista;

            IRLib.PontoVenda  pDV     = new IRLib.PontoVenda();
            List <PontoVenda> retorno = new List <PontoVenda>();

            List <int> EventosID = new CarrinhoLista().CarregarEventosReservados(
                System.Web.HttpContext.Current.Session["ClienteID"].ToInt32(), System.Web.HttpContext.Current.Session.SessionID);


            foreach (DataRow item in pDV.CarregarTabelaPDV(EventosID, estado, cidade).Rows)
            {
                oHorarioLista = new PontoVendaHorarioLista();
                oDiasExtenso  = new List <string>();

                oHorarioLista.CarregarHorarioPorPDV(item["ID"].ToInt32());
                CarregarHorario(oHorarioLista);

                retorno.Add(new PontoVenda
                {
                    id         = item["ID"].ToInt32(),
                    local      = item["Local"].ToString(),
                    nome       = item["Nome"].ToString(),
                    endereco   = item["Endereco"].ToString(),
                    numero     = item["Numero"].ToString(),
                    compl      = item["Compl"].ToString(),
                    cidade     = item["Cidade"].ToString(),
                    estado     = item["Estado"].ToString(),
                    bairro     = item["Bairro"].ToString(),
                    horario    = MontarStringInfoPDV(),
                    uf         = estado,
                    referencia = item["Referencia"].ToString(),
                    cep        = item["CEP"].ToString(),
                });
            }

            return(retorno);
        }
Example #5
0
        //private void InserirIngressos()
        //{
        //    DAL oDAL = new DAL();
        //    try
        //    {
        //        SqlParameter[] Parametros = new SqlParameter[3];
        //        Parametros[0] = new SqlParameter("@ClienteID", SqlDbType.Int);
        //        Parametros[0].Value = this.ClienteID;

        //        Parametros[1] = new SqlParameter("@Nr_Pedido", SqlDbType.BigInt);
        //        Parametros[1].Value = this.NrPedido;
        //        StringBuilder stbSQL = new StringBuilder();

        //        foreach (int IngressoID in this.IngressoID)
        //        {

        //            Parametros[2] = new SqlParameter("@IngressoID", SqlDbType.BigInt);
        //            Parametros[2].Value = IngressoID;

        //            stbSQL.Append("INSERT INTO HSBCIngresso ");
        //            stbSQL.Append("     (       ClienteID, ");
        //            stbSQL.Append("             NumeroPedido, ");
        //            stbSQL.Append("             IngressoID ) ");
        //            stbSQL.Append("     (       @ClienteID, ");
        //            stbSQL.Append("             @Nr_Pedido, ");
        //            stbSQL.Append("             @IngressoID ) ");
        //            oDAL.Execute(stbSQL.ToString(), Parametros);

        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        throw new Exception("Erro ao inserir os Ingressos");
        //    }

        //    finally
        //    {
        //        oDAL.ConnClose();
        //    }
        //}

        //public bool ValidarCompraDuplicada(CarrinhoLista oCarrinhoLista)
        //{
        //    DAL oDAL = new DAL();
        //    try
        //    {

        //    }
        //    catch (Exception ex)
        //    {
        //        throw new Exception("Consulta Retornou um erro" + ex.Message);
        //    }
        //}

        public void InserirCarrinho(CarrinhoLista oCarrinhoLista)
        {
            DAL oDAL = new DAL();

            try
            {
                foreach (Carrinho oCarrinho in oCarrinhoLista)
                {
                    SqlParameter[] Parametros = new SqlParameter[11];
                    Parametros[0]       = new SqlParameter("@ClienteID", SqlDbType.Int);
                    Parametros[0].Value = this.ClienteID;

                    Parametros[1]       = new SqlParameter("@Nr_Pedido", SqlDbType.BigInt);
                    Parametros[1].Value = this.NrPedido;
                    StringBuilder stbSQL = new StringBuilder();

                    Parametros[2]       = new SqlParameter("@IngressoID", SqlDbType.Int);
                    Parametros[2].Value = oCarrinho.IngressoID;

                    Parametros[3]       = new SqlParameter("@ApresentacaoID", SqlDbType.Int);
                    Parametros[3].Value = oCarrinho.ApresentacaoID;

                    Parametros[4]       = new SqlParameter("@EventoID", SqlDbType.Int);
                    Parametros[4].Value = oCarrinho.EventoID;

                    Parametros[5]       = new SqlParameter("@LocalID", SqlDbType.Int);
                    Parametros[5].Value = oCarrinho.LocalID;

                    Parametros[6]       = new SqlParameter("@PrecoExclusivoCodigoID", SqlDbType.Int);
                    Parametros[6].Value = oCarrinho.PrecoExclusivoCodigoID;

                    Parametros[7]       = new SqlParameter("@DataInclusao", SqlDbType.DateTime);
                    Parametros[7].Value = DateTime.Now;

                    Parametros[8]       = new SqlParameter("@Evento", SqlDbType.NVarChar);
                    Parametros[8].Value = oCarrinho.Evento;

                    Parametros[9]       = new SqlParameter("@Local", SqlDbType.NVarChar);
                    Parametros[9].Value = oCarrinho.Local;

                    Parametros[10]       = new SqlParameter("@Setor", SqlDbType.NVarChar);
                    Parametros[10].Value = oCarrinho.Setor;

                    stbSQL.Append("INSERT INTO HSBCIngressos ");
                    stbSQL.Append("     (       IngressoID, ");
                    stbSQL.Append("             ApresentacaoID, ");
                    stbSQL.Append("             EventoID, ");
                    stbSQL.Append("             LocalID, ");
                    stbSQL.Append("             NumeroPedido, ");
                    stbSQL.Append("             ClienteID, ");
                    stbSQL.Append("             PrecoExclusivoCodigoID, ");
                    stbSQL.Append("             DataInclusao, ");
                    stbSQL.Append("             Evento, ");
                    stbSQL.Append("             Local, ");
                    stbSQL.Append("             Setor )");
                    stbSQL.Append("VALUES ");
                    stbSQL.Append("     (       @IngressoID, ");
                    stbSQL.Append("             @ApresentacaoID, ");
                    stbSQL.Append("             @EventoID, ");
                    stbSQL.Append("             @LocalID, ");
                    stbSQL.Append("             @Nr_Pedido, ");
                    stbSQL.Append("             @ClienteID, ");
                    stbSQL.Append("             @PrecoExclusivoCodigoID, ");
                    stbSQL.Append("             @DataInclusao, ");
                    stbSQL.Append("             @Evento, ");
                    stbSQL.Append("             @Local, ");
                    stbSQL.Append("             @Setor ) ");

                    oDAL.Execute(stbSQL.ToString(), Parametros);
                    oDAL.ConnClose();
                    Parametros = null;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                oDAL.ConnClose();
            }
        }
Example #6
0
        public static RetornoModel <string> EfetuaVendaSistemaComprarVIR(EstruturaPagamento oPagamento, EstruturaReservaInternet estruturaReservaInternet, string celular, CarrinhoLista oCarrinhoLista, CompraModel compra)
        {
            Carrinho oCarrinho = new Carrinho();

            IRLib.Bilheteria bilheteria   = new IRLib.Bilheteria();
            string[]         retornoVenda = new string[3];

            string senha      = string.Empty;
            string msgRetorno = "Ok";

            try
            {
                int    clienteID = compra.ClienteID;
                string SessionID = compra.SessionID;

                IRLib.Cliente oCliente = new IRLib.Cliente();
                oCliente.Ler(clienteID);

                if (oCliente.Control.ID == 0)
                {
                    return new RetornoModel <string>()
                           {
                               Sucesso = false, Retorno = senha, Mensagem = "Não foi possível localizar o seu cadastro, por favor, tente novamento."
                           }
                }
                ;

                retornoVenda = bilheteria.VenderVIRWeb(oPagamento, oCarrinho.getValeIngressoID(clienteID, SessionID).ToArray(), SessionID, new List <EstruturaVirNomePresenteado>(), estruturaReservaInternet, celular, oCliente);

                //ErroIndefinido = -1, FalhaVenda = 0, Sucesso = 1, ClienteInexistente = 2, ReservaInexistente = 3, TaxaEntregaInexistente = 4, FormaPagamentoNaoCadastrada = 5, ReservasCanceladas = 6,
                switch (retornoVenda[0])
                {
                case "1":     //Sucesso
                    oCarrinho.SetStatusCarrinho(clienteID, SessionID, "VV");

                    oCarrinhoLista.CarregarDadosVIRporClienteIDSessionID(clienteID, SessionID, CarrinhoLista.Status.VendidoEmail);

                    senha = retornoVenda[1];

                    IngressoRapido.Lib.Entrega oEntrega = new IngressoRapido.Lib.Entrega();
                    EstruturaEntrega           oEE      = oEntrega.CarregarEstruturaPeloControleID(oPagamento.EntregaControleID);

                    string formpagamento = string.Empty;
                    if (oPagamento.TipoPagamento == EstruturaPagamento.enumTipoPagamento.Nenhum)
                    {
                        formpagamento = "Cortesia";
                    }
                    else if (oPagamento.TipoPagamento == EstruturaPagamento.enumTipoPagamento.VIR)
                    {
                        formpagamento = "Vale Ingresso";
                    }
                    else
                    {
                        formpagamento = oPagamento.BandeiraNome.ToString() + " - " + oPagamento.Parcelas + "X";
                    }

                    try
                    {
                        if (!string.IsNullOrEmpty(oCliente.CNPJ.Valor))
                        {
                            IRLib.ServicoEmail.EnviarVendaAprovadaVir(oCliente.NomeFantasia.Valor, oCliente.Email.Valor, retornoVenda[1], string.Empty, "Site", DateTime.Now.ToString(), "Site", formpagamento, string.Empty, oEE.Nome);
                        }
                        else
                        {
                            IRLib.ServicoEmail.EnviarVendaAprovadaVir(oCliente.Nome.Valor, oCliente.Email.Valor, retornoVenda[1], string.Empty, "Site", DateTime.Now.ToString(), "Site", formpagamento, string.Empty, oEE.Nome);
                        }
                    }
                    catch
                    {
                        msgRetorno = "Sua compra foi efetuada com sucesso no entando o envio para o Email informado gerou um erro, por favor entre em contato com a Ingresso Rápido informando a senha de compra";
                    }

                    oCarrinho.SetStatusCarrinho(clienteID, SessionID, "V");

                    return(new RetornoModel <string>()
                    {
                        Sucesso = true, Retorno = senha, Mensagem = msgRetorno
                    });

                case "0":     // falha ao inserir registro na tVendaBilheteria
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = "Falha ao efetuar o pedido. A venda não pôde ser gerada."
                    });

                case "2":     // falha ao inserir registro na tVendaBilheteria
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = "Cliente Inexistente. A venda não pôde ser gerada."
                    });

                case "3":
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = "Reserva Inexistente. A venda não pôde ser gerada."
                    });

                case "4":
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = "Taxa de Entrega Inexistente. A venda não pôde ser gerada."
                    });

                case "6":
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = "Reservas Canceladas. A venda não pôde ser gerada."
                    });

                case "-1":
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = retornoVenda[1]
                    });

                default:
                    return(new RetornoModel <string>()
                    {
                        Sucesso = false, Retorno = senha, Mensagem = "Falha ao efetuar o pedido. Erro indefinido."
                    });
                }
            }
            catch (ApplicationException ex)
            {
                return(new RetornoModel <string> {
                    Sucesso = false, Retorno = senha, Mensagem = ex.Message
                });
            }
        }
Example #7
0
        private static string TratarEnvioEmailPagamento(EstruturaPagamento oPagamento, CarrinhoLista oCarrinhoLista,
                                                        Cliente oCliente, int clienteID, string SessionID, Carrinho oCarrinho, bool eTicket, string[] retornoVenda,
                                                        string tipoEntrega, string retornoMSG, bool EntradaFranca = false)
        {
            try
            {
                string clienteNome       = string.Empty;
                int    vendaBilheteriaID = Convert.ToInt32(retornoVenda[2]);

                if (!string.IsNullOrEmpty(oCliente.CNPJ.Valor))
                {
                    clienteNome = oCliente.NomeFantasia.Valor;
                }
                else
                {
                    clienteNome = oCliente.Nome.Valor;
                }

                if (!string.IsNullOrEmpty(oCliente.Email.Valor))
                {
                    var parser = new IngressoRapido.TemplateParser.Parser();

                    string formpagamento = string.Empty;
                    if (oPagamento.TipoPagamento == EstruturaPagamento.enumTipoPagamento.Nenhum)
                    {
                        formpagamento = "Cortesia";
                    }
                    else if (oPagamento.TipoPagamento == EstruturaPagamento.enumTipoPagamento.VIR)
                    {
                        formpagamento = "Vale Ingresso";
                    }
                    else if (oPagamento.TipoPagamento == EstruturaPagamento.enumTipoPagamento.Milhas)
                    {
                        formpagamento = "Milhas Smiles";
                    }
                    else
                    {
                        formpagamento = oPagamento.BandeiraNome.ToString() + " - " + oPagamento.Parcelas + "X";
                    }

                    oCarrinhoLista.CarregarDadosPorClienteID(clienteID, SessionID, CarrinhoLista.Status.Reservado, 0);

                    oCarrinho.SetStatusCarrinho(clienteID, SessionID, "V");

                    /*Os robôs são responsáveis por enviar os e-mails de eticket e tef*/

                    var oVendaBilheteria = new IRLib.VendaBilheteria();

                    var detalhesVenda = oVendaBilheteria.AcompanhamentoIngressos(vendaBilheteriaID);

                    var email = new IRLib.EmailAccertify();

                    if (EntradaFranca && oPagamento.EntregaControleID == new IRLib.ConfigGerenciador().getEntregaControleIDMobileTicket())
                    {
                        email.EnviarConfirmacaoCompraMobileTicket(clienteID, detalhesVenda);
                    }
                    else
                    {
                        email.EnviarCompraEmAnalise(clienteID, detalhesVenda);
                    }
                }
            }
            catch (Exception ex)
            {
                LogUtil.Error(ex);
                retornoMSG = "Sua compra foi efetuada com sucesso, no entanto não foi possivel realizar o envio do email";
            }
            return(retornoMSG);
        }
Example #8
0
        public static RetornoModel <VendaRetornoModel> EfetuaVendaSistemaTEFCortesia(EstruturaPagamento oPagamento, string celular, CarrinhoLista oCarrinhoLista, CompraModel compra, CompraPagamentoModel compraPagamento)
        {
            Carrinho oCarrinho = new Carrinho();

            IRLib.Bilheteria bilheteria   = new IRLib.Bilheteria();
            string[]         retornoVenda = new string[4];
            string           retornoMSG   = "Ok";

            try
            {
                int    clienteID = compra.ClienteID;
                string SessionID = compra.SessionID;
                List <EstruturaDonoIngresso> listaDonoIngresso = new List <EstruturaDonoIngresso>();

                foreach (Carrinho carrinho in oCarrinhoLista.Where(c => c.isCota.Length > 0))
                {
                    listaDonoIngresso.Add(new EstruturaDonoIngresso()
                    {
                        CodigoPromocional = carrinho.CotaItem.CodigoPromocional,
                        DonoID            = carrinho.DonoID,
                        CotaItemID        = carrinho.CotaItemID,
                        CotaItemIDAPS     = carrinho.CotaItemIDAPS,
                        CPF                = carrinho.CotaItem.DonoCPF,
                        IngressoID         = carrinho.CotaItem.IngressoID,
                        Nominal            = carrinho.CotaItem.Nominal,
                        UsarCPFResponsavel = false,
                    });
                }

                IRLib.Cliente oCliente = new IRLib.Cliente();
                oCliente.Ler(clienteID);

                RetornoModel <EstruturaReservaInternet> reservaInternet = MontarEstruturaReserva(compraPagamento, compra);
                if (!reservaInternet.Sucesso)
                {
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = reservaInternet.Mensagem
                    });
                }

                if (reservaInternet.Retorno.CaixaID == 0)
                {
                    reservaInternet.Retorno.CaixaID = bilheteria.VerificaCaixaInternet(
                        reservaInternet.Retorno.UsuarioID, reservaInternet.Retorno.LojaID);
                }

                retornoVenda = bilheteria.VenderWebCortesia(oPagamento,
                                                            oCarrinho.IngressosTaxasCarrinho(clienteID, SessionID), SessionID, celular, listaDonoIngresso,
                                                            reservaInternet.Retorno,
                                                            oCarrinhoLista.TotalTaxaProcessamento(), oCliente, clienteID);

                VendaRetornoModel retorno     = new VendaRetornoModel();
                string            tipoEntrega = string.Empty;
                bool eTicket = false;

                IRLib.Entrega entrega = new IRLib.Entrega();

                if (oPagamento.EntregaControleID > 0)
                {
                    tipoEntrega = entrega.BuscaTipo(oPagamento.EntregaControleID);
                    eTicket     = entrega.VerificaeTicket(oPagamento.EntregaControleID);
                }

                //ErroIndefinido = -1, FalhaVenda = 0, Sucesso = 1, ClienteInexistente = 2, ReservaInexistente = 3, TaxaEntregaInexistente = 4, FormaPagamentoNaoCadastrada = 5, ReservasCanceladas = 6,
                switch (retornoVenda[0])
                {
                case "1":     //Sucesso
                    retorno.MsgCodigo = 1;
                    if (retornoVenda.Length > 1)
                    {
                        retorno.Senha = retornoVenda[1];
                    }
                    if (retornoVenda.Length > 2)
                    {
                        retorno.VendaBilheteriaID = Convert.ToInt32(retornoVenda[2]);
                    }
                    if (retornoVenda.Length > 3)
                    {
                        retorno.MsgCelular = retornoVenda[3];
                    }
                    if (retornoVenda.Length > 4)
                    {
                        retorno.Risco = retornoVenda[4];
                    }

                    retornoMSG = TratarEnvioEmailPagamento(oPagamento, oCarrinhoLista, oCliente, clienteID, SessionID, oCarrinho, eTicket, retornoVenda, tipoEntrega, retornoMSG, true);

                    TratarEnvioNPS(oCliente);

                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = true,
                        Mensagem = "OK",
                        Retorno = retorno
                    });

                case "7":
                    oCarrinho.SetStatusCarrinhoVV(clienteID, SessionID, "VV", Convert.ToInt64(retornoVenda[2]));

                    if (retornoVenda[0] == "7")
                    {
                        retornoMSG =
                            "Sua compra foi efetuada com sucesso, no entanto não foi possivel realizar a compra do Serviço de Seguro Mondial.";
                    }

                    retornoMSG = TratarEnvioEmailPagamento(oPagamento, oCarrinhoLista, oCliente, clienteID, SessionID, oCarrinho, eTicket, retornoVenda, tipoEntrega, retornoMSG);

                    TratarEnvioNPS(oCliente);

                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = true, Mensagem = retornoMSG
                    });

                case "0":     // falha ao inserir registro na tVendaBilheteria
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = "Falha ao efetuar o pedido. A venda não pôde ser gerada."
                    });

                case "2":     // falha ao inserir registro na tVendaBilheteria
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = "Cliente Inexistente. A venda não pôde ser gerada."
                    });

                case "3":
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = "Reserva Inexistente. A venda não pôde ser gerada."
                    });

                case "4":
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = "Taxa de Entrega Inexistente. A venda não pôde ser gerada."
                    });

                case "6":
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = "Reservas Canceladas. A venda não pôde ser gerada."
                    });

                default:
                    return(new RetornoModel <VendaRetornoModel>()
                    {
                        Sucesso = false, Mensagem = retornoVenda[1]
                    });
                }
            }
            catch (ApplicationException ex)
            {
                LogUtil.Error(ex);
                return(new RetornoModel <VendaRetornoModel> {
                    Sucesso = false, Mensagem = ex.Message
                });
            }
        }