Esempio n. 1
0
        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;
            }
        }