public void Exportar(InfoPedido[] pedidos) { Email[] emails = null; try { using (var scope = new TransactionScope(TransactionScopeOption.Required, new TimeSpan(0, 0, 55))) { emails = PedidoDAL.Atualiza(pedidos); scope.Complete(); } } catch (Exception exception) { DAL.LogErro.Registrar(exception.Message); //throw; } if (emails != null) { foreach (var email in emails) { EmailDAL.Enviar(email); } } Atualizacao a = new Atualizacao(); //a.Executa(); }
private void BindEmail() { int emailId = Request.QueryString["EmailId"].ToInt(); if (emailId > 0) { Email emailLookup = EmailDAL.GetItem(emailId); if (emailLookup != null) { lblEmailId.Text = emailLookup.EmailId.ToString(); lblEntityTypeId.Text = emailLookup.EntityTypeId.ToString(); lblInstructorId.Text = emailLookup.InstructorId.ToString(); lblEmailAddress.Text = emailLookup.EmailAddress; } else { lblMessage.Text = "Email could not be found."; } } else { lblMessage.Text = "Invalid Id. Email record could not be found."; } }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { EmailDAL decrip = new EmailDAL(); FormulariosDAL fd = new FormulariosDAL(); int idForm = Int32.Parse(decrip.Descriptografar(Request.QueryString["form"])); string empresa = decrip.Descriptografar(Request.QueryString["ep"]); string email = decrip.Descriptografar(Request.QueryString["em"]); if (fd.FormularioRespondido(idForm) == 1) { lblMensagem.Text = "<h1>Formulário já respondido!!</h1>"; btnEnviar.Visible = false; return; } if (fd.ValidaLink(idForm, empresa, email)) { lblMensagem.Text = "<h1>Não existe Formulários para este Link</h1>"; btnEnviar.Visible = false; return; } Response.Cookies["idFormulario"].Value = idForm.ToString(); Response.Cookies["idFormulario"].Expires = DateTime.Now.AddHours(4); fd.AtualizaUltimoAcesso(idForm); List <Perguntas> perguntas = new List <Perguntas>(); PerguntasPorFormulariosDAL ppfd = new PerguntasPorFormulariosDAL(); perguntas = ppfd.ListaPerguntasVinculadas(idForm); string campos = ""; int numPergunta = 1; foreach (Perguntas pergunta in perguntas) { campos += "<h4>" + numPergunta + " - " + pergunta.Descricao + "</h4><br />"; campos += "<textarea name=\"resposta" + pergunta.IdPergunta + "\" class=\"contact textarea\" rows=\"5\" cols=\"100\" style=\"height: 70px; width: 800px;\" runat=\"server\"></textarea><br /><br />"; Response.Cookies["idPergunta"].Values[numPergunta.ToString()] = pergunta.IdPergunta.ToString(); numPergunta++; } Response.Cookies["idPergunta"].Expires = DateTime.Now.AddHours(4); ltrConteudo.Text = campos; } } catch (Exception) { lblMensagem.Text = "<h1>Não foi possível acessar o formulário. </h1>"; btnEnviar.Visible = false; } }
private void BindEmailList() { EmailCollection emailList = new EmailCollection(); emailList = EmailDAL.GetCollection(); //Bind to Repeater rptEmailList.DataSource = emailList; rptEmailList.DataBind(); }
public void Excluir(int pId, out int retval) { if (pId < 1) { throw new Exception("Selecione antes de excluir."); } EmailDAL obj = new EmailDAL(); obj.DELETE(pId, conStr, out retval); }
public void Alterar(Email email, out int retval) { if (email.Mail.Trim().Length == 0) { throw new Exception("O Email do Contato é Obrigatório"); } EmailDAL obj = new EmailDAL(); obj.Incluir(email, conStr, out retval); }
/// <summary> /// Date Created: 27/03/2012 /// Created By: Gabriel Oquialda /// (description) Load e-mail address /// </summary> public static IDataReader LoadEmailAddress(string BranchId) { try { IDataReader dr = null; dr = EmailDAL.LoadEmailAddress(BranchId); return(dr); } catch (Exception ex) { throw ex; } }
public void Excluir(int pId, out int retval) { if (pId < 1) { throw new Exception("Selecione antes de excluir."); } ContatosDAL obj = new ContatosDAL(); obj.DELETE(pId, conStr, out retval); if (retval > 0) { EmailDAL objEmail = new EmailDAL(); objEmail.DELETE(pId, conStr, out retval); TelefoneDAL objTel = new TelefoneDAL(); objTel.DELETE(pId, conStr, out retval); } }
protected void btnEnviar_Click(object sender, EventArgs e) { try { string link = "http://localhost:55682/Pages/FormularioRespostas?form="; EmailDAL email = new EmailDAL(); link += email.Criptografar(Request.QueryString["id"].ToString()) + "&"; link += "ep=" + email.Criptografar(txtEmpresa.Text) + "&"; link += "em=" + email.Criptografar(txtEmail.Text); email.Enviar(txtEmail.Text, link); lblMensagem.Text = "Email enviado com sucesso para a empresa " + txtEmpresa.Text; } catch (Exception ex) { lblMensagem.Text = ex.Message; } }
/// <summary> /// Date Created: 04/Mar/2013 /// Created By: Josephine Gad /// (description) Get email add of all Active Users /// </summary> /// <returns></returns> public static List <ActiveUserEmail> GetActiveUserEmail() { return(EmailDAL.GetActiveUserEmail()); }
/// <summary> /// Date Created: 28/03/2012 /// Created By: Gabriel Oquialda /// (description) Save e-mail address /// </summary> public static void SaveEmailAddress(string BranchId, string EmailTo, string EmailCc) { EmailDAL.SaveEmailAddress(BranchId, EmailTo, EmailCc); }
public EmailBL() { dal = new EmailDAL(); }