protected void Page_Load(object sender, EventArgs e) { adminEntity = GetAdminInfo(); //取得管理员信息 agent = aBll.GetAgentModel(adminEntity.id); if (!Page.IsPostBack) { int id = 0; if (!int.TryParse(Request.QueryString["id"] as string, out id)) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } if (!new BLL.wx_userweixin().Exists(id)) { JscriptMsg("记录不存在或已被删除!", "back", "Error"); return; } returnPage = "wxcodemgr.aspx"; //如果是从微用户管理里来的,还得判断下 if (MyCommFun.QueryString("fpage").Trim().Length > 0 && MyCommFun.RequestInt("uid") > 0) { returnPage = "weixin_list.aspx?id=" + MyCommFun.RequestInt("uid"); } ShowInfo(id); } }
protected void Page_Load(object sender, EventArgs e) { adminEntity = GetAdminInfo(); //取得管理员信息 agent = aBll.GetAgentModel(adminEntity.id); if (agent != null) { txtuser_name.Text = adminEntity.user_name; txtreal_name.Text = adminEntity.real_name; txtremainMony.Text = agent.remainMony.ToString(); txtremainMony.Font.Size = FontUnit.Large; if (agent.remainMony < agent.agentPrice) { txtremainMony.ForeColor = System.Drawing.Color.Red; } txtczTotMoney.Text = agent.czTotMoney.Value.ToString(); txtsqJine.Text = agent.sqJine.Value.ToString(); lblxfTotMoney.Text = (agent.czTotMoney.Value - agent.remainMony.Value).ToString(); txtuserNum.Text = agent.userNum.Value.ToString(); txtwcodeNum.Text = agent.wcodeNum.Value.ToString(); lblagentPrice.Text = agent.agentPrice.Value.ToString(); } }
private void ShowInfo(int _id) { BLL.manager bll = new BLL.manager(); Model.manager model = bll.GetModel(_id); //ddlRoleId.SelectedValue = model.role_id.ToString(); lblUserName.Text = model.user_name; lblRealName.Text = model.real_name; //代理商信息 Model.wx_agent_info agentinfo = aBll.GetAgentModel(_id); lblYue.Text = agentinfo.remainMony.Value.ToString(); lbltxtsqJine.Text = agentinfo.sqJine.Value.ToString(); lblagentPrice.Text = agentinfo.agentPrice.Value.ToString(); lblagentLevel.Text = agentinfo.agentLevel; }
protected void Page_Load(object sender, EventArgs e) { string _action = MXRequest.GetQueryString("action"); if (!string.IsNullOrEmpty(_action) && _action == MXEnums.ActionEnum.Edit.ToString()) { this.action = MXEnums.ActionEnum.Edit.ToString();//修改类型 if (!int.TryParse(Request.QueryString["id"] as string, out this.id)) { JscriptMsg("传输参数不正确!", "back", "Error"); return; } if (!new BLL.manager().Exists(this.id)) { JscriptMsg("记录不存在或已被删除!", "back", "Error"); return; } } if (!Page.IsPostBack) { BindDdlProvince(ddlProvince); BindDdlCity(ddlCity); ChkAdminLevel("manager_list", MXEnums.ActionEnum.View.ToString()); //检查权限 Model.manager model = GetAdminInfo(); //取得管理员信息 Model.wx_agent_info agent = aBll.GetAgentModel(model.id); //代理商信息 if (agent != null) { lblremainMony.Text = agent.remainMony.Value.ToString(); lblagentPrice.Text = agent.agentPrice.Value.ToString(); lblMoney.Text = agent.agentPrice.Value.ToString(); isAgent = true; } RoleBind(ddlRoleId, model.id); if (action == MXEnums.ActionEnum.Edit.ToString()) //修改 { ShowInfo(this.id); } } }
private void ShowInfo(int _id) { litpwdtip.Text = "不填则不修改密码"; BLL.manager bll = new BLL.manager(); Model.manager model = bll.GetModel(_id); //ddlRoleId.SelectedValue = model.role_id.ToString(); if (model.is_lock == 0) { cbIsLock.Checked = true; } else { cbIsLock.Checked = false; } txtUserName.Text = model.user_name; txtUserName.ReadOnly = true; txtUserName.Attributes.Remove("ajaxurl"); txtRealName.Text = model.real_name; txtTelephone.Text = model.telephone; txtEmail.Text = model.email; ddlProvince.SelectedValue = model.province; ddlCity.SelectedValue = model.city; txtArea.Text = model.county; txtqq.Text = model.qq; txtEmail.Text = model.email; txtSortid.Text = MyCommFun.ObjToStr(model.sort_id); // model.sort_id; txtRemark.Text = model.remark; //代理商信息 Model.wx_agent_info agentinfo = aBll.GetAgentModel(_id); txtagentPrice.Text = agentinfo.agentPrice.Value.ToString(); txtsqJine.Text = agentinfo.sqJine.Value.ToString(); txtcompanyName.Text = agentinfo.companyInfo; ddlagentType.SelectedValue = agentinfo.agentType.Value.ToString(); ddlagentLevel.SelectedValue = agentinfo.agentLevel; txtagentArea.Text = agentinfo.agentArea; txtindustry.Text = agentinfo.industry; }
protected void Page_Load(object sender, EventArgs e) { adminEntity = GetAdminInfo(); //取得管理员信息 agent = aBll.GetAgentModel(adminEntity.id); if (agent == null) { return; } this.keywords = MXRequest.GetQueryString("keywords"); this.pageSize = GetPageSize(10); //每页数量 if (!Page.IsPostBack) { ChkAdminLevel("agent_myxfjl", MXEnums.ActionEnum.View.ToString()); //检查权限 Model.manager model = GetAdminInfo(); //取得当前管理员信息 RptBind(CombSqlTxt(keywords), "operDate asc,id desc"); } }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("manager_list", MXEnums.ActionEnum.Delete.ToString()); //检查权限 bool isAgent = false; BLL.wx_agent_info aBll = new BLL.wx_agent_info(); Model.manager adminEntity = GetAdminInfo(); //取得管理员信息 Model.wx_agent_info agent = new Model.wx_agent_info(); if (adminEntity.agentLevel > 0) { isAgent = true; agent = aBll.GetAgentModel(adminEntity.id); } BLL.wx_userweixin wBll = new BLL.wx_userweixin(); int sucCount = 0; int errorCount = 0; BLL.manager bll = new BLL.manager(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { int hasNum = wBll.GetUserWxNumCount(id); if (hasNum > 0) { JscriptMsg("该用户已经添加微信号,无法删除!", "back", "Error"); return; } } } for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { int hasNum = wBll.GetUserWxNumCount(id); if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } if (isAgent && agent != null) { //如果为代理商,则将起用户数量减掉 agent.userNum -= sucCount; aBll.Update(agent); } AddAdminLog(MXEnums.ActionEnum.Delete.ToString(), "删除用户" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("manager_list.aspx", "keywords={0}", this.keywords), "Success"); }