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());
    }
예제 #2
0
    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());
    }
예제 #3
0
    protected void btnExcluir_Click(object sender, ImageClickEventArgs e)
    {
        int         Codigo = int.Parse(((ImageButton)sender).CommandArgument);
        FluxoEmails fe     = new FluxoEmails();

        fe.Codigo = Codigo;
        fe.Excluir();
        gridFluxo.DataSource = FluxoEmails.Listar();
        gridFluxo.DataBind();
    }
예제 #4
0
    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();
    }
예제 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LOGADO"] == null)
     {
         Response.Redirect("Default.aspx");
     }
     ;
     gridFluxo.DataSource = FluxoEmails.Listar();
     gridFluxo.DataBind();
     Session["Data"] = FluxoEmails.Listar();
 }
예제 #6
0
    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();
        }
    }
예제 #8
0
 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;
     }
 }
예제 #9
0
    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);
        }
    }
예제 #10
0
    protected void btnGravar_Click(object sender, EventArgs e)
    {
        bool validacao = true;

        if (ValidParam.ValidarTamanho(txtTitulo.Text.Trim(), 200) == false)
        {
            lblResultado.Text = "Tamanho máximo permitido para o campo resumo é de 200 caracteres.";
            validacao         = false;
        }
        if (ValidParam.ValidarTamanho(txtSequencia.Text.Trim(), 3) == false)
        {
            lblResultado.Text = "Tamanho máximo permitido para o campo titulo é de 3 caracteres.";
            validacao         = false;
        }

        if (validacao == true)
        {
            FluxoEmails fe = new FluxoEmails();
            fe.Titulo              = ValidParam.ValidarParametro(txtTitulo.Text.Trim());
            fe.Sequencia           = ValidParam.ValidarParametro(txtSequencia.Text.Trim());
            fe.Tempo_Proximo_Envio = ValidParam.ValidarParametro(txtDias.Text.Trim());
            fe.Cd_Pacote           = ValidParam.ValidarParametro(txtPacote.Text.Trim());

            if (lblCodigo.Text == "-")
            {
                fe.Inserir();
            }
            else
            {
                fe.Codigo = int.Parse(lblCodigo.Text);
                fe.Atualizar();
            }
            gridFluxo.DataSource = FluxoEmails.Listar();
            gridFluxo.DataBind();
            btnNovo_Click(sender, e);
            lblResultado.Text = "";
        }
    }
예제 #11
0
    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());
    }
예제 #12
0
 protected void bntFiltrar_Click(object sender, EventArgs e)
 {
     Session["Data"]      = FluxoEmails.ListarPacote(txtFiltra.Text.Trim());
     gridFluxo.DataSource = Session["Data"];
     gridFluxo.DataBind();
 }