Example #1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     SMSModel.GatewayConfiguration config = new SMSModel.GatewayConfiguration();
     config.Operators = new List <string>();
     foreach (ListItem li in cb_operators.Items)
     {
         if (li.Selected == true)
         {
             config.Operators.Add(li.Value);
         }
     }
     if (config.Operators.Count == 0)
     {
         Message.Alert(this, "请选择运营商", "null");
         return;
     }
     config.HandlingAbility = int.Parse(txt_handlity.Text);
     config.Gateway         = txt_gateway.Text;
     SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddGatewayConfig(config);
     if (r.Success)
     {
         Message.Success(this, "添加成功", "null");
     }
     else
     {
         Message.Alert(this, r.Message, "null");
     }
 }
        private void QueryByInputText()
        {
            DataTable dt       = CreateTable();
            string    condtion = txt_name.Text;

            SMSModel.RPCResult <List <Model.EnterpriseUser> > r = ZHSMSProxy.GetZHSMSPlatService().GetAuditEnterprises();
            if (r.Success)
            {
                List <Model.EnterpriseUser> enterprises = r.Value;

                foreach (Model.EnterpriseUser a in enterprises)
                {
                    DataRow dr = dt.NewRow();
                    dr["accountID"]    = a.AccountID;
                    dr["code"]         = a.AccountCode;
                    dr["name"]         = a.Name;
                    dr["contact"]      = a.Contact;
                    dr["phone"]        = a.Phone;
                    dr["address"]      = a.Address;
                    dr["registerDate"] = a.RegisterDate;
                    dt.Rows.Add(dr);
                }
                if (condtion != "")
                {
                    DataView dv = new DataView(dt);
                    dv.RowFilter = "code like '%" + condtion + "%' or name like '%" + condtion + "%'";
                    dt           = dv.ToTable();
                }
                this.ViewState["AgentEnterprises"] = dt;
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
        }
Example #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            List <string> gateways = new List <string>();

            foreach (DataListItem item in DataListGateway.Items)
            {
                System.Web.UI.WebControls.CheckBoxList cbk = (CheckBoxList)item.FindControl("Application_ID");
                for (int i = 0; i < cbk.Items.Count; i++)
                {
                    if (cbk.Items[i].Selected == true)
                    {
                        gateways.Add(cbk.Items[i].Value);
                    }
                }
            }

            if (gateways.Count > 0)
            {
                SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().AddChannelGatewayBind(lbl_channelID.Text, gateways);// BLL.Permission.AddRolePermission(roleID, gateways);
                if (ok.Success)
                {
                    Message.Success(this, "添加成功!", "null");
                }
                else
                {
                    Message.Alert(this, ok.Message, "null");
                }
            }
            else
            {
                Message.Alert(this, "请选择通道要绑定的网关", "null");
                return;
            }
        }
Example #4
0
 private void ChannelGatewayBindLoad()
 {
     foreach (DataListItem item in DataListGateway.Items)
     {
         System.Web.UI.WebControls.CheckBoxList cbk = (CheckBoxList)item.FindControl("Application_ID");
         foreach (ListItem li in cbk.Items)
         {
             li.Selected = false;
         }
     }
     SMSModel.RPCResult <List <string> > r = ZHSMSProxy.GetZHSMSPlatService().GetGatewaysByChannel(lbl_channelID.Text);
     if (r.Success)
     {
         foreach (string str in r.Value)
         {
             foreach (DataListItem item in DataListGateway.Items)
             {
                 System.Web.UI.WebControls.CheckBoxList cbk = (CheckBoxList)item.FindControl("Application_ID");
                 for (int i = 0; i < cbk.Items.Count; i++)
                 {
                     if (cbk.Items[i].Value == str)
                     {
                         cbk.Items[i].Selected = true;
                     }
                 }
             }
         }
     }
     else
     {
         btnSubmit.Visible = false;
         Message.Alert(this, r.Message, "null");
     }
 }
        void load()
        {
            DataTable dt      = CreateTable();
            string    account = Request.QueryString["AccountID"];

            SMSModel.RPCResult <List <Model.ChargeRecord> > r = ZHSMSProxy.GetZHSMSPlatService().GetEnterpriseChargeRecord(account, DateTime.Parse(txt_startTime.Text), DateTime.Parse(txt_endTime.Text));
            if (r.Success)
            {
                foreach (var v in r.Value)
                {
                    DataRow dr = dt.NewRow();
                    dr["operatorAccount"] = v.OperatorAccount;
                    dr["accountCode"]     = v.PrepaidAccount;
                    dr["number"]          = v.SMSCount;
                    dr["moneny"]          = v.Money;
                    dr["dateTime"]        = v.PrepaidTime;
                    dr["rate"]            = v.ThenRate;
                    dr["type"]            = v.PrepaidType == 0 ? "金额充值" : "短信条数充值";
                    dr["Remark"]          = v.Remark;
                    dt.Rows.Add(dr);
                }
            }
            dt.DefaultView.Sort  = "dateTime desc";
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #6
0
        private void LoadData(DateTime beg, DateTime end)
        {
            string sthml = string.Empty;

            //sthml += " <div class=\"gonggao_title\">公告列表</div>";
            sthml += "  <ul class=\"gonggao_con\">";
            SMSModel.RPCResult <List <Model.Annunciate> > no = ZHSMSProxy.GetZHSMSPlatService().GetAunnuciateByMangge(beg, end);
            if (no != null)
            {
                if (no.Value.Count > 0)
                {
                    foreach (Model.Annunciate g in no.Value)
                    {
                        sthml += " 	<li class=\"gg_con_title\">";
                        sthml += " <a href=\"javascript:void(0);\">";
                        sthml += "    <span class=\"title\">" + g.AnnunciateTitle + "</span>";
                        sthml += "   <span class=\"time\">" + g.CreateTime + "</span>";
                        sthml += " </a>";
                        sthml += "  </li>";
                        sthml += " <li class=\"gg_con_box\">";
                        sthml += " 	<div class=\"gg_open_title\">" + g.AnnunciateTitle + "<br /><span class=\"open_time\">" + g.CreateTime + "</span></div>";
                        sthml += "   <div class=\"gg_open_con\">" + g.AnnunciateContent + "<br />";
                        sthml += "   </div>";
                        sthml += " </li>";
                    }
                }
            }
            sthml += " </ul>";
            sthml += "</div>";
            this.tdInfo.InnerHtml = sthml;
        }
Example #7
0
        private void search(int pageIndex)
        {
            Model.EnterpriseUser user = (Model.EnterpriseUser)Session["Login"];
            DataTable            dt   = CreateTable();

            SMSModel.RPCResult <List <Model.AuditEnterprise> > r = ZHSMSProxy.GetZKD().GetFailueOrUnAuditEnterprises(user.AccountCode);
            if (r.Success)
            {
                List <Model.AuditEnterprise> list = r.Value;
                pageBottom(list.Count, pageIndex);
                int startIndex = pageIndex * GridView1.PageSize;
                if (startIndex != 0)
                {
                    list = list.Skip(startIndex).ToList();
                }
                list = list.Take(GridView1.PageSize).ToList();
                foreach (var s in list)
                {
                    DataRow dr = dt.NewRow();
                    dr["EnterpriseCode"]   = s.EnterpriseCode;
                    dr["EnterpriseName"]   = s.EnterpriseName;
                    dr["CreateTime"]       = s.CreateTime;
                    dr["AuditTime"]        = s.AuditTime;
                    dr["AuditResult"]      = s.AuditResult == true?"已审":"未审";
                    dr["Auditor"]          = s.Auditor;
                    dr["EnterpriseResult"] = s.EnterpriseResult == true?"通过":"未通过";
                    dr["AuditRemark"]      = s.AuditRemark;
                    dt.Rows.Add(dr);
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #8
0
        private void LoadData()
        {
            string AnnunciateID = Request.QueryString["AnnunciateID"];
            string sthml        = string.Empty;

            sthml += " <div class=\"gonggao_title\">公告详情</div>";
            sthml += "  <ul class=\"gonggao_con\">";
            SMSModel.RPCResult <Model.Annunciate> no = ZHSMSProxy.GetZHSMSPlatService().GetAnnunciate(AnnunciateID);
            if (no != null)
            {
                sthml += " 	<li class=\"gg_con_title\">";
                sthml += " <a href=\"javascript:void(0);\">";
                sthml += "    <span class=\"title\">" + no.Value.AnnunciateTitle + "</span>";
                sthml += "   <span class=\"time\">" + no.Value.CreateTime + "</span>";
                sthml += " </a>";
                sthml += "  </li>";
                sthml += " <li class=\"gg_con_box\">";
                sthml += " 	<div class=\"gg_open_title\">" + no.Value.AnnunciateTitle + "<br /><span class=\"open_time\">" + no.Value.CreateTime + "</span></div>";
                sthml += "   <div class=\"gg_open_con\">" + no.Value.AnnunciateContent + "<br />";
                sthml += "   </div>";
                sthml += " </li>";
            }
            sthml += " </ul>";
            sthml += "</div>";
            this.tdInfo.InnerHtml = sthml;
        }
Example #9
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Model.SysAccount account = BLL.SysAccount.GetAccount(Request.QueryString["accountID"]);
            account.UserName = txt_name.Text.Trim();
            account.Status   = rb_defalut.SelectedItem.Value == "0" ? false : true;
            account.Roles    = new List <string>();
            for (int i = 0; i < cb_roles.Items.Count; i++)
            {
                if (cb_roles.Items[i].Selected)
                {
                    account.Roles.Add(cb_roles.Items[i].Value);
                }
            }
            if (account.Roles.Count == 0)
            {
                Message.Alert(this, "请给帐号分配个角色", "null");
                return;
            }

            // BLL.SysAccount.Update(account);
            SMSModel.RPCResult r = ZHSMSPlatform.Root.ZHSMSProxy.GetZHSMSPlatService().UpdateSysAccount(account);
            if (r.Success)
            {
                Message.Success(this, "修改成功", "null");
            }
            else
            {
                Message.Alert(this, "修改失败");
            }
        }
Example #10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.Login.IsLogin();
     Model.SysAccount account = (Model.SysAccount)Session["Login"];
     if (account.UserCode != "admin")
     {
         string permissionValue = "AuditEnterprise.Manage.Audit";
         bool   ok = BLL.Permission.IsUsePermission(account.UserCode, permissionValue);
         if (!ok)
         {
             Message.Alert(this, "无权限", "null");
             return;
         }
     }
     if (!IsPostBack)
     {
         ProvinceLoad();
         SMSModel.RPCResult <List <SMSModel.Channel> > r = ZHSMSProxy.GetZHSMSPlatService().GetChannels();
         if (r.Success)
         {
             foreach (var v in r.Value)
             {
                 ListItem li = new ListItem();
                 li.Value = v.ChannelID;
                 li.Text  = v.ChannelName;
                 rb_SMSChannel.Items.Add(li);
             }
         }
         load();
     }
 }
Example #11
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     if (dd_agents.SelectedIndex == 0)
     {
         Message.Alert(this, "请选择代理商企业", "null");
         return;
     }
     SMSModel.RPCResult <Model.EnterpriseUser> r = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(lbl_account.Text);
     if (r.Success)
     {
         Model.EnterpriseUser user = r.Value;
         user.ParentAccountCode = dd_agents.SelectedValue;
         user.IsAgent           = false;
         SMSModel.RPCResult rt = ZHSMSProxy.GetZHSMSPlatService().UpdateAccontInfo(user);
         if (rt.Success)
         {
             Message.Success(this, "操作成功", "null");
             return;
         }
         else
         {
             Message.Alert(this, rt.Message, "null");
         }
     }
     else
     {
         Message.Alert(this, r.Message, "null");
     }
 }
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Model.SysAccount account = (Model.SysAccount)Session["Login"];
            if (account.UserCode != "admin")
            {
                bool ok = BLL.Permission.IsUsePermission(account.UserCode, del);
                if (!ok)
                {
                    Message.Alert(this, "无权限", "null");
                    return;
                }
            }
            string accountCode = this.GridView1.DataKeys[e.RowIndex][0].ToString();

            SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().DelEnterprise(accountCode);
            if (r.Success)
            {
                BLL.AccountEnterprise.Del(accountCode);
                Message.Success(this, "操作成功", "null");
                DataTable dt = (DataTable)this.ViewState["AgentLowerEnterprises"];
                dt.Rows.RemoveAt(e.RowIndex);
                this.ViewState["AgentLowerEnterprises"] = dt;
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
            else
            {
                Message.Alert(this, r.Message, "null");
            }
        }
Example #13
0
        private void LoadData(DateTime beg, DateTime end)
        {
            string sthml = string.Empty;

            //sthml += " <div class=\"gonggao_title\"></div>";
            sthml += "  <ul class=\"gonggao_con\">";
            Model.EnterpriseUser single = (Model.EnterpriseUser)Session["Login"];
            if (single.AccountID != null)
            {
                SMSModel.RPCResult <List <Model.Annunciate> > no = ZHSMSProxy.GetZKD().GetDirectAnnuciates(single.AccountCode, beg, end);
                if (no != null)
                {
                    if (no.Value.Count > 0)
                    {
                        foreach (Model.Annunciate g in no.Value)
                        {
                            sthml += " 	<li class=\"gg_con_title\">";
                            sthml += " <a href=\"javascript:void(0);\">";
                            sthml += "    <span class=\"title\">" + g.AnnunciateTitle + "</span>";
                            sthml += "   <span class=\"time\">" + g.CreateTime + "</span>";
                            sthml += " </a>";
                            sthml += "  </li>";
                            sthml += " <li class=\"gg_con_box\">";
                            sthml += " 	<div class=\"gg_open_title\">" + g.AnnunciateTitle + "<br /><span class=\"open_time\">" + g.CreateTime + "</span></div>";
                            sthml += "   <div class=\"gg_open_con\">" + g.AnnunciateContent + "<br />";
                            sthml += "   </div>";
                            sthml += " </li>";
                        }
                    }
                }
                sthml += " </ul>";
                sthml += "</div>";
                this.tdInfo.InnerHtml = sthml;
            }
        }
Example #14
0
 private void load()
 {
     dd_groups.Items.Clear();
     rb_types.Items.Clear();
     SMSModel.RPCResult <Dictionary <string, string> > r = ZHSMSProxy.GetZHSMSPlatService().GetKeyGroups();
     if (r.Success)
     {
         foreach (var v in r.Value)
         {
             ListItem li = new ListItem();
             li.Value = v.Key;
             li.Text  = v.Key;
             dd_groups.Items.Add(li);
         }
     }
     SMSModel.RPCResult <Dictionary <string, string> > rt = ZHSMSProxy.GetZHSMSPlatService().GetKeywordsTypes();
     if (rt.Success)
     {
         int i = 0;
         foreach (var v in rt.Value)
         {
             ListItem li = new ListItem();
             li.Value = v.Key;
             li.Text  = v.Key;
             rb_types.Items.Add(li);
             if (i == 0)
             {
                 li.Selected = true;
             }
             i++;
         }
     }
     dd_groups.Items.Insert(0, new ListItem("--请选择--", "-1"));
 }
Example #15
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (txt_code.Text.Trim() == "admin")
            {
                Message.Alert(this, "已存在此用户", "null");
                return;
            }
            bool ok = BLL.SysAccount.Exists(txt_code.Text.Trim());

            if (ok)
            {
                Message.Alert(this, "已存在此用户", "null");
                return;
            }
            if (txt_code.Text == "")
            {
                Message.Alert(this, "请填写帐号", "null");
                return;
            }
            if (txt_name.Text == "")
            {
                Message.Alert(this, "请填写姓名", "null");
                return;
            }
            if (txt_pass.Text == "")
            {
                Message.Alert(this, "请填写帐号密码", "null");
                return;
            }
            Model.SysAccount account = new Model.SysAccount();
            account.UserCode = txt_code.Text.Trim();
            account.UserName = txt_name.Text.Trim();
            account.Status   = rb_defalut.SelectedItem.Value == "0" ? false : true;
            account.PassWord = txt_pass.Text.Trim();
            account.AddTime  = DateTime.Now;
            account.Roles    = new List <string>();
            for (int i = 0; i < cb_roles.Items.Count; i++)
            {
                if (cb_roles.Items[i].Selected)
                {
                    account.Roles.Add(cb_roles.Items[i].Value);
                }
            }
            if (account.Roles.Count == 0)
            {
                Message.Alert(this, "请给帐号选个角色", "null");
                return;
            }
            //BLL.SysAccount.Add(account);
            //Message.Success(this, "添加成功", "null");
            SMSModel.RPCResult r = ZHSMSPlatform.Root.ZHSMSProxy.GetZHSMSPlatService().AddSysAccount(account);
            if (r.Success)
            {
                Message.Success(this, "添加成功", "null");
            }
            else
            {
                Message.Alert(this, "添加失败");
            }
        }
Example #16
0
        private void search(int pageIndex)
        {
            DataTable dt = CreateTable();

            SMSModel.RPCResult <List <Model.SMSTemplet> > r = ZHSMSProxy.GetZHSMSPlatService().GetAuditSMSTemplet(DateTime.Parse(txt_S.Text), DateTime.Parse(txt_E.Text));
            if (r.Success)
            {
                List <Model.SMSTemplet> list = r.Value;
                pageBottom(list.Count, pageIndex);
                int startIndex = pageIndex * GridView1.PageSize;
                if (startIndex != 0)
                {
                    list = list.Skip(startIndex).ToList();
                }
                list = list.Take(GridView1.PageSize).ToList();
                foreach (var s in list)
                {
                    DataRow dr = dt.NewRow();
                    dr["TempletID"]      = s.TempletID;
                    dr["AccountCode"]    = s.AccountCode;
                    dr["AccountName"]    = s.AccountName;
                    dr["TempletContent"] = s.TempletContent + s.Signature;
                    dr["SubmitTime"]     = s.SubmitTime;
                    dr["Signature"]      = s.Signature;
                    dt.Rows.Add(dr);
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #17
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.Login.IsLogin();
     Model.SysAccount account = (Model.SysAccount)Session["Login"];
     if (account.UserCode != "admin")
     {
         string permissionValue = Request.QueryString["type"] + "Enterprise.Manage.ReCharge";
         bool   ok = BLL.Permission.IsUsePermission(account.UserCode, permissionValue);
         if (!ok)
         {
             Message.Alert(this, "无权限", "null");
             return;
         }
     }
     if (!IsPostBack)
     {
         lbl_account.Text = Request.QueryString["AccountID"];
         string code = Request.QueryString["AccountID"];
         SMSModel.RPCResult <Model.EnterpriseUser> rp = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(code);
         if (rp.Success)
         {
             Model.EnterpriseUser user = rp.Value;                                                                        // BLL.EnterpriseUser.GetEnerprise(code);
             SMSModel.RPCResult <Model.UserBalance> r = ZHSMSProxy.GetZHSMSPlatService().GetBalance(code, user.Password); // ZHSMSProxy.GetPretreatmentService().GetAccount(user.AccountID);
             if (r.Success)
             {
                 lbl_Old.Text = r.Value.SmsBalance.ToString();
             }
         }
     }
 }
Example #18
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            Model.SysAccount account = (Model.SysAccount)Session["Login"];
            if (account.UserCode != "admin")
            {
                bool o = BLL.Permission.IsUsePermission(account.UserCode, del);
                if (!o)
                {
                    Message.Alert(this, "无权限", "null");
                    return;
                }
            }
            string c = this.GridView1.DataKeys[e.RowIndex].Value.ToString();

            SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().DelChannel(c);
            if (ok.Success)
            {
                Message.Success(this, "操作成功", "null");
                load();
            }
            else
            {
                Message.Alert(this, ok.Message, "null");
            }
        }
Example #19
0
        void load()
        {
            DataTable dt = CreateTable();

            SMSModel.RPCResult <string[, ]> r = ZHSMSProxy.GetZHSMSPlatService().GetSMSStatistics(DateTime.Parse(txt_Start.Text), DateTime.Parse(txt_End.Text));
            if (r.Success)
            {
                if (r.Value != null && r.Value.Length > 0)
                {
                    string[,] str = r.Value;
                    long sendcount    = str[0, 0] == "" ? 0 : long.Parse(str[0, 0]);
                    long failurecount = str[0, 1] == "" ? 0 : long.Parse(str[0, 1]);

                    DataRow dr = dt.NewRow();
                    dr["SendCount"]    = sendcount;
                    dr["SuccessCount"] = (sendcount - failurecount).ToString();
                    dr["FailureCount"] = failurecount;
                    if (sendcount == 0)
                    {
                        dr["SuccessRate"] = "没有短信发送";
                    }
                    else
                    {
                        dr["SuccessRate"] = Decimal.Round(((decimal)(sendcount - failurecount) / sendcount) * 100, 2) + "%";
                    }
                    dt.Rows.Add(dr);
                }
            }
            else
            {
                Message.Alert(this, r.Message, "null");
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
Example #20
0
 protected void btnFailuer_Click(object sender, EventArgs e)
 {
     //不通过
     if (txt_remark.Text.Trim() == "")
     {
         Message.Alert(this, "审核不通过时,请在审核备注里填写理由", "null");
         return;
     }
     Model.AuditEnterprise audit = new Model.AuditEnterprise();
     audit.Auditor          = ((Model.SysAccount)Session["Login"]).UserCode;
     audit.AuditRemark      = txt_remark.Text;
     audit.AuditResult      = true;
     audit.AuditTime        = DateTime.Now;
     audit.EnterpriseCode   = Request.QueryString["AccountID"];
     audit.EnterpriseResult = false;
     SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().UpdateAuditEnterprise(audit);
     if (r.Success)
     {
         btnFailuer.Enabled = false;
         btnSubmit.Enabled  = false;
         Message.Success(this, "操作成功", "null");
     }
     else
     {
         Message.Alert(this, r.Message, "null");
     }
     Response.Redirect("AuditEnterpriseManage.aspx");
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     BLL.Login.IsLogin();
     Model.SysAccount account = (Model.SysAccount)Session["Login"];
     if (account.UserCode != "admin")
     {
         string permissionValue = Request.QueryString["type"] + "Enterprise.Manage.SecretKeyReset";
         bool   ok = BLL.Permission.IsUsePermission(account.UserCode, permissionValue);
         if (!ok)
         {
             Message.Alert(this, "无权限", "null");
             return;
         }
     }
     if (!IsPostBack)
     {
         lbl_account.Text = Request.QueryString["AccountID"];
         SMSModel.RPCResult <Model.EnterpriseUser> r = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(lbl_account.Text);
         if (r.Success)
         {
             if (string.IsNullOrEmpty(r.Value.SecretKey))
             {
                 lbl_oldSecretKey.Text = "使用企业默认密钥";
             }
             else
             {
                 lbl_oldSecretKey.Text = r.Value.SecretKey;
             }
         }
     }
 }
Example #22
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string gateway  = Request.QueryString["gateway"];
            string keyGroup = "";

            foreach (ListItem li in rb_keyGroup.Items)
            {
                if (li.Selected == true)
                {
                    keyGroup = li.Value;
                }
            }
            if (keyGroup == "")
            {
                Message.Alert(this, "请选择要关联的关键词组", "null");
                return;
            }
            SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddkeyGroupGatewayBind(keyGroup, gateway);
            if (r.Success)
            {
                Message.Success(this, "操作成功", "null");
                return;
            }
            Message.Alert(this, r.Message, "null");
        }
Example #23
0
        protected void btn_infoSave_Click(object sender, EventArgs e)
        {
            //资料
            if (dd_city.SelectedIndex == 0 || dd_province.SelectedIndex == 0)
            {
                Message.Alert(this, "请选择地区信息", "null");
                return;
            }
            if (txt_name.Text.Trim() == "")
            {
                Message.Alert(this, "请填写企业名字", "null");
                return;
            }
            if (txt_contact.Text.Trim() == "")
            {
                Message.Alert(this, "请填写企业联系人", "null");
                return;
            }
            if (txt_phone.Text.Trim() == "")
            {
                Message.Alert(this, "请填写手机号码", "null");
                return;
            }
            if (!IsNumeric(txt_phone.Text.Trim()))
            {
                Message.Alert(this, "手机号码输入不正确", "null");
                return;
            }
            string code = Request.QueryString["AccountID"];

            SMSModel.RPCResult <Model.EnterpriseUser> r = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(code);
            if (r.Success)
            {
                Model.EnterpriseUser user = r.Value;
                user.Name     = txt_name.Text.Trim();
                user.Phone    = txt_phone.Text.Trim();
                user.Address  = txt_address.Text;
                user.Contact  = txt_contact.Text;
                user.City     = dd_city.SelectedItem.Value;
                user.Province = dd_province.SelectedItem.Value;
                SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().UpdateAccontInfo(user);// BLL.EnterpriseUser.UpdateAccontInfo(user);
                if (ok.Success)
                {
                    Message.Success(this, "操作成功", "null");
                }
                else
                {
                    Message.Alert(this, ok.Message, "null");
                }
            }
            else
            {
                Message.Alert(this, r.Message, "null");
            }
        }
Example #24
0
        private void load()
        {
            string    channelID = Request.QueryString["channel"];
            DataTable dt        = this.CreateGatewayTable();

            SMSModel.RPCResult <List <SMSModel.GatewayConfiguration> > rt = ZHSMSProxy.GetZHSMSPlatService().GetGatewayConfigs();
            if (rt.Success)
            {
                foreach (var v in rt.Value)
                {
                    DataRow dr = dt.NewRow();
                    dr["Gateway"] = v.Gateway;
                    if (v.Operators.Count == 1)
                    {
                        dr["Operators"] = v.Operators[0];
                    }
                    else if (v.Operators.Count == 2)
                    {
                        string str = "";
                        foreach (var o in v.Operators)
                        {
                            str += o + "_";
                        }
                        dr["Operators"] = str == "" ? "" : str.Substring(0, str.Length - 1);
                    }
                    else if (v.Operators.Count == 3)
                    {
                        dr["Operators"] = "three";
                    }
                    dt.Rows.Add(dr);
                }
                this.ViewState["gateway"] = dt;
            }
            else
            {
                Message.Alert(this, rt.Message, "null");
                btnSubmit.Visible = false;
                return;
            }

            SMSModel.RPCResult <SMSModel.Channel> r = ZHSMSProxy.GetZHSMSPlatService().GetSMSChannel(channelID);
            if (r.Success)
            {
                lbl_channelID.Text         = r.Value.ChannelID;
                lbl_channelName.Text       = r.Value.ChannelName;
                DataListGateway.DataSource = GetOperators();
                DataListGateway.DataBind();
                ChannelGatewayBindLoad();
            }
            else
            {
                btnSubmit.Visible = false;
                Message.Alert(this, r.Message, "null");
            }
        }
Example #25
0
        private void search()
        {
            DataTable dt = CreateTable();

            SMSModel.RPCResult <List <Model.SMSTemplet> > r = null;
            if (rbtnAll.Checked)
            {
                //全部
                r = ZHSMSProxy.GetZHSMSPlatService().GetAllSMSTemplet(DateTime.Parse(txt_S.Text), DateTime.Parse(txt_E.Text));
            }
            else if (rbtnSuccess.Checked)
            {
                //审核通过
                r = ZHSMSProxy.GetZHSMSPlatService().GetSuccessSMSTemplet(null, DateTime.Parse(txt_S.Text), DateTime.Parse(txt_E.Text));
            }
            else
            {
                //失败
                r = ZHSMSProxy.GetZHSMSPlatService().GetFailureSMSTemplet(null, DateTime.Parse(txt_S.Text), DateTime.Parse(txt_E.Text));
            }
            if (r.Success)
            {
                List <Model.SMSTemplet> list = r.Value.OrderByDescending(s => s.SubmitTime).ToList();
                foreach (var s in list)
                {
                    DataRow dr = dt.NewRow();
                    dr["TempletID"]      = s.TempletID;
                    dr["AccountCode"]    = s.AccountCode;
                    dr["AccountName"]    = s.AccountName;
                    dr["TempletContent"] = s.TempletContent + s.Signature;
                    dr["SubmitTime"]     = s.SubmitTime.ToString("yyyy-MM-dd HH:mm:ss");
                    dr["AuditTime"]      = s.AuditTime;
                    switch (s.AuditState)
                    {
                    case Model.TempletAuditType.NoAudit:
                        dr["AuditState"] = "未审核";
                        break;

                    case Model.TempletAuditType.Success:
                        dr["AuditState"] = "审核成功";
                        break;

                    case Model.TempletAuditType.Failure:
                        dr["AuditState"] = "审核失败";
                        break;
                    }
                    dr["Remark"]   = s.Remark;
                    dr["UserCode"] = s.UserCode;
                    dt.Rows.Add(dr);
                }
            }
            gvSMSTemplet.DataSource = dt;
            gvSMSTemplet.DataBind();
        }
        void load()
        {
            string templetID = Request.QueryString["TempletID"];

            SMSModel.RPCResult <Model.SMSTemplet> r = ZHSMSProxy.GetZHSMSPlatService().GetSMSTemplet(templetID);
            if (r.Success)
            {
                lbl_account.Text = r.Value.AccountName;
                lbl_content.Text = r.Value.TempletContent;
                lbl_submit.Text  = r.Value.SubmitTime.ToString();
            }
        }
Example #27
0
        private void search(int pageIndex)
        {
            DataTable dt = CreateTable();
            string    ss = this.ViewState["condition"].ToString();

            SMSModel.RPCResult <List <SMSModel.Keywords> > r = new SMSModel.RPCResult <List <SMSModel.Keywords> >(false, null, "");
            if (ss.Equals("group"))
            {
                if (dd_groups.SelectedIndex == 0)
                {
                    Message.Alert(this, "请选择一个词组", "null");
                    return;
                }
                r = ZHSMSProxy.GetZHSMSPlatService().GetKeywords(dd_groups.SelectedValue);
            }
            if (ss.Equals("type"))
            {
                if (dd_types.SelectedIndex == 0)
                {
                    Message.Alert(this, "请选择一个类型", "null");
                    return;
                }
                r = ZHSMSProxy.GetZHSMSPlatService().GetKeywordsByType(dd_types.SelectedValue);
            }
            if (ss.Equals("words"))
            {
                r = ZHSMSProxy.GetZHSMSPlatService().GetKeywordsByKeyword(txt_keywords.Text.Trim());
            }
            if (r.Success)
            {
                List <SMSModel.Keywords> list = r.Value;
                pageBottom(list.Count, pageIndex);
                int startIndex = pageIndex * GridView1.PageSize;
                if (startIndex != 0)
                {
                    list = list.Skip(startIndex).ToList();
                }
                list = list.Take(GridView1.PageSize).ToList();
                foreach (var s in list)
                {
                    DataRow dr = dt.NewRow();
                    dr["Group"]       = s.KeyGroup;
                    dr["Keywords"]    = s.Words;
                    dr["KeywordType"] = s.KeywordsType;
                    dr["Enable"]      = s.Enable == true ? "启用" : "禁用";
                    dr["Replace"]     = s.ReplaceKeywords;
                    dt.Rows.Add(dr);
                }
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();
        }
        private void QueryByInputText()
        {
            Model.SysAccount account  = (Model.SysAccount)Session["Login"];
            string           condtion = txt_name.Text.Trim();
            string           ddlcm    = txt_ddlCM.Text.Trim();

            SMSModel.RPCResult <List <Model.EnterpriseUser> > r = ZHSMSProxy.GetZHSMSPlatService().GetAgentEnterprises();
            if (r.Success)
            {
                List <Model.EnterpriseUser> enterprises = r.Value;// BLL.EnterpriseUser.GetAgentEnterprises();
                if (account.UserCode == "admin")
                {
                }
                else
                {
                    List <string> list = BLL.AccountEnterprise.GetEnterpriseByUserCode(account.UserCode);
                    if (list.Count == 1 && list[0] == "-1")//为-1时为全部Enterprise
                    {
                    }
                    else
                    {
                        //只取可以管理的Enterprise
                        enterprises = enterprises.Where(e => list.Where(s => e.AccountCode.Equals(s)).Count() > 0).ToList();
                    }
                }
                DataTable dt  = EnterprisesToTable(enterprises);
                var       ndt = dt.AsEnumerable();

                if (!string.IsNullOrWhiteSpace(ddlcm) && !string.IsNullOrWhiteSpace(condtion))
                {
                    ndt = ndt.Where(dr => dr["code"].ToString().IndexOf(condtion) > -1 || dr["name"].ToString().IndexOf(condtion) > -1 || dr["ChannelManager"].ToString().IndexOf(ddlcm) > -1 || dr["CSManager"].ToString().IndexOf(ddlcm) > -1);
                }
                else if (!string.IsNullOrWhiteSpace(condtion))
                {
                    ndt = ndt.Where(dr => dr["code"].ToString().IndexOf(condtion) > -1 || dr["name"].ToString().IndexOf(condtion) > -1);
                }
                else if (!string.IsNullOrWhiteSpace(ddlcm))
                {
                    ndt = ndt.Where(dr => dr["ChannelManager"].ToString().IndexOf(ddlcm) > -1 || dr["CSManager"].ToString().IndexOf(ddlcm) > -1);
                }
                dt = ndt.AsDataView().ToTable();
                //if (condtion != "")
                //{
                //    DataView dv = new DataView(dt);
                //    dv.RowFilter = "code like '%" + condtion + "%' or name like '%" + condtion + "%'";
                //    dt = dv.ToTable();
                //}
                this.ViewState["AgentEnterprises"] = dt;
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
        }
Example #29
0
 void load()
 {
     lbl_account.Text = Request.QueryString["AccountID"];
     SMSModel.RPCResult <Model.EnterpriseUser> rp = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(lbl_account.Text);
     if (rp.Success)
     {
         SMSModel.RPCResult <Model.UserBalance> r = ZHSMSProxy.GetZHSMSPlatService().GetBalance(lbl_account.Text, rp.Value.Password);
         if (r.Success)
         {
             lbl_smsCount.Text = r.Value.SmsBalance.ToString();
         }
     }
 }
Example #30
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddKeywordsGroup(txt_keyGroup.Text.Trim(), txt_remark.Text.Trim());
     if (r.Success)
     {
         load();
         Message.Success(this, "添加成功", "null");
     }
     else
     {
         Message.Alert(this, r.Message, "null");
     }
 }