protected void btnEnviar_Click(object sender, EventArgs e) { lblMensagem.Text = ""; lblMensagem.Visible = false; if (!ValidaTamanhodaImagem(FileUploadImagem.PostedFile.InputStream, 600, 400)) { lblMensagem.Visible = true; lblMensagem.Text = "Tamanho da imagem fora do padrão - Utilize uma imagem 600px x 400px "; return; } if (this.FileUploadImagem.PostedFile.ContentLength != 0 && this.FileUploadImagem.HasFile) { //capturando nome original do arquivo string fileName = this.FileUploadImagem.FileName; //capturando extensão do arquivo postado string extension = System.IO.Path.GetExtension(fileName); //Se existir o diretorio entao exclui e cria um novo sem imagem. string DiretorioPacote = Request.ServerVariables["APPL_PHYSICAL_PATH"] + @"PACOTE\" + Request.QueryString["CD_PACOTE"].ToString(); //Cria diretório com o código. System.IO.Directory.CreateDirectory(DiretorioPacote); string vCamArq = DiretorioPacote + "\\" + fileName; // Atualizar campo no fluxo do e-mail FluxoEmails ef = new FluxoEmails(); ef.Carregar(int.Parse(Request.QueryString["cd_fluxo_emails"].ToString())); ef.Imagem = FileUploadImagem.FileName; ef.AtualizarImagem(); //Salvando o arquivo com o nome original this.FileUploadImagem.PostedFile.SaveAs(vCamArq); } Response.Redirect("AdminEmailImagens.aspx?cd_pacote=" + Request.QueryString["CD_PACOTE"].ToString() + "&cd_fluxo_emails=" + Request.QueryString["cd_fluxo_emails"].ToString()); }
protected void btnAnexoPacote_Click1(object sender, ImageClickEventArgs e) { Session["cd_fluxo_emails"] = int.Parse(((ImageButton)sender).CommandArgument.ToString()); FluxoEmails fe = new FluxoEmails(); fe.Carregar(int.Parse(((ImageButton)sender).CommandArgument.ToString())); Response.Redirect("AdminEmailAnexo.aspx?cd_pacote=" + fe.Cd_Pacote.ToString() + "&cd_fluxo_emails=" + Session["cd_fluxo_emails"].ToString()); }
protected void btbGravar_Click(object sender, EventArgs e) { FluxoEmails fe = new FluxoEmails(); fe.Carregar(int.Parse(Request.QueryString["CD_FLUXO_EMAILS"].ToString())); fe.Corpo = ValidParam.ValidarEditor(txtEditorHTML.Text); fe.Tempo_Proximo_Envio = ValidParam.ValidarParametro(txtDias.Text.Trim()); fe.Sequencia = ValidParam.ValidarParametro(txtSequencia.Text.Trim()); fe.Titulo = ValidParam.ValidarParametro(txtTitulo.Text.Trim()); fe.AtualizarEmail(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["LOGADO"] == null) { Response.Redirect("Default.aspx"); } ; FluxoEmails ef = new FluxoEmails(); ef.Carregar(int.Parse(Request.QueryString["cd_fluxo_emails"].ToString())); lblTitulo.Text = ef.Titulo.ToString(); lblcaminhodaimagem.Text = ef.Anexo; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["LOGADO"] == null) { Response.Redirect("Default.aspx"); } ; FluxoEmails ef = new FluxoEmails(); ef.Carregar(int.Parse(Request.QueryString["cd_fluxo_emails"].ToString())); lblTitulo.Text = ef.Titulo.ToString(); lblcaminhodaimagem.Text = ef.Imagem; ImgPacote.ImageUrl = "~\\PACOTE\\" + Request.QueryString["CD_PACOTE"].ToString() + "\\" + ef.Imagem.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["LOGADO"] == null) { Response.Redirect("Default.aspx"); } ; FluxoEmails fe = new FluxoEmails(); fe.Carregar(int.Parse(Request.QueryString["CD_FLUXO_EMAILS"].ToString())); Session["CD_FLUXO_EMAILS"] = Request.QueryString["CD_FLUXO_EMAILS"].ToString(); txtTitulo.Text = fe.Titulo.ToString(); txtSequencia.Text = fe.Sequencia.ToString(); txtDias.Text = fe.Tempo_Proximo_Envio.ToString(); txtEditorHTML.Text = fe.Corpo; } }
protected void btnAlterar_Click(object sender, ImageClickEventArgs e) { int codigo = int.Parse(((ImageButton)sender).CommandArgument.ToString()); FluxoEmails fe = new FluxoEmails(); if (fe.Carregar(codigo)) { lblCodigo.Text = codigo.ToString(); txtPacote.Text = fe.Cd_Pacote.ToString(); txtTitulo.Text = fe.Titulo.ToString(); txtSequencia.Text = fe.Sequencia.ToString(); txtDias.Text = fe.Tempo_Proximo_Envio.ToString(); } else { btnNovo_Click(sender, e); } }
protected void btnEnviar_Click(object sender, EventArgs e) { if (this.FileUploadImagem.PostedFile.ContentLength != 0 && this.FileUploadImagem.HasFile) { //capturando nome original do arquivo string fileName = this.FileUploadImagem.FileName; //capturando extensão do arquivo postado string extension = System.IO.Path.GetExtension(fileName); //Se existir o diretorio entao exclui e cria um novo sem imagem. string DiretorioPacote = Request.ServerVariables["APPL_PHYSICAL_PATH"] + @"PACOTE\" + Request.QueryString["CD_PACOTE"].ToString(); //Cria diretório com o código. System.IO.Directory.CreateDirectory(DiretorioPacote); string vCamArq = DiretorioPacote + "\\" + fileName; // Atualizar campo no fluxo do e-mail FluxoEmails ef = new FluxoEmails(); ef.Carregar(int.Parse(Request.QueryString["cd_fluxo_emails"].ToString())); ef.Anexo = FileUploadImagem.FileName; ef.AtualizarAnexo(); //Salvando o arquivo com o nome original this.FileUploadImagem.PostedFile.SaveAs(vCamArq); } Response.Redirect("AdminEmailAnexo.aspx?cd_pacote=" + Request.QueryString["CD_PACOTE"].ToString() + "&cd_fluxo_emails=" + Request.QueryString["cd_fluxo_emails"].ToString()); }