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(); } } } }
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; } } for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { CheckBox CheckBox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox"); if (CheckBox.Checked == true) { string serialNumber = GridView1.DataKeys[i].Value.ToString(); RPCResult r = ZHSMSProxy.GetZHSMSPlatService().SetSMSLevel(Guid.Parse(serialNumber), (SMSModel.LevelType)(int.Parse(dd_l.SelectedItem.Text)), account.UserCode); } } CheckBoxAll.Checked = false; CheckBox1.Checked = false; load(); Message.Success(this, " 短信优先级调整成功", "null"); }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { this.ViewState["Permissions"] = BLL.Permission.GetPermissionByAccount(account.UserCode); } if (!IsPostBack) { dd_l.Items.Clear(); RPCResult <List <SMSModel.Channel> > r = ZHSMSProxy.GetZHSMSPlatService().GetChannels(); if (r.Success) { if (r.Value.Count > 0) { foreach (SMSModel.Channel c in r.Value) { dd_l.Items.Add(new ListItem(c.ChannelName, c.ChannelID)); } } } dd_l.Items.Insert(0, new ListItem("--请选择--", "-1")); load(); } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ((LinkButton)e.Row.Cells[8].Controls[0]).Attributes.Add("onclick", "return confirm('确认删除吗?');"); string roleID = e.Row.Cells[1].Text; if (roleID == "1") { e.Row.Cells[8].Text = ""; } Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { List <string> permissions = (List <string>) this.ViewState["Permissions"]; if (!permissions.Contains(edite)) { e.Row.Cells[5].Text = "无权限"; } if (!permissions.Contains(permissionEdite)) { e.Row.Cells[6].Text = "无权限"; } if (!permissions.Contains(detail)) { e.Row.Cells[7].Text = "无权限"; } if (!permissions.Contains(del)) { e.Row.Cells[8].Text = "无权限"; } } } }
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, bind); if (!ok) { bt1.Visible = false; Message.Alert(this, "无权限", "null"); return; } } List <string> a = new List <string>(); for (int i = 0; i <= GridView1.Rows.Count - 1; i++) { CheckBox CheckBox = (CheckBox)GridView1.Rows[i].FindControl("CheckBox"); if (CheckBox.Checked == true) { string c = GridView1.DataKeys[i].Value.ToString(); a.Add(c); } RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AddChannelGatewayBind(dd_l.SelectedValue, a); } CheckBoxAll.Checked = false; CheckBox1.Checked = false; load(); Message.Success(this, "通道网关绑定成功", "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 phone = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); RPCResult r = ZHSMSProxy.GetZHSMSPlatService().DelBlacklist(new List <string> { phone }); if (r.Success) { Message.Success(this, "黑名单删除成功", "null"); DataTable dt = (DataTable)this.ViewState["BlackDt"]; int index = e.RowIndex; dt.Rows.RemoveAt(index); this.ViewState["BlackDt"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); } else { Message.Alert(this, r.Message, "null"); } }
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; } } } }
protected void btnSubmit_Click(object sender, EventArgs e) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (txt_reason.Text == "") { Message.Alert(this, "请输入审核失败原因", "null"); return; } int j = 0; List <string> senum = new List <string>(); senum = (List <string>)Session["senum"]; foreach (string serialNumber in senum) { j++; RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AuditSMS(Guid.Parse(serialNumber), false, account.UserCode, txt_reason.Text.ToString()); } if (j > 0) { Response.Redirect("SMS_Audit.aspx"); //Message.Alert(this, "审核失败成功", "null"); return; } else { Message.Alert(this, "审核失败失败", "null"); return; } }
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 ID = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); RPCResult rr = ZHSMSProxy.GetZHSMSPlatService().DelAnnunciate(ID); if (rr.Success) { Message.Success(this, rr.Message, "null"); load(); } else { Message.Alert(this, rr.Message, "null"); return; } }
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 accountID = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); bool ok = BLL.SysAccount.Del(accountID); if (ok) { BLL.SysAccount.DelByUserCode(accountID); BLL.AccountEnterprise.DelByUserCode(accountID); Message.Success(this, "操作成功", "null"); load(); } else { Message.Alert(this, "", "null"); } }
protected void btnQuery_Click(object sender, EventArgs e) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { bool ok = BLL.Permission.IsUsePermission(account.UserCode, loads); if (!ok) { Message.Alert(this, "无权限", "null"); return; } } if (rbtnSuccess.Checked) { // 显示审核成功的短信 load(true); } else { // 显示审核失败的短信 if (rbtnFailure.Checked) { load(false); } else { load(null); } } }
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(); } }
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"); } }
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, "添加失败"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (txt_newpass.Text.Trim() == "") { Message.Alert(this, "新密码不能为空", "null"); return; } if (txt_confirm.Text != txt_newpass.Text) { Message.Alert(this, "新密码与确认密码不一致", "null"); return; } Model.SysAccount account = BLL.SysAccount.GetAccount(lbl_code.Text); if (account != null) { if (BLL.SysAccount.GetEncrypt(txt_oldpass.Text.Trim()) != account.PassWord) { Message.Alert(this, "原始密码不对", "null"); return; } BLL.SysAccount.ChanagePass(account.UserCode, txt_newpass.Text.Trim()); Message.Success(this, "修改成功", "null"); return; } else { Message.Alert(this, "系统不存在此用户", "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 serialNumber = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); RPCResult r = ZHSMSProxy.GetZHSMSPlatService().AffirmAuditFailureSMS(new Guid(serialNumber)); if (r.Success) { Message.Success(this, "操作成功", "null"); DataTable dt = (DataTable)this.ViewState["AuditFailure"]; dt.Rows.RemoveAt(e.RowIndex); this.ViewState["AuditFailure"] = dt; GridView1.DataSource = dt; GridView1.DataBind(); } else { Message.Error(this, r.Message, "null"); } }
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, "修改失败"); } }
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 serialNumber = this.GridView1.DataKeys[e.RowIndex].Value.ToString(); RPCResult r = ZHSMSProxy.GetZHSMSPlatService().DelSMS(new List <Guid> { new Guid(serialNumber) }); if (r.Success) { Message.Success(this, "操作成功", "null"); load(); } else { Message.Error(this, r.Message, "null"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BLL.Login.IsLogin(); account = (Model.SysAccount)Session["Login"]; } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { ((LinkButton)e.Row.Cells[18].Controls[0]).Attributes.Add("onclick", "return confirm('确认删除吗?');"); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { List <string> permissions = (List <string>) this.ViewState["Permissions"]; if (!permissions.Contains(edit)) { e.Row.Cells[7].Text = "无权限"; } if (!permissions.Contains(passReset)) { e.Row.Cells[9].Text = "无权限"; } if (!permissions.Contains(secretKey)) { e.Row.Cells[10].Text = "无权限"; } if (!permissions.Contains(reCharge)) { e.Row.Cells[11].Text = "无权限"; } if (!permissions.Contains(reBlance)) { e.Row.Cells[12].Text = "无权限"; } if (!permissions.Contains(chargeRecord)) { e.Row.Cells[13].Text = "无权限"; } if (!permissions.Contains(detail)) { e.Row.Cells[14].Text = "无权限"; } if (!permissions.Contains(op)) { e.Row.Cells[15].Text = "无权限"; } if (!permissions.Contains(enterpriseSMSStatistics)) { e.Row.Cells[16].Text = "无权限"; } if (!permissions.Contains(upgrade)) { e.Row.Cells[17].Text = "无权限"; } if (!permissions.Contains(del)) { e.Row.Cells[18].Text = "无权限"; } } } }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { this.ViewState["Permissions"] = BLL.Permission.GetPermissionByAccount(account.UserCode); } LoadData(); }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); if (!Page.IsPostBack) { account = (Model.SysAccount)Session["Login"]; DateTime a = DateTime.Now; DateTime b = DateTime.Now.AddDays(-3); LoadData(a, b); } }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); if (!IsPostBack) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account != null) { lbl_code.Text = account.UserCode; } } }
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(); } }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { this.ViewState["Permissions"] = BLL.Permission.GetPermissionByAccount(account.UserCode); } if (!IsPostBack) { QueryByInputText(); } }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { this.ViewState["Permissions"] = BLL.Permission.GetPermissionByAccount(account.UserCode); } if (!IsPostBack) { txt_S.Text = DateTime.Now.AddDays(-1).ToString(); txt_E.Text = DateTime.Now.ToString(); } }
protected void btnSearch_Click(object sender, EventArgs e) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { bool ok = BLL.Permission.IsUsePermission(account.UserCode, loads); if (!ok) { Message.Alert(this, "无权限", "null"); return; } } load(); }
protected void Page_Load(object sender, EventArgs e) { TreeView1.Attributes.Add("onclick", "postBackByObject()"); BLL.Login.IsLogin(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { this.ViewState["Permissions"] = BLL.Permission.GetPermissionByAccount(account.UserCode); } if (!IsPostBack) { loadtata(); } }
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { List <string> permissions = (List <string>) this.ViewState["Permissions"]; if (!permissions.Contains(audit)) { e.Row.Cells[7].Text = "无权限"; } } } }
protected void Page_Load(object sender, EventArgs e) { BLL.Login.IsLogin(); Model.SysAccount account = (Model.SysAccount)Session["Login"]; if (account.UserCode != "admin") { string permissionValue = "System.Role.Add"; bool ok = BLL.Permission.IsUsePermission(account.UserCode, permissionValue); if (!ok) { Message.Alert(this, "无权限", "null"); return; } } }