Exemple #1
0
        public void LoadTable()
        {
            Hlp      Hlp      = new Hlp();
            DbHelper dbHelper = new DbHelper();

            TableRow[]  Row;
            DataTable   Table       = null;
            MessageCtrl messageCtrl = new MessageCtrl();

            String DataInicial  = txt_data_inicial.Text;
            String DataFinal    = txt_data_final.Text;
            String Destinatario = dd_destinatario.SelectedValue;

            try {
                String   Part       = dd_unidades.SelectedValue;
                String[] Empresa_id = Part.Split('-');
                if (!String.IsNullOrEmpty(DataInicial) && !String.IsNullOrEmpty(DataFinal))
                {
                    String Script2 = messageCtrl.Pesquisar(Destinatario, Convert.ToInt32(Empresa_id[0]), DataInicial, DataFinal);
                    Table = dbHelper.DisplayData(Script2);
                }

                Row = Hlp.TableLoad(Table);
                tbl_control.Rows.AddRange(Row);
                lbl_title_control.Text = " Qtd: " + Table.Rows.Count;
                Session.Add("Table", Table);
                Session.Add("quantidade_sms", Table.Rows.Count);
            } catch (Exception Err) {
            }
        }
Exemple #2
0
        public void LoadPage()
        {
            MessageCtrl Message    = new MessageCtrl();
            MessagePge  messagePge = new MessagePge();

            Literal.Text = Texto;
        }
        protected void btn_enviar_Click(object sender, EventArgs e)
        {
            SendMail    Mail    = new SendMail();
            MessageCtrl Message = new MessageCtrl();
            Hlp         Hlp     = new Hlp();
            DataTable   Table   = new DataTable();
            String      Msg;
            String      Category = (String)Session["Category"];

            try {
                Table = (DataTable)Session["Table"];

                if (Category.ToUpper() == "EMAIL" || Category.ToUpper() == "1")
                {
                    Msg = Hlp.MsgFormat(Message.CreateMsg, txt_img.Text, txt_link.Text, true);

                    Mail.Init(Table, Msg, txt_title.Text);
                }
                else if (Category.ToUpper() == "WHATSAPP" || Category.ToUpper() == "2")
                {
                    Session["Thread-New"] = true;
                    Session.Add("Texto", txt_description.Text);
                    Session["TableInit"] = null;
                    Response.Redirect("~/Views/Marketing/WaitingPge.aspx", false);
                }
                else if (Category.ToUpper() == "SMS" || Category.ToUpper() == "3")
                {
                    Session["Thread-New"] = true;
                    Session.Add("Texto", txt_description.Text);
                    Session["TableInit"] = null;
                    Session.Add("IsSms", true);
                    Session.Add("Enviados", 0);
                    Session.Add("Falhas", 0);
                    if (Session["Table"] != null)
                    {
                        Session.Add("quantidade_sms", Convert.ToInt32(txt_quantidade_sms.Text));
                    }
                    if (txt_list.Text != null && !String.IsNullOrEmpty(txt_list.Text))
                    {
                        Session.Add("List", txt_list.Text);
                    }
                    Response.Redirect("~/Views/Marketing/SmsPge.aspx", false);
                }
            } catch (Exception Err) {
                lbl_erro.Text = Err.Message + ' ' + Err.InnerException;
            }
        }
        protected void btn_visualizar_Click(object sender, EventArgs e)
        {
            MessageCtrl Message = new MessageCtrl();
            Hlp         Hlp     = new Hlp();

            //teste
            Texto = Hlp.MsgFormat(Message.CreateMsg, txt_img.Text, txt_link.Text, true);
            Texto = Hlp.MsgFormat(Texto, "Aluno", "*****@*****.**");

            //adiciona item a sessão

            /* btn_visualizar.Attributes.Add("target", "_blank");
             * btn_visualizar.Attributes.Add("onclick", "window.open('~/Views/Marketing/PrevizualizarPge.aspx');return false;");*/

            Session.Add("Texto", Texto);
            //Response.Redirect("~/Views/Marketing/PrevizualizarPge.aspx", false);
            Response.Write("<script> window.open( '~/Views/Marketing/PrevizualizarPge.aspx' ); </script>");
        }