void load() { string gateway = Request.QueryString["gateway"]; SMSModel.RPCResult <SMSModel.GatewayConfiguration> r = ZHSMSProxy.GetZHSMSPlatService().GetGatewayConfig(gateway); if (r.Success) { SMSModel.GatewayConfiguration config = r.Value; if (config != null) { lbl_gateway.Text = config.Gateway; foreach (var v in config.Operators) { if (cb_operators.Items.FindByValue(v) != null) { cb_operators.Items.FindByValue(v).Selected = true; } } txt_handlity.Text = config.HandlingAbility.ToString(); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { SMSModel.Channel c = new SMSModel.Channel(); c.ChannelID = txt_channelID.Text.Trim(); c.ChannelName = txt_channelName.Text.Trim(); c.Remark = txt_remark.Text.Trim(); if (c.ChannelID == "-1-") { Message.Alert(this, "已存在此短信通道", "null"); return; } SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddChannel(c); if (r.Success) { Message.Success(this, "添加成功", "null"); } else { Message.Alert(this, r.Message, "null"); } }
void load() { string accountName = txt_name.Text.Trim(); long smsCount = 0; long sendCount = 0; long remainSmsCount = 0; decimal money = 0; string account = Request.QueryString["AccountID"]; DataTable dt = CreateTable(); SMSModel.RPCResult <List <Model.ChargeStatics> > r = ZHSMSProxy.GetZHSMSPlatService().GetChargeStatics(accountName); if (r.Success) { foreach (var v in r.Value) { DataRow dr = dt.NewRow(); dr["accountCode"] = v.Enterprese; dr["smsCount"] = v.SMSCount; dr["moneny"] = v.TotalMoney; dr["sendCount"] = v.SendCount; dr["remainCount"] = v.RemainSMSNumber; dt.Rows.Add(dr); smsCount += v.SMSCount; sendCount += v.SendCount; remainSmsCount += v.RemainSMSNumber; money += v.TotalMoney; } } else { Message.Alert(this, r.Message, "null"); } lbl_money.Text = money.ToString(); lbl_remainSMSCount.Text = remainSmsCount.ToString(); lbl_sendSMSCount.Text = sendCount.ToString(); lbl_smsCount.Text = smsCount.ToString(); GridView1.DataSource = dt; GridView1.DataBind(); }
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { string account = e.CommandArgument.ToString(); if (e.CommandName == "upgrade") { SMSModel.RPCResult <Model.EnterpriseUser> r = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(account);// BLL.EnterpriseUser.GetEnerprise(accountID); if (r.Success) { Model.EnterpriseUser user = r.Value; user.IsAgent = true; user.ParentAccountCode = "-1"; ZHSMSProxy.GetZHSMSPlatService().UpdateAccountSetting(user);// BLL.EnterpriseUser.UpdateAccountSetting(user); QueryByInputText(); } else { Message.Alert(this, r.Message, "null"); } } }
private void load() { string gateway = Request.QueryString["gateway"]; lbl_gateway.Text = gateway; SMSModel.RPCResult <Dictionary <string, string> > r = ZHSMSProxy.GetZHSMSPlatService().GetKeyGroups(); SMSModel.RPCResult <string> ra = ZHSMSProxy.GetZHSMSPlatService().GetKeyGroupGatewayBinds(gateway); if (r.Success && ra.Success) { foreach (var v in r.Value) { ListItem li = new ListItem(); li.Value = v.Key; li.Text = v.Key; rb_keyGroup.Items.Add(li); if (ra.Value.Contains(li.Value)) { li.Selected = true; } } } }
private void load() { DataTable dt = CreateTable(); string account = Request.QueryString["AccountID"]; RPCResult <List <SMS> > r = ZHSMSProxy.GetZHSMSPlatService().GetSMSByAccount(account); if (r.Success) { lbl_message.Visible = false; Label1.Text = "当前需要调整的优先级短信有" + r.Value.Count + "条"; foreach (SMS s in r.Value) { 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["Signature"] = s.Signature; List <string> num = s.Number; string str = ""; foreach (string st in num) { str += st + ","; } dr["PhoneCount"] = str == "" ? "" : str.Substring(0, str.Length - 1); dt.Rows.Add(dr); } } else { Message.Alert(this, r.Message, "null"); } GridView1.DataSource = dt; GridView1.DataBind(); }
private void load() { SMSModel.RPCResult <List <SMSModel.Channel> > r = ZHSMSProxy.GetZHSMSPlatService().GetChannels(); DataTable dt = CreateTable(); if (r.Success) { foreach (var config in r.Value) { DataRow dr = dt.NewRow(); dr["ChannelID"] = config.ChannelID; dr["ChannelName"] = config.ChannelName; dr["Remark"] = config.Remark; SMSModel.RPCResult <List <string> > rr = ZHSMSProxy.GetZHSMSPlatService().GetGatewaysByChannel(config.ChannelID); if (rr.Success) { List <string> list = rr.Value; if (list.Count > 0) { string str = ""; foreach (string a in list) { str += a + ","; } dr["Bind"] = str == "" ? "无" : str.Substring(0, str.Length - 1); } else { dr["Bind"] = "无"; } } dt.Rows.Add(dr); } } GridView1.DataSource = dt; GridView1.DataBind(); Session["dt"] = dt; }
void load() { string accountCode = Request.QueryString["AccountID"]; SMSModel.RPCResult <Model.EnterpriseUser> r = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(accountCode); if (r.Success) { Model.EnterpriseUser account = r.Value;// BLL.EnterpriseUser.GetEnerprise(code); lbl_account.Text = account.AccountCode; lbl_accountAudit.Text = GetAccountAuditType(account.Audit); lbl_accountEnable.Text = account.Enabled == true ? "启用" : "禁用"; lbl_accountLevel.Text = ((ushort)account.Priority).ToString(); lbl_address.Text = account.Address; dd_province.Items.FindByValue(account.Province).Selected = true; CityLoad(account.Province); dd_city.Items.FindByValue(account.City).Selected = true; //lbl_area.Text = ProvinceLoad(account.Province) + " " + CityLoad(account.City); lbl_contact.Text = account.Contact; lbl_name.Text = account.Name; lbl_phone.Text = account.Phone; lbl_spNumber.Text = account.SPNumber; SMSModel.RPCResult <SMSModel.Channel> rt = ZHSMSProxy.GetZHSMSPlatService().GetSMSChannel(account.Channel); if (rt.Success) { lbl_smsChannel.Text = rt.Value.ChannelName == "" ? "所有通道" : rt.Value.ChannelName; } else { lbl_smsChannel.Text = "无"; } lbl_smsFilter.Text = GetFilteType((SMSModel.FilterType)account.Filter); lbl_smsLevel.Text = account.Level.ToString(); lbl_smsReport.Text = GetReportStatus((SMSModel.StatusReportType)account.StatusReport); dd_city.Enabled = false; dd_province.Enabled = false; } }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { if ((bool)this.ViewState["del"] == false) { Message.Alert(this, "无权限", "null"); return; } string group = this.GridView1.DataKeys[e.RowIndex][0].ToString(); string keywords = this.GridView1.DataKeys[e.RowIndex][1].ToString(); SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().DelKeywords(group, new List <string> { keywords }); if (r.Success) { search(this.CurrentPage); Message.Success(this, "删除成功", "null"); } else { Message.Error(this, r.Message, "null"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { string gateway = Request.QueryString["gateway"]; SMSModel.RPCResult <SMSModel.GatewayConfiguration> rpc = ZHSMSProxy.GetZHSMSPlatService().GetGatewayConfig(gateway); if (rpc.Success) { SMSModel.GatewayConfiguration config = rpc.Value; config.Operators.Clear(); 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); SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().UpdateGatewayConfig(config); if (r.Success) { Message.Success(this, "操作成功", "null"); } else { Message.Alert(this, r.Message, "null"); } } else { Message.Alert(this, rpc.Message, "null"); } }
protected void bt1_Click(object sender, EventArgs e) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { bool ok = BLL.Permission.IsUsePermission(account.UserCode, suc); if (!ok) { bt1.Visible = false; Message.Alert(this, "无权限", "null"); return; } } int j = 0; for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { CheckBox CheckBox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox"); if (CheckBox.Checked == true) { j++; string serialNumber = GridView1.DataKeys[i].Value.ToString(); RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AuditSMS(Guid.Parse(serialNumber), true, account.UserCode, ""); } } CheckBoxAll.Checked = false; CheckBox1.Checked = false; load(); if (j > 0) { Message.Success(this, " 审核成功", "null"); } else { Message.Alert(this, "请选择要审核的短信", "null"); } }
private void load() { SMSModel.RPCResult <List <SMSModel.GatewayConfiguration> > r = ZHSMSProxy.GetZHSMSPlatService().GetGatewayConfigs(); DataTable dt = CreateTable(); if (r.Success) { foreach (var config in r.Value) { DataRow dr = dt.NewRow(); dr["gateway"] = config.Gateway; List <string> a = config.Operators; string aaa = string.Empty; foreach (string aa in a) { if (aa == "mobile") { aaa += "移动;"; } if (aa == "unicom") { aaa += "联通;"; } if (aa == "telecom") { aaa += "电信;"; } dr["operators"] = aaa.Substring(0, aaa.Length - 1); } dr["handlingAbility"] = config.HandlingAbility; dt.Rows.Add(dr); } } GridView1.DataSource = dt; GridView1.DataBind(); Session["dt"] = dt; }
void load() { lbl_account.Text = Request.QueryString["accountID"]; SMSModel.RPCResult <List <Model.EnterpriseUser> > r = ZHSMSProxy.GetZHSMSPlatService().GetAgentEnterprises(); SMSModel.RPCResult <Model.EnterpriseUser> rr = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(lbl_account.Text); if (r.Success) { foreach (var v in r.Value) { ListItem li = new ListItem(); li.Value = v.AccountCode; li.Text = v.Name; dd_agents.Items.Add(li); } dd_agents.Items.Insert(0, new ListItem("--请选择--", "-2")); } if (rr.Success) { if (dd_agents.Items.FindByValue(rr.Value.ParentAccountCode) != null) { dd_agents.Items.FindByValue(rr.Value.ParentAccountCode).Selected = true; } } }
void load() { string code = Request.QueryString["AccountID"]; DataTable dt = CreateTable(); SMSModel.RPCResult <string[, ]> r = ZHSMSProxy.GetZHSMSPlatService().GetAccountSMSStatistics(code, 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(); }
protected void btnSubmit_Click(object sender, EventArgs e) { //^\w+$ string secretKey = txt_newSecretKey.Text.Trim(); string account = Request.QueryString["AccountID"]; if (secretKey == "") { Message.Alert(this, "密钥不能为空", "null"); return; } if (secretKey.Length != 16) { Message.Alert(this, "请输入长度为16位的密钥!", "null"); return; } //bool flag = Regex.IsMatch(secretKey, @"^\w+$"); //if (flag) //{ //} //else //{ // Message.Alert(this, "密钥由字母和数字组成!", "null"); // return; //} SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().UpdateAccountSecretKey(account, secretKey); if (ok.Success) { Message.Success(this, "操作成功", "null"); } else { Message.Alert(this, ok.Message, "null"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { string account = Request.QueryString["AccountID"]; if (!txt_Pass.Text.Equals(txt_Pass2.Text)) { Message.Alert(this, "确认密码与新密码不一致,请重新输入", "null"); return; } if (!IsPassword(txt_Pass.Text)) { Message.Alert(this, "密码必须是以字母开头,长度在6~18之间,只能包含字母、数字和下划线", "null"); return; } SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().ResetEnterprisePass(account, txt_Pass.Text.Trim()); if (ok.Success) { Message.Success(this, "操作成功", "null"); } else { Message.Alert(this, ok.Message, "null"); } }
private void QueryByInputText(DateTime beg, DateTime end) { DataTable dt = CreateTable(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; //string ro = string.Empty; //List<string> role = new List<string>(); //role = account.Roles; //foreach (string a in role) //{ // ro = a; //} SMSModel.RPCResult <List <Model.Annunciate> > r = ZHSMSProxy.GetZHSMSPlatService().GetAunnuciateByMangge(beg, end); if (r.Success) { List <Model.Annunciate> an = r.Value; foreach (Model.Annunciate a in an) { List <string> num = new List <string>(); DataRow dr = dt.NewRow(); dr["AnnunciateAccount"] = a.AnnunciateAccount; if (a.AnnunciateContent.Length > 30) { dr["AnnunciateContent"] = a.AnnunciateContent.Substring(0, 30); } else { dr["AnnunciateContent"] = a.AnnunciateContent; } dr["AnnunciateID"] = a.AnnunciateID; dr["AnnunciateTitle"] = a.AnnunciateTitle; dr["CreateTime"] = a.CreateTime; dr["PlatType"] = GetSysPlatType(a.PlatType); dr["AnnunciateType"] = GetAnnunciateType(a.Type); num = a.Users; if (a.Users.Count > 3) { dr["UserLists"] = num[0] + "," + num[1] + "," + num[2] + " 等" + num.Count + "个用户"; } else { foreach (string st in num) { dr["UserLists"] += st + ","; } } dt.Rows.Add(dr); } //if (condtion != "") //{ // DataView dv = new DataView(dt); // dv.RowFilter = "UserLists like '%" + condtion + "%' or AnnunciateAccount like '%" + condtion + "%'"; // dt = dv.ToTable(); //} this.ViewState["AgentEnterprises"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); } }
protected void btnSubmit_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; } if (txt_spNumber.Text.Trim() == "") { Message.Alert(this, "请填写企业接入号码", "null"); return; } if (!System.Text.RegularExpressions.Regex.IsMatch(txt_spNumber.Text.Trim(), @"^[0-9]+$")) { Message.Alert(this, "企业接入号码是应为数字", "null"); return; } if (txt_smsSigure.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; user.Audit = (SMSModel.AccountAuditType)(int.Parse(rb_accountAudit.SelectedValue)); user.Enabled = true; user.Priority = (SMSModel.AccountPriorityType)(int.Parse(rb_accountLevel.SelectedValue)); user.SPNumber = txt_spNumber.Text.Trim(); user.IsOpen = rb_isOpen.SelectedValue == "1" ? true : false; SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().UpdateEnterprise(user);// BLL.EnterpriseUser.UpdateAccontInfo(user); if (ok.Success) { SMSModel.SMS sms = new SMSModel.SMS(); sms.Account = user.AccountCode; sms.Channel = rb_SMSChannel.SelectedValue == "-1-" ? "" : rb_SMSChannel.SelectedValue; sms.Filter = (SMSModel.FilterType)(int.Parse(rb_SMSFilter.SelectedValue)); sms.Level = (SMSModel.LevelType)(int.Parse(rb_SMSLevel.SelectedValue)); sms.StatusReport = (SMSModel.StatusReportType)(int.Parse(rb_SMSReportType.SelectedValue)); sms.Signature = txt_smsSigure.Text.Trim(); SMSModel.RPCResult rs = ZHSMSProxy.GetZHSMSPlatService().UpdateEnterpriseSMS(sms); if (rs.Success) { 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 = user.AccountCode; audit.EnterpriseResult = true; ZHSMSProxy.GetZHSMSPlatService().UpdateAuditEnterprise(audit); btnFailuer.Enabled = false; btnSubmit.Enabled = false; Message.Success(this, "操作成功", "null"); //return; } } else { Message.Alert(this, ok.Message, "null"); } } else { Message.Alert(this, r.Message, "null"); } Response.Redirect("AuditEnterpriseManage.aspx"); }
private void load(bool?bSuccess) { DateTime starttime = Convert.ToDateTime(txt_Start.Text); DateTime endtime = Convert.ToDateTime(txt_End.Text); if (DateTime.Compare(starttime, endtime) >= 0) { Message.Alert(this, "开始时间应小于结束时间", "null"); return; } DataTable dt = CreateTable(); if (bSuccess == null || bSuccess.Value) { RPCResult <List <AuditRecord> > r = ZHSMSProxy.GetZHSMSPlatService().GetAuditRecords(starttime, endtime); if (r.Success) { List <AuditRecord> au = r.Value; if (bSuccess != null) { //加一层过滤,只要审核通过的 au = au.Where(c => c.Result == true).ToList(); } au = au.OrderByDescending(c => c.SendTime).ToList(); lbl_message.Visible = false; Label1.Text = "审核记录短信有" + au.Count + "条"; if (au.Count > 0) { foreach (AuditRecord s in au) { DataRow dr = dt.NewRow(); dr["AccountID"] = s.AccountID; dr["SerialNumber"] = s.SerialNumber; dr["Content"] = s.Content; dr["AuditTime"] = s.AuditTime; dr["SendTime"] = s.SendTime; dr["Result"] = s.Result == true ? "成功" : "失败"; dr["FailureCase"] = "无"; dt.Rows.Add(dr); } } } else { Message.Alert(this, r.Message, "null"); } } else { RPCResult <List <FailureSMS> > r = ZHSMSProxy.GetZHSMSPlatService().GetSMSByAuditFailure(starttime, endtime); if (r.Success) { lbl_message.Visible = false; Label1.Text = "审核记录短信有" + r.Value.Count + "条"; List <FailureSMS> au = r.Value.OrderByDescending(f => f.SendTime).ToList(); if (au.Count > 0) { foreach (FailureSMS s in au) { DataRow dr = dt.NewRow(); dr["AccountID"] = s.AuditUser; dr["SerialNumber"] = s.SerialNumber; dr["Content"] = s.Content; dr["AuditTime"] = s.AuditTime; dr["SendTime"] = s.SendTime; dr["Result"] = "失败"; dr["FailureCase"] = s.FailureCase; dt.Rows.Add(dr); } } } else { Message.Alert(this, r.Message, "null"); } } this.ViewState["AuditRecords"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); }
private void load() { DateTime starttime = Convert.ToDateTime(txt_S.Text); DateTime endtime = Convert.ToDateTime(txt_E.Text); string condtion = txt_enterprise.Text.Trim().ToString(); DataTable dt = CreateTable(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode == "admin") { RPCResult <List <SMS> > r = ZHSMSProxy.GetZHSMSPlatService().GetSMSByAudit(starttime, endtime); if (r.Success) { lbl_message.Visible = false; Label1.Text = "当前需要审核的短信有" + r.Value.Count + "批次"; foreach (SMS s in r.Value) { DataRow dr = dt.NewRow(); dr["AccountID"] = s.Account; DataTable dd = BLL.AccountEnterprise.GetAccountEnterpriseByAccoutID(s.Account); if (dd.Rows.Count > 0) { dr["EnterpriseName"] = dd.Rows[0]["Name"].ToString(); } 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["Signature"] = s.Signature; List <string> num = s.Number; string str = ""; foreach (string st in num) { str += st + ","; } dr["Number"] = str == "" ? "" : str.Substring(0, str.Length - 1); dt.Rows.Add(dr); } } else { Message.Alert(this, r.Message, "null"); } } else { DataTable ddt = BLL.AccountEnterprise.GetAccountEnterpriseByUserCode(account.UserCode); for (int i = 0; i < ddt.Rows.Count; i++) { RPCResult <List <SMS> > r = new RPCResult <List <SMS> >(false, null, ""); if (ddt.Rows.Count == 1 && ddt.Rows[i]["EnterpriseCode"].ToString() == "-1") { r = ZHSMSProxy.GetZHSMSPlatService().GetSMSByAudit(starttime, endtime); } else { r = ZHSMSProxy.GetZHSMSPlatService().GetSMSAuditByAccount(ddt.Rows[i]["EnterpriseCode"].ToString(), starttime, endtime);// ZHSMSProxy.GetPretreatmentService().GetSMSAuditByAccount(users.AccountID, starttime, endtime); } if (r.Success) { lbl_message.Visible = false; foreach (SMS s in r.Value) { DataRow dr = dt.NewRow(); dr["AccountID"] = s.Account; DataTable dd = BLL.AccountEnterprise.GetAccountEnterpriseByAccoutID(s.Account); if (dd.Rows.Count > 0) { dr["EnterpriseName"] = dd.Rows[0]["Name"].ToString(); } 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["Signature"] = s.Signature; List <string> num = s.Number; string str = ""; foreach (string st in num) { str += st + ","; } dr["Number"] = str == "" ? "" : str.Substring(0, str.Length - 1); dt.Rows.Add(dr); } } else { Message.Alert(this, r.Message, "null"); } } } if (condtion != "") { DataView dv = new DataView(dt); dv.RowFilter = "EnterpriseName like '%" + condtion + "%' or AccountID like '%" + condtion + "%'"; dt = dv.ToTable(); } dt.DefaultView.Sort = "SendTime desc"; GridView1.DataSource = dt; GridView1.DataBind(); }
private void QueryByInputText() { Model.SysAccount account = (Model.SysAccount)Session["Login"]; DataTable dt = CreateTable(); string condtion = txt_name.Text; SMSModel.RPCResult <List <Model.EnterpriseUser> > r = ZHSMSProxy.GetZHSMSPlatService().GetLowerEnterprise(); if (r.Success) { if (account.UserCode == "admin") { foreach (Model.EnterpriseUser a in r.Value) { 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; dt.Rows.Add(dr); } } else { List <string> list = BLL.AccountEnterprise.GetEnterpriseByUserCode(account.UserCode); if (list.Count == 1 && list[0] == "-1") { foreach (Model.EnterpriseUser a in r.Value) { 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; dt.Rows.Add(dr); } } else { foreach (Model.EnterpriseUser a in r.Value) { if (list.Contains(a.AccountCode)) { 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; 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["LowerEnterprise"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); }
//protected void btn_BasicSave_Click(object sender, EventArgs e) //{ // //企业设置 // if (txt_spNumber.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.Audit = (SMSModel.AccountAuditType)(int.Parse(rb_accountAudit.SelectedValue)); // //user.Enabled = rb_accountEnable.SelectedValue == "1" ? true : false; // user.Priority = (SMSModel.AccountPriorityType)(int.Parse(rb_accountLevel.SelectedValue)); // if (!IsNum(txt_spNumber.Text.Trim())) // { // Message.Alert(this, "企业接入号码是非零正整数", "null"); // return; // } // user.SPNumber = txt_spNumber.Text.Trim(); // user.IsOpen = rb_isOpen.SelectedValue == "1" ? true : false; // SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().UpdateAccountSetting(user);// BLL.EnterpriseUser.UpdateAccountSetting(user); // if (ok.Success) // { // Message.Success(this, "操作成功", "null"); // } // else // { // Message.Alert(this, ok.Message, "null"); // } // } // else // { // Message.Alert(this, r.Message, "null"); // } //} protected void btn_SMSSave_Click(object sender, EventArgs e) { //短信设置 //if (txt_smsSigure.Text.Trim() == "") //{ // Message.Alert(this, "请填写企业签名", "null"); // return; //} if (txt_spNumber.Text.Trim() == "") { Message.Alert(this, "请填写企业接入号码", "null"); return; } if (!System.Text.RegularExpressions.Regex.IsMatch(txt_spNumber.Text.Trim(), @"^[0-9]+$")) { 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; if (user != null) { SMSModel.SMS sms = new SMSModel.SMS(); sms.Account = user.AccountCode; sms.Channel = rb_SMSChannel.SelectedValue == "-1-" ? "" : rb_SMSChannel.SelectedValue; sms.Filter = (SMSModel.FilterType)(int.Parse(rb_SMSFilter.SelectedValue)); sms.Level = (SMSModel.LevelType)(int.Parse(rb_SMSLevel.SelectedValue)); sms.StatusReport = (SMSModel.StatusReportType)(int.Parse(rb_SMSReportType.SelectedValue)); sms.Signature = txt_smsSigure.Text.Trim(); SMSModel.RPCResult rs = ZHSMSProxy.GetZHSMSPlatService().UpdateEnterpriseSMS(sms); } } SMSModel.RPCResult <Model.EnterpriseUser> rr = ZHSMSProxy.GetZHSMSPlatService().GetEnterprise(code); if (rr.Success) { Model.EnterpriseUser user = rr.Value; user.Audit = (SMSModel.AccountAuditType)(int.Parse(rb_accountAudit.SelectedValue)); //user.Enabled = rb_accountEnable.SelectedValue == "1" ? true : false; user.Priority = (SMSModel.AccountPriorityType)(int.Parse(rb_accountLevel.SelectedValue)); //if (!IsNum(txt_spNumber.Text.Trim())) //{ // Message.Alert(this, "企业接入号码是非零正整数", "null"); // return; //} user.SPNumber = txt_spNumber.Text.Trim(); user.IsOpen = rb_isOpen.SelectedValue == "1" ? true : false; SMSModel.RPCResult ok = ZHSMSProxy.GetZHSMSPlatService().UpdateAccountSetting(user);// BLL.EnterpriseUser.UpdateAccountSetting(user); if (ok.Success) { Message.Success(this, "操作成功", "null"); } else { Message.Alert(this, ok.Message, "null"); } } else { Message.Alert(this, r.Message, "null"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { try { if (dd_groups.SelectedIndex == 0) { Message.Alert(this, "请选择一个敏感词组", "null"); return; } string path = this.FileUpload1.PostedFile.FileName; if (path == "" || path == null) { Message.Alert(this, "请选择一个文件,文件格式为txt", "null"); return; } if (System.IO.Path.GetExtension(FileUpload1.FileName).ToLower() != ".txt") { Message.Alert(this, "文件格式为txt", "null"); return; } path = Server.MapPath("~/Temp/") + FileUpload1.FileName; FileUpload1.PostedFile.SaveAs(path); DataTable dt = CreateTable(); using (StreamReader sr = new StreamReader(path)) { string str; while ((str = sr.ReadLine()) != null) { if (str != "") { DataRow dr = dt.NewRow(); string[] arr = str.Split(','); if (arr.Length >= 2) { if (arr[0] != "") { dr["keyword"] = arr[0]; dr["other"] = arr[1]; dt.Rows.Add(dr); } } else if (arr.Length == 1) { if (arr[0] != "") { dr["keyword"] = arr[0]; dr["other"] = ""; dt.Rows.Add(dr); } } } } } File.Delete(path); if (dt.Rows.Count == 0) { Message.Alert(this, "文件是空的", "null"); return; } List <SMSModel.Keywords> list = new List <SMSModel.Keywords>(); foreach (DataRow row in dt.Rows) { SMSModel.Keywords keyword = new SMSModel.Keywords(); keyword.Enable = rb_status.SelectedValue == "1" ? true : false; keyword.KeyGroup = dd_groups.SelectedValue; keyword.KeywordsType = rb_types.SelectedValue == "-1" ? "" : rb_types.SelectedValue; keyword.ReplaceKeywords = row["other"].ToString(); keyword.Words = row["keyword"].ToString(); if (!string.IsNullOrEmpty(keyword.Words)) { list.Add(keyword); } } if (list.Count == 0) { Message.Alert(this, "请添加敏感词", "null"); return; } SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddKeywords(dd_groups.SelectedValue, list); if (r.Success) { load(); Message.Success(this, "添加成功", "null"); } else { Message.Alert(this, r.Message, "null"); } } catch { Message.Alert(this, "操作失败", "null"); } }
private void search(int pageIndex) { DateTime starttime = Convert.ToDateTime(txt_Start.Text); DateTime endtime = Convert.ToDateTime(txt_End.Text); if (DateTime.Compare(starttime, endtime) >= 0) { Message.Alert(this, "开始时间应小于结束时间", "null"); return; } string account = Request.QueryString["AccountID"]; DataTable dt = CreateTable(); RPCResult <List <ReportStatistics> > r = ZHSMSProxy.GetZHSMSPlatService().GetStatisticsReportAllByAccount(account, starttime, endtime); if (r.Success) { string txtNum = txt_num.Text.Trim(); List <ReportStatistics> list = r.Value.OrderByDescending(s => s.BeginSendTime).ToList(); if (!string.IsNullOrWhiteSpace(txtNum)) { list = r.Value.Where(s => containNum(s, txtNum)).OrderByDescending(s => s.BeginSendTime).ToList(); } 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["Account"] = account; dr["BeginSendTime"] = s.BeginSendTime; dr["FailureCount"] = s.FailureCount; dr["LastResponseTime"] = s.LastResponseTime; if (s.Telephones != null) { dr["Numbers"] = s.Telephones.Count; List <string> num = s.Telephones; string str = ""; foreach (string st in num) { str += st + ","; } dr["PhoneCount"] = str == "" ? "" : str.Substring(0, str.Length - 1); } dr["SendCount"] = s.SendCount; dr["SendTime"] = s.SendTime; dr["SerialNumber"] = s.SerialNumber; dr["SplitNumber"] = s.SplitNumber; dr["Succeed"] = s.Succeed; dr["SMSContent"] = s.SMSContent; dt.Rows.Add(dr); } } else { Message.Alert(this, r.Message, "null"); } // dt.DefaultView.Sort = "SendTime desc"; this.ViewState["StatisticsReport"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); }
void loadtata() { DataTable dt = CreateTable(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; string condtion = txt_search.Value; SMSModel.RPCResult <List <Model.EnterpriseUser> > r = ZHSMSProxy.GetZHSMSPlatService().GetAgentEnterprises(); if (r.Success) { List <Model.EnterpriseUser> enterprises = r.Value; if (account.UserCode == "admin") { 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["isagent"] = a.IsAgent == true ? 1 : 0; dt.Rows.Add(dr); } } else { List <string> list = BLL.AccountEnterprise.GetEnterpriseByUserCode(account.UserCode); if (list.Count == 1 && list[0] == "-1") { 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["isagent"] = a.IsAgent == true ? 1 : 0; dt.Rows.Add(dr); } } else { foreach (Model.EnterpriseUser a in enterprises) { if (list.Contains(a.AccountCode)) { 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["isagent"] = a.IsAgent == true ? 1 : 0; dt.Rows.Add(dr); } } } } SMSModel.RPCResult <List <Model.EnterpriseUser> > rr = ZHSMSProxy.GetZHSMSPlatService().GetLowerEnterprise(); if (rr.Success) { if (account.UserCode == "admin") { foreach (Model.EnterpriseUser a in rr.Value) { 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["isagent"] = a.IsAgent == true ? 1 : 0; dt.Rows.Add(dr); } } else { List <string> list = BLL.AccountEnterprise.GetEnterpriseByUserCode(account.UserCode); if (list.Count == 1 && list[0] == "-1") { foreach (Model.EnterpriseUser a in rr.Value) { 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["isagent"] = a.IsAgent == true ? 1 : 0; dt.Rows.Add(dr); } } else { foreach (Model.EnterpriseUser a in rr.Value) { if (list.Contains(a.AccountCode)) { 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["isagent"] = a.IsAgent == true ? 1 : 0; dt.Rows.Add(dr); } } } } } if (condtion != "") { DataView dv = new DataView(dt); dv.RowFilter = "code like '%" + condtion + "%' or name like '%" + condtion + "%'"; dt = dv.ToTable(); } Session["dt"] = dt; treeband(); } }
private void load() { Model.SysAccount account = (Model.SysAccount)Session["Login"]; DataTable dt = CreateTable(); SMSModel.RPCResult <List <Model.EnterpriseUser> > r = ZHSMSProxy.GetZHSMSPlatService().GetLowerEnterprises(Request.QueryString["accountID"]); if (r.Success) { if (account.UserCode == "admin") { foreach (Model.EnterpriseUser a in r.Value) { 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; dt.Rows.Add(dr); } } else { List <string> list = BLL.AccountEnterprise.GetEnterpriseByUserCode(account.UserCode); if (list.Count == 1 && list[0] == "-1") { foreach (Model.EnterpriseUser a in r.Value) { 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; dt.Rows.Add(dr); } } else { foreach (Model.EnterpriseUser a in r.Value) { if (list.Contains(a.AccountCode)) { 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; dt.Rows.Add(dr); } } } } } this.ViewState["AgentLowerEnterprises"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txt_account.Text.Trim() == "-1") { Message.Alert(this, "此企业帐号已存在", "null"); return; } if (dd_city.SelectedIndex == 0 || dd_province.SelectedIndex == 0) { Message.Alert(this, "请选择企业所在的地区", "null"); return; } if (txt_spNumber.Text.Trim() == "") { Message.Alert(this, "请填写企业接入号码", "null"); return; } Model.EnterpriseUser user = new Model.EnterpriseUser(); user.AccountCode = txt_account.Text.Trim(); user.Audit = (SMSModel.AccountAuditType)(int.Parse(rb_accountAudit.SelectedValue)); user.Enabled = rb_accountEnable.SelectedValue == "1" ? true : false; if (!IsPassword(txt_pass.Text.Trim())) { Message.Alert(this, "密码必须是以字母开头,长度在6~18之间,只能包含字母、数字和下划线", "null"); return; } user.Password = txt_pass.Text.Trim(); user.Priority = (SMSModel.AccountPriorityType)(int.Parse(rb_accountLevel.SelectedValue)); user.RegisterDate = DateTime.Now; if (!System.Text.RegularExpressions.Regex.IsMatch(txt_spNumber.Text.Trim(), @"^[0-9]+$")) { Message.Alert(this, "企业接入号码是应为数字", "null"); return; } user.SPNumber = txt_spNumber.Text.Trim(); user.Name = txt_name.Text.Trim(); if (!IsNumeric(txt_phone.Text.Trim())) { Message.Alert(this, "手机号码输入不正确", "null"); return; } 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; user.IsAgent = rb_IsAgent.SelectedValue == "1" ? true : false; user.ParentAccountCode = "-1"; user.IsOpen = rb_isOpen.SelectedValue == "1" ? true : false; //if (txt_smsSigure.Text.Trim() == "") //{ // Message.Alert(this, "短信签名不能为空", "null"); // return; //} //else { user.Signature = txt_smsSigure.Text.Trim(); } user.Channel = rb_SMSChannel.SelectedValue == "-1-" ? "" : rb_SMSChannel.SelectedValue; user.Filter = ushort.Parse(rb_SMSFilter.SelectedValue); user.Level = ushort.Parse(rb_SMSLevel.SelectedValue); user.StatusReport = ushort.Parse(rb_SMSReportType.SelectedValue); SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddEnterprise(user); if (r.Success) { if (user.IsAgent) { //添加代理商账号时,自动指定创建人账号为渠道经理 Model.EnterpriseManage em = new Model.EnterpriseManage(); em.EnterpriseCode = user.AccountCode; Model.SysAccount account = (Model.SysAccount)Session["Login"]; em.ChannelManager = account.UserCode; em.CSManager = ""; em.Reserve = ""; BLL.EnterpriseManage.Add(em); } Message.Success(this, "操作成功", "null"); } else { Message.Alert(this, r.Message, "null"); } }
protected void btn_Sendnotice_Click(object sender, EventArgs e) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { bool ok = BLL.Permission.IsUsePermission(account.UserCode, add); if (!ok) { Message.Alert(this, "无权限", "null"); return; } } if (txt_title.Value == "") { Message.Alert(this, "请输入公告标题", "null"); return; } if (txt_content.Value == "") { Message.Alert(this, "请输入公告内容", "null"); return; } Model.Annunciate an = new Model.Annunciate(); an.AnnunciateContent = txt_content.Value; an.AnnunciateTitle = txt_title.Value; an.AnnunciateAccount = account.UserCode; an.CreateTime = DateTime.Now; an.PlatType = 0; an.Type = Model.AnnunciateType.Person; List <string> num = new List <string>(); for (int i = 0; i < TreeView1.CheckedNodes.Count; i++) { if (TreeView1.CheckedNodes[i].Checked) { string GetValue = TreeView1.CheckedNodes[i].Value; num.Add(GetValue); } } an.Users = num; if (num.Contains("-1")) { an.Type = Model.AnnunciateType.All; num.Remove("-1"); if (num.Contains("1")) { num.Remove("1"); } if (num.Contains("0")) { num.Remove("0"); } } else { if (num.Contains("0") && num.Contains("1")) { an.Type = Model.AnnunciateType.All; num.Remove("0"); num.Remove("1"); } else { if (num.Contains("1")) { an.Type = Model.AnnunciateType.Person; num.Remove("1"); } if (num.Contains("0")) { an.Type = Model.AnnunciateType.Person; num.Remove("0"); } } } SMSModel.RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddAunnuciateByManage(an); if (r.Success) { Message.Success(this, "发送公告成功", "null"); } else { Message.Alert(this, r.Message, "null"); return; } }