/// <summary> /// 保存信息 /// </summary> protected void Save() { SOSOshop.BLL.Role bll = new SOSOshop.BLL.Role(); SOSOshop.Model.Role model = new SOSOshop.Model.Role(); model.Name = this.txtRoleName.Text.Trim(); model.Description = this.txtDescription.Text.Trim(); if (ViewState["ID"] != null) { model.ID = int.Parse(ViewState["ID"].ToString()); bll.Amend(model); this.ltlMsg.Text = "操作成功,已保存该信息"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; #region 后台用户操作日志记录 SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get(); SOSOshop.BLL.Logs.Log.LogAdminAdd("修改角色", (adminInfo == null ? 0 : adminInfo.AdminId), (adminInfo == null ? "" : adminInfo.AdminName), 1); #endregion } else { bll.Create(model); this.ltlMsg.Text = "操作成功,已保存该信息"; this.pnlMsg.Visible = true; this.pnlMsg.CssClass = "actionOk"; #region 后台用户操作日志记录 SOSOshop.Model.AdminInfo adminInfo = SOSOshop.BLL.AdministrorManager.Get(); SOSOshop.BLL.Logs.Log.LogAdminAdd("添加角色", (adminInfo == null ? 0 : adminInfo.AdminId), (adminInfo == null ? "" : adminInfo.AdminName), 1); #endregion } }
protected void BandInfo(int id) { SOSOshop.BLL.Role bll = new SOSOshop.BLL.Role(); SOSOshop.Model.Role model = bll.GetModelID(id); this.txtRoleName.Text = model.Name; this.txtDescription.Text = model.Description; ViewState["ID"] = model.ID; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SOSOshop.BLL.PromptInfo.Popedom("007002006", "对不起,您没有权限进行设置"); int roleid = ChangeHope.WebPage.PageRequest.GetQueryInt("id"); if (roleid > 0) { ViewState["RoleId"] = roleid; SOSOshop.BLL.Role bll = new SOSOshop.BLL.Role(); SOSOshop.Model.Role model = bll.GetModelID(roleid); if (model != null) { this.lbRoleName.Text = model.Name; this.lbRoleDescription.Text = model.Description; this.BindInfo(roleid.ToString()); } } } }