protected void ZButton2_Click(object sender, EventArgs e) { for (int i = 0; i < rprole.Items.Count; i++) { SysRole sr = new SysRole(); sr.RoleID = int.Parse((rprole.Items[i].FindControl("zlsc") as ZLinkButton).CommandArgument); sr.RoleName = PubCom.CheckString((rprole.Items[i].FindControl("tRoleName") as TextBox).Text.Trim()); sr.IsUse = (rprole.Items[i].FindControl("cIsUse") as CheckBox).Checked; var oldrole = JsonHelper.Obj2Json(br.GetRoleByID(sr.RoleID)); br.Update(sr); if (oldrole == JsonHelper.Obj2Json(sr)) { // 插入日志 SysOperateLog log = new SysOperateLog(); log.LogID = StringHelper.getKey(); log.LogType = LogType.角色信息.ToString(); log.OperateUser = GetLogUserName(); log.OperateDate = DateTime.Now; log.LogOperateType = "角色修改"; log.LogBeforeObject = oldrole; log.LogAfterObject = JsonHelper.Obj2Json(sr); bsol.Insert(log); } } BindRoleList(); Message.ShowOK(this, "修改完成"); }
IList <SysOperate> lso_role; //角色拥有的操作 void BindRoleOperate() { SysRole sr = new SysRole(); sr = br.GetRoleByID(roleid); if (sr == null) { Message.ShowAndBack("无此数据"); return; } else { litRoleName.Text = sr.RoleName; litIsUse.Text = sr.IsUse == true ? "是" : "否"; } lso_menu = bo.GetMenuOperate(); lso_role = bro.GetOperateByRoleID(roleid); Query qm = Query.Build(new { SortFields = "ParentMenuID,MenuSort" }); qm.Append("IsLeaf = 1"); var lsm = bm.GetMenuList(qm); rproleoperate.DataSource = lsm; rproleoperate.DataBind(); }