Exemple #1
0
        public static Parser VendaAprovada_EntregaNormal(string nome, string email, string senhaPedido, string htmlPedido, string atendente, string dataVenda, string canal, string formasPagamento, EstruturaPagamento oPagamento, List <int> eventos)
        {
            EstruturaClienteEndereco retorno = new ClienteEndereco().LerEstrutura(oPagamento.EnderecoClienteID);

            int diasEntrega = 0;

            if (eventos != null)
            {
                diasEntrega = new IRLib.Entrega().MaiorDiasTriagemEntrega(oPagamento.EntregaControleID, eventos);
            }
            else
            {
                diasEntrega = new IRLib.Entrega().MaiorDiasTriagemEntregaVale(oPagamento.EntregaControleID);
            }

            Hashtable templateVars = new Hashtable();

            templateVars.Add("Nome", nome);
            templateVars.Add("Email", email);
            templateVars.Add("SenhaPedido", senhaPedido);
            templateVars.Add("HtmlPedido", htmlPedido);
            templateVars.Add("Atendente", atendente);
            templateVars.Add("DataVenda", dataVenda);
            templateVars.Add("Canal", canal);
            templateVars.Add("FormasPagamento", formasPagamento);
            templateVars.Add("TipoTaxa", oPagamento.EntregaNome);
            templateVars.Add("Endereco", retorno.Endereco + ", " + retorno.Numero + " - " + retorno.Bairro + " / " + retorno.Cidade + " - " + retorno.Estado);
            templateVars.Add("DataEntrega", DateTime.Now.AddDays(diasEntrega).ToString("dd/MM/yyyy"));

            Parser parser;

            if (oPagamento.EntregaNome.Contains("Sedex"))
            {
                parser = new Parser(HttpContext.Current.Server.MapPath("~/MailTemplates/Novos_Templates/VendaRealizada_sedex.htm"), templateVars);
            }
            else
            {
                parser = new Parser(HttpContext.Current.Server.MapPath("~/MailTemplates/Novos_Templates/VendaRealizada_motoboy.htm"), templateVars);
            }

            return(parser);
        }
Exemple #2
0
        public static Parser VendaAprovada_EntregaAgendada(string nome, string email, string senhaPedido, string htmlPedido, string atendente, string dataVenda, string canal, string formasPagamento, EstruturaPagamento oPagamento, List <int> eventos)
        {
            EstruturaClienteEndereco retorno = new ClienteEndereco().LerEstrutura(oPagamento.EnderecoClienteID);

            Hashtable templateVars = new Hashtable();

            templateVars.Add("Nome", nome);
            templateVars.Add("Email", email);
            templateVars.Add("SenhaPedido", senhaPedido);
            templateVars.Add("HtmlPedido", htmlPedido);
            templateVars.Add("Atendente", atendente);
            templateVars.Add("DataVenda", dataVenda);
            templateVars.Add("Canal", canal);
            templateVars.Add("FormasPagamento", formasPagamento);
            templateVars.Add("TipoTaxa", oPagamento.EntregaNome);
            templateVars.Add("Endereco", retorno.Endereco + ", " + retorno.Numero + " - " + retorno.Bairro + " / " + retorno.Cidade + " - " + retorno.Estado);
            templateVars.Add("DataEntrega", DateTime.ParseExact(oPagamento.DataSelecionada, "yyyyMMdd", System.Globalization.CultureInfo.InvariantCulture).ToString("dd/MM/yyyy"));

            Parser parser = new Parser(HttpContext.Current.Server.MapPath("~/MailTemplates/Novos_Templates/VendaRealizada_motoboyagendado.htm"), templateVars);

            return(parser);
        }