Esempio n. 1
0
        public JsonResult AnexarArquivo(HttpPostedFileBase pdfFile)
        {
            string Path = "~/Attachments";

            if (pdfFile.FileName.EndsWith("pdf"))
            {
                FilesUpload.UploadPhoto(pdfFile, Path);
                string arquivoPdf = string.Format("{0}/{1}", Path, pdfFile);
                return(Json(new { pdfFile }, JsonRequestBehavior.AllowGet));
            }
            return(Json(true));
        }
Esempio n. 2
0
        public ActionResult AttachmentFile(HttpPostedFileBase pdfFile)
        {
            string Path = "~/Attachments";

            if (pdfFile.FileName.EndsWith("pdf"))
            {
                FilesUpload.UploadPhoto(pdfFile, Path);
                string arquivoPdf = string.Format("{0}/{1}", Path, pdfFile);
                return(View());
            }
            return(View());
        }
Esempio n. 3
0
        public JsonResult EnviaEmailPlanRecorr(string assunto, string nome, string email, string cep, string bairro, string logradouro, string numero, string cidade, string estado, string telefone, string complemento, string numDDD, string cpf, string rg, string cellDDD, string cellNum, string tipoNum, string tipoCliente, HttpPostedFileBase pdfFile)
        {
            string linhaTipoDoc = "";
            string linhaTipoCli = "";

            string Path = "~/Attachments";

            if (pdfFile.FileName.EndsWith("pdf") || pdfFile.FileName.EndsWith("jpg"))
            {
                if (System.IO.File.Exists(Path + "/" + pdfFile.FileName))
                {
                    System.IO.File.Delete(Path + "/" + pdfFile.FileName);
                }

                FilesUpload.UploadPhoto(pdfFile, Path);
                string arquivoPdf = string.Format("{0}/{1}", Path, pdfFile);
            }

            if (tipoCliente == "PessoaFísica")
            {
                linhaTipoDoc = "<tr><td style='width:120px;'>CPF:</td><td style='width:380px'>" + cpf + "</td></tr>";
            }
            else if (tipoCliente == "PessoaJurídica")
            {
                linhaTipoDoc = "<tr><td style='width:120px;'>CNPJ:</td><td style='width:380px'>" + cpf + "</td></tr>";
            }

            MailMessage objEmail = new MailMessage();

            //objEmail.From = new MailAddress("*****@*****.**");
            objEmail.From = new MailAddress(email);
            //objEmail.ReplyTo = new MailAddress("*****@*****.**", "*****@*****.**");
            objEmail.To.Add("*****@*****.**");
            //objEmail.To.Add("*****@*****.**");
            objEmail.Bcc.Add("*****@*****.**");
            objEmail.Priority   = MailPriority.Normal;
            objEmail.IsBodyHtml = true;
            objEmail.Subject    = assunto;
            string anexo = Server.MapPath(@"\Attachments\" + pdfFile);

            objEmail.Attachments.Add(new Attachment(anexo));
            objEmail.Body = "<h3 style='font-family:Arial'>" + nome + "</h3>" +
                            "<table style='width:500px; height:70px; font-family:Arial; border:0px'>" +
                            "<tr style='background-color:#0a2f59'>" +
                            "<td style='width:120px;'><img src='http://www.unioperadora.com.br/assets/img/logo/LogoEasySim4u.png' alt='Logo Unioperadora' style='width:120px' /></td>" +
                            "<td style='width:380px'><h3 style='font-family:Arial; color:white; text-align:center'>Assinatura - " + assunto + "</h3></td></tr></table>" +
                            "<table style='width:500px; height:70px; font-family:Arial; border:0px'>" +
                            linhaTipoDoc +
                            "<tr><td style='width:120px;'>RG:</td><td style='width:380px'>" + rg + "</td></tr>" +
                            "<tr><td style='width:120px;'>Email:</td><td style='width:380px'>" + email + "</td></tr>" +
                            "<tr><td style='width:120px;'>Fone:</td><td style='width:380px'>" + "(" + numDDD + ")" + telefone + "</td></tr>" +
                            "<tr><td style='width:120px;'>CEP:</td><td style='width:380px'>" + cep + "</td></tr>" +
                            "<tr><td style='width:120px;'>Bairro:</td><td style='width:380px'>" + bairro + "</td></tr>" +
                            "<tr><td style='width:120px;'>Logradouro:</td><td style='width:380px'>" + logradouro + "</td></tr>" +
                            "<tr><td style='width:120px;'>Numero:</td><td style='width:380px'>" + numero + "</td></tr>" +
                            "<tr><td style='width:120px;'>Compl.:</td><td style='width:380px'>" + complemento + "</td></tr>" +
                            "<tr><td style='width:120px;'>Cidade:</td><td style='width:380px'>" + cidade + "</td></tr>" +
                            "<tr><td style='width:120px;'>Estado:</td><td style='width:380px'>" + estado + "</td></tr>" +

                            "<tr><td style='width:120px;'>Cell:</td><td style='width:380px'>" + "(" + cellDDD + ")" + cellNum + "</td></tr>";
            objEmail.SubjectEncoding = Encoding.GetEncoding("ISO-8859-1");
            objEmail.BodyEncoding    = Encoding.GetEncoding("ISO-8859-1");
            SmtpClient objSmtp = new SmtpClient();

            objSmtp.Host        = "mail.unioperadora.com.br";
            objSmtp.Port        = 587;
            objSmtp.EnableSsl   = true;
            objSmtp.Credentials = new NetworkCredential("*****@*****.**", "Campinas2020");
            objSmtp.Send(objEmail);


            return(Json(true));
        }
Esempio n. 4
0
        public ActionResult Assinatura(int plano, string assunto, string nomeAss, string emailAss, string cepAss, string bairroAss, string logradouroAss, string cidadeAss, string estadoAss, string numTelAss, string complementoAss, string numDDDAss, string cpfAss, string rgAss, string cellDDD, string numCell, string radGroupBtn2_1, string radGroupBtn2_2, HttpPostedFileBase pdfFile, string newsletter, string iccidAss)
        {
            ViewBag.Plano = plano;
            string linhaTipoDoc    = "";
            string linhaTipoCli    = "";
            string receberNoticias = "";

            string Path = "~/Attachments";

            if (pdfFile.FileName.EndsWith("pdf") || pdfFile.FileName.EndsWith("jpg"))
            {
                //string arquivoEx = Server.MapPath(@"\Attachments\" + pdfFile.FileName);
                try
                {
                    FilesUpload.UploadPhoto(pdfFile, Path);
                }
                catch
                {
                    ViewBag.Erro1 = "O arquivo já está sendo utilizado em outro processo! Por favor renomeio o arquivo ou atualize o site clicando em " + "<i class=''></i>" + " e tente novamente!";
                }


                string arquivoPdf = string.Format("{0}/{1}", Path, pdfFile);
            }

            if (radGroupBtn2_1 == "on")
            {
                linhaTipoDoc = "<tr><td style='width:120px;'>CPF:</td><td style='width:380px'>" + cpfAss + "</td></tr>";
            }
            else if (radGroupBtn2_2 == "on")
            {
                linhaTipoDoc = "<tr><td style='width:120px;'>CNPJ:</td><td style='width:380px'>" + cpfAss + "</td></tr>";
            }

            if (newsletter == "on")
            {
                receberNoticias = "<tr><td style='width:120px;'></td><td style='width:380px'>Aceito receber notícias e promoções.</td></tr>";
            }
            else
            {
                receberNoticias = "<tr><td style='width:120px;'></td><td style='width:380px'>Não solicitei receber notícias e promoções.</td></tr>";
            }

            MailMessage objEmail = new MailMessage();

            objEmail.From = new MailAddress(emailAss);
            //objEmail.ReplyTo = new MailAddress("*****@*****.**", "*****@*****.**");
            objEmail.To.Add("*****@*****.**");
            //objEmail.To.Add("*****@*****.**");
            objEmail.Bcc.Add("*****@*****.**");
            objEmail.To.Add("*****@*****.**");
            //objEmail.Bcc.Add("*****@*****.**");
            objEmail.Priority   = MailPriority.Normal;
            objEmail.IsBodyHtml = true;
            objEmail.Subject    = assunto;
            string anexo = Server.MapPath(@"\Attachments\" + pdfFile.FileName);

            objEmail.Attachments.Add(new Attachment(anexo));
            objEmail.Body = "<h3 style='font-family:Arial'>" + nomeAss + "</h3>" +
                            "<table style='width:500px; height:70px; font-family:Arial; border:0px'>" +
                            "<tr style='background-color:#0a2f59'>" +
                            "<td style='width:120px;'><img src='https://www.easysim4ubrasil.com/assets/img/logo/LogoEasySim4u.png' alt='Logo Unioperadora' style='width:120px' /></td>" +
                            "<td style='width:380px'><h3 style='font-family:Arial; color:white; text-align:center'>Assinatura - " + assunto + "</h3></td></tr></table>" +
                            "<table style='width:500px; height:70px; font-family:Arial; border:0px'>" +
                            linhaTipoDoc +
                            "<tr><td style='width:120px;'>RG:</td><td style='width:380px'>" + rgAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Email:</td><td style='width:380px'>" + emailAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Fone:</td><td style='width:380px'>" + "(" + numDDDAss + ")" + numTelAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>CEP:</td><td style='width:380px'>" + cepAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Bairro:</td><td style='width:380px'>" + bairroAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Logradouro:</td><td style='width:380px'>" + logradouroAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Numero:</td><td style='width:380px'>" + numTelAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Compl.:</td><td style='width:380px'>" + complementoAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Cidade:</td><td style='width:380px'>" + cidadeAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Estado:</td><td style='width:380px'>" + estadoAss + "</td></tr>" +
                            "<tr><td style='width:120px;'>Cell:</td><td style='width:380px'>" + "(" + cellDDD + ")" + numCell + "</td></tr>" +
                            "<tr><td style='width:120px;'>COD. ICCID:</td><td>" + iccidAss + "</td></tr>" +
                            receberNoticias +
                            "<tr><td style='width:120px;'></td><td style='width:380px'>Concordo com os termos de uso. " + nomeAss + "- CPF:" + cpfAss + "</td></tr>";
            objEmail.SubjectEncoding = Encoding.GetEncoding("ISO-8859-1");
            objEmail.BodyEncoding    = Encoding.GetEncoding("ISO-8859-1");
            SmtpClient objSmtp = new SmtpClient();

            objSmtp.Host        = "mail.unioperadora.com.br";
            objSmtp.Port        = 587;
            objSmtp.EnableSsl   = true;
            objSmtp.Credentials = new NetworkCredential("*****@*****.**", "Campinas2020");
            objSmtp.Send(objEmail);

            string urlPag = "";

            switch (plano)
            {
            case 1:
                urlPag = "http://pag.ae/7V-Q9wD9r";
                break;

            case 2:
                urlPag = "http://pag.ae/7VZvv-A9u";
                break;

            case 3:
                urlPag = "http://pag.ae/7VZvBgoCR";
                break;

            case 4:
                urlPag = "http://pag.ae/7VZvBLHYR";
                break;

            case 5:
                urlPag = "http://pag.ae/7VZvC8vxQ";
                break;

            case 6:
                urlPag = "http://pag.ae/7VZvCuier";
                //Compra do Chip
                //urlPag = "https://pag.ae/7Wcmk2CB9";
                break;
            }
            return(Redirect(urlPag));
        }