Exemple #1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DataTable dataTabe = (DataTable)this.ViewState["data"];

            if (!Page.IsValid)
            {
                return;
            }
            List <string> num = new List <string>();

            if (dataTabe.Rows.Count > 0)
            {
                foreach (DataRow dr in dataTabe.Rows)
                {
                    num.Add(dr["Keywords"].ToString());
                }
            }
            else
            {
                if (txt_keywords.Text == "")
                {
                    Message.Alert(this, "请添加关键词", "null");
                    return;
                }
                num.Add(txt_keywords.Text);
            }
            GridView1.DataSource = dataTabe;
            GridView1.DataBind();
            string group = txt_keyGroup.Text;

            if (group == "" && dd_keyGroup.SelectedIndex == 0)
            {
                Message.Alert(this, "请选择或填写一个关键词组名字", "null");
                return;
            }
            if (group == "")
            {
                group = dd_keyGroup.SelectedValue;
            }
            RPCResult r = PretreatmentProxy.GetPretreatment().AddKeywords(group, num);

            if (r.Success)
            {
                Message.Success(this, "添加成功", "null");
            }
            else
            {
                Message.Error(this, r.Message, "null");
            }
            this.ViewState["data"] = this.CreateTable();
        }
Exemple #2
0
        private void load()
        {
            DataTable dt = CreateTable();

            RPCResult <List <SMS> > r = PretreatmentProxy.GetPretreatment().GetSMSByAccount(Session["AccountID"].ToString());

            if (r.Success)
            {
                lbl_message.Visible = false;
                Label1.Text         = "当前要优先级调整短信条数是:" + r.Value.Count;
                List <SMS> smss = r.Value;
                if (smss.Count > 0)
                {
                    foreach (SMS s in smss)
                    {
                        DataRow dr = dt.NewRow();
                        dr["Audit"]         = GetAudit(s.Audit);
                        dr["SMSContent"]    = s.Content;
                        dr["ContentFilter"] = GetContentFilter(s.Filter);
                        dr["Level"]         = s.Level;
                        dr["SendTime"]      = s.SendTime;
                        dr["SerialNumber"]  = s.SerialNumber;
                        dr["StatusReport"]  = GetStatusReport(s.StatusReport);
                        dr["BussType"]      = GetBusstype(s.Channel);
                        dr["Signature"]     = s.Signature;
                        List <string> num = s.Number;
                        if (num.Count > 3)
                        {
                            dr["PhoneCount"] = num[0] + "," + num[1] + "," + num[2] + " 等" + num.Count + "个号码";
                        }
                        else
                        {
                            foreach (string st in num)
                            {
                                dr["PhoneCount"] += st + ",";
                            }
                        }
                        string s1 = dr["PhoneCount"].ToString();
                        if (s1[s1.Length - 1] == ',')
                        {
                            s1 = s1.Substring(0, s1.Length - 1);
                        }
                        dr["PhoneCount"] = s1;
                        dt.Rows.Add(dr);
                    }
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
            Session["dt"] = dt;
        }
Exemple #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string userPwd  = txtUserPwd.Text.Trim();
            //  string code = txtCode.Text.Trim();
            string userpwd2 = tools.DESEncrypt.Encrypt(userPwd);

            if (userName.Equals("") || userPwd.Equals(""))
            {
                return;
            }
            //if (code.Equals(""))
            //{
            //    lblTip.Visible = true;
            //    lblTip.Text = "请输入验证码";
            //    return;
            //}
            //if (Session[DTKeys.SESSION_CODE] == null)
            //{
            //    lblTip.Visible = true;
            //    lblTip.Text = "系统找不到验证码";
            //    return;
            //}
            //if (code.ToLower() != Session[DTKeys.SESSION_CODE].ToString().ToLower())
            //{
            //    lblTip.Visible = true;
            //    lblTip.Text = "验证码输入不正确";
            //    return;
            //}
            RPCResult <Account> r = PretreatmentProxy.GetPretreatment().GetAccount(userName);

            if (r.Success)
            {
                if (r.Value != null)
                {
                    Account acc = r.Value;
                    if (acc.Password == userpwd2)
                    {
                        Session["AccountID"] = userName;
                        Session["Password"]  = userpwd2;
                        Response.Redirect("index.aspx");
                    }
                    Message.Alert(this, "输入的密码错误");
                }
                Message.Alert(this, "用户不存在");
            }

            return;
        }
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string    a = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
            RPCResult r = PretreatmentProxy.GetPretreatment().DelAccount(a);

            if (r.Success)
            {
                Message.Success(this, r.Message, "null");
                //   load();
            }
            else
            {
                load();
                Message.Error(this, r.Message, "null");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         RPCResult <List <string> > r = PretreatmentProxy.GetPretreatment().GetKeyGroups();
         bool b = false;
         foreach (var v in r.Value)
         {
             dd_KeyGroup.Items.Add(new ListItem(v, v));
             if (!b)
             {
                 serach(v); b = true;
             }
         }
         dd_KeyGroup.Items.Insert(0, new ListItem("--请选择--", "-1"));
     }
 }
Exemple #6
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string    c = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
            Guid      d = Guid.Parse(c);
            RPCResult r = PretreatmentProxy.GetPretreatment().AffirmAuditFailureSMS(d);

            if (r.Success)
            {
                load();
                Message.Success(this, r.Message, "null");
            }
            else
            {
                load();
                Message.Error(this, r.Message, "null");
            }
        }
        protected void bt2_Click(object sender, EventArgs e)
        {
            long bt = DateTime.Now.Ticks;

            for (int i = 0; i <= GridView1.Rows.Count - 1; i++)
            {
                CheckBox CheckBox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox");
                if (CheckBox.Checked == true)
                {
                    string    se = GridView1.DataKeys[i].Value.ToString();
                    RPCResult r  = PretreatmentProxy.GetPretreatment().AuditSMS(Guid.Parse(se), false);
                }
            }
            CheckBoxAll.Checked = false;
            CheckBox1.Checked   = false;
            load();
            Message.Success(this, " 批量审核失败,耗时" + (decimal)((DateTime.Now.Ticks - bt) / 10000000) + "秒", "null");
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid)
            {
                return;
            }
            string    d = dd_Audit.SelectedItem.Value;
            RPCResult r = PretreatmentProxy.GetPretreatment().ChangeAccountAudit(txt_AccountID.Text, Session["password"].ToString(), GetAccountAudit(d));

            if (r.Success)
            {
                Message.Success(this, r.Message, "null");
            }
            else
            {
                Message.Success(this, r.Message, "null");
            }
        }
Exemple #9
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            DataTable dataTabe = (DataTable)this.ViewState["data"];

            if (!Page.IsValid)
            {
                return;
            }
            List <string> num = new List <string>();

            if (txt_phone.Text != "")
            {
                if (!IsNumeric(txt_phone.Text))
                {
                    Message.Alert(this, "请输入正确的手机号码", "null");
                    return;
                }
                else
                {
                    num.Add(txt_phone.Text.ToString());
                }
            }

            if (dataTabe.Rows.Count > 0)
            {
                foreach (DataRow dr in dataTabe.Rows)
                {
                    num.Add(dr["phone"].ToString());
                }
            }
            GridView1.DataSource = dataTabe;
            GridView1.DataBind();
            RPCResult r = PretreatmentProxy.GetPretreatment().AddBlacklist(num);

            if (r.Success)
            {
                Message.Success(this, r.Message, "null");
            }
            else
            {
                Message.Error(this, r.Message, "null");
            }
        }
Exemple #10
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string        a  = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
            List <string> dd = new List <string>();

            dd.Add(a);
            RPCResult r = PretreatmentProxy.GetPretreatment().DelBlacklist(dd);

            if (r.Success)
            {
                Message.Success(this, r.Message, "null");
                load();
            }
            else
            {
                load();
                Message.Error(this, r.Message, "null");
            }
        }
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string group    = this.GridView1.DataKeys[e.RowIndex][0].ToString();
            string keywords = this.GridView1.DataKeys[e.RowIndex][1].ToString();

            RPCResult r = PretreatmentProxy.GetPretreatment().DelKeywords(group, new List <string> {
                keywords
            });

            if (r.Success)
            {
                Message.Success(this, "删除成功", "null");
                serach(dd_KeyGroup.SelectedValue);
            }
            else
            {
                serach(dd_KeyGroup.SelectedValue);
                Message.Error(this, r.Message, "null");
            }
        }
Exemple #12
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string SerialNumber = e.CommandArgument.ToString();

            if (e.CommandName == "start")
            {
                string    d = ((DropDownList)this.GridView1.Rows[0].Cells[0].FindControl("dd_l")).SelectedValue;
                RPCResult r = PretreatmentProxy.GetPretreatment().SetSMSLevel(Guid.Parse(SerialNumber), GetSMSLevelType(d));
                if (r.Success)
                {
                    load();
                    Message.Success(this, r.Message, "null");
                }
                else
                {
                    load();
                    Message.Error(this, r.Message, "null");
                }
            }
        }
Exemple #13
0
        private void load()
        {
            DataTable dt = CreateTable();
            RPCResult <List <string> > r = PretreatmentProxy.GetPretreatment().GetBlacklist();

            if (r.Success)
            {
                lbl_message.Visible = false;
                List <string> ss = r.Value;
                if (ss.Count > 0)
                {
                    foreach (string s in ss)
                    {
                        DataRow dr = dt.NewRow();
                        dr["A"] = s;
                        dt.Rows.Add(dr);
                    }
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Exemple #14
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            SMSModel.Account acc = new SMSModel.Account();
            acc.AccountID = txt_UserID.Text.ToString();
            acc.Audit     = GetAccountAudit(dd_Audit.SelectedValue);
            string password = txt_Password.Text.ToString();

            acc.Password     = tools.DESEncrypt.Encrypt(password);
            acc.Priority     = GetAccountPriorityType(dd_Priority.SelectedValue);
            acc.RegisterDate = DateTime.Now;
            acc.SMSNumber    = Convert.ToInt32(txt_SMSNumber.Text.ToString());
            acc.SPNumber     = txt_SPNumber.Text.ToString();
            RPCResult r = PretreatmentProxy.GetPretreatment().CreateAccount(acc);

            if (r.Success)
            {
                Message.Success(this, r.Message, "null");
            }
            else
            {
                Message.Error(this, r.Message, "null");
            }
        }
        private void serach(string group)
        {
            DataTable dt = CreateTable();
            RPCResult <List <string> > r = PretreatmentProxy.GetPretreatment().GetKeywords(group);

            if (r.Success)
            {
                lbl_message.Visible = false;
                List <string> ss = r.Value;
                if (ss.Count > 0)
                {
                    foreach (string s in ss)
                    {
                        DataRow dr = dt.NewRow();
                        dr["Group"]    = dd_KeyGroup.SelectedValue;
                        dr["Keywords"] = s;
                        dt.Rows.Add(dr);
                    }
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        private void load()
        {
            DataTable dt = CreateTable();

            RPCResult <List <SMS> > r = PretreatmentProxy.GetPretreatment().GetSMSByAudit(DateTime.Now.AddMonths(-1), DateTime.Now);

            if (r.Success)
            {
                lbl_message.Visible = false;
                List <SMS> smss = r.Value;
                if (smss.Count > 0)
                {
                    foreach (SMS s in smss)
                    {
                        DataRow dr = dt.NewRow();
                        dr["AccountID"]     = s.Account;
                        dr["Audit"]         = GetAudit(s.Audit);
                        dr["SMSContent"]    = s.Content;
                        dr["ContentFilter"] = GetContentFilter(s.Filter);
                        dr["Level"]         = s.Level;
                        dr["SendTime"]      = s.SendTime;
                        dr["SerialNumber"]  = s.SerialNumber;
                        dr["StatusReport"]  = GetStatusReport(s.StatusReport);
                        dr["BussType"]      = GetBusstype(s.Channel);
                        dr["Signature"]     = s.Signature;
                        List <string> num = s.Number;
                        foreach (string st in num)
                        {
                            dr["Number"] += st + ",";
                        }
                        dt.Rows.Add(dr);
                    }
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Exemple #17
0
        private void load()
        {
            DataTable           dt = CreateTable();
            RPCResult <Account> r  = PretreatmentProxy.GetPretreatment().GetAccount(Session["AccountID"].ToString());

            if (r.Success)
            {
                if (r.Value != null)
                {
                    RPCResult <List <MOSMS> > rr = PretreatmentProxy.GetStatusReportService().GetMOSmsBySPNumber(Session["AccountID"].ToString(), Session["Password"].ToString(), r.Value.SPNumber);
                    if (r.Success)
                    {
                        lbl_message.Visible = false;
                        Label1.Text         = "当前已接收的短信条数是:" + rr.Value.Count;
                        List <MOSMS> smss = rr.Value;
                        if (smss.Count > 0)
                        {
                            foreach (MOSMS s in smss)
                            {
                                DataRow dr = dt.NewRow();
                                dr["Gateway"]     = s.Gateway;
                                dr["Message"]     = s.Message;
                                dr["ReceiveTime"] = s.ReceiveTime;
                                dr["Serial"]      = s.Serial;
                                dr["SPNumber"]    = s.SPNumber;
                                dr["UserNumber"]  = s.UserNumber;
                                dr["Service"]     = s.Service;
                                dt.Rows.Add(dr);
                            }
                        }
                    }
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Exemple #18
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            // DataTable dataTabe = (DataTable)this.ViewState["data"];
            DataTable dataTabe = (DataTable)Session["dt"];

            if (!Page.IsValid)
            {
                return;
            }
            if (txt_phone.Text != "")
            {
                if (!IsNumeric(txt_phone.Text))
                {
                    Message.Alert(this, "请输入正确的手机号码", "null");
                    return;
                }
            }
            if (txt_Content.Text.ToString().Trim() == "")
            {
                Message.Alert(this, "请输入短信内容", "null");
                return;
            }
            //if (txt_Signature.Text.ToString().Trim()== "")
            //{
            //    Message.Alert(this, "请填写签名", "null");
            //    return;
            //}
            SMS acc = new SMS();

            acc.Audit    = (AuditType)ushort.Parse(dd_Audit.SelectedValue);
            acc.Content  = txt_Content.Text.ToString().Trim();
            acc.Filter   = (FilterType)ushort.Parse(dd_ContentFilter.SelectedValue);
            acc.Level    = (LevelType)ushort.Parse(dd_Level.SelectedValue);
            acc.Account  = Session["AccountID"].ToString();
            acc.Password = Session["Password"].ToString();
            List <string> num = new List <string>();

            if (dataTabe.Rows.Count > 0)
            {
                foreach (DataRow dr in dataTabe.Rows)
                {
                    num.Add(dr["phone"].ToString());
                }
            }
            if (txt_phone.Text != "")
            {
                num.Add(txt_phone.Text.ToString());
            }
            acc.Number           = num;
            acc.SendTime         = DateTime.Now;
            acc.SerialNumber     = Guid.NewGuid();
            acc.StatusReport     = (StatusReportType)ushort.Parse(dd_StatusReport.SelectedValue);
            acc.Channel          = (ChannelType)ushort.Parse(dd_Busstype.SelectedValue);
            acc.Signature        = txt_Signature.Text.Trim().ToString();
            GridView1.DataSource = dataTabe;
            GridView1.DataBind();
            RPCResult r = PretreatmentProxy.GetPretreatment().SendSMS(acc);

            if (r.Success)
            {
                Message.Success(this, r.Message, "null");
            }
            else
            {
                Message.Error(this, r.Message, "null");
            }
        }