public void btnSave_Click(object sender, System.EventArgs e) { Role bllRole = new Role(); bllRole.RoleID = Convert.ToInt32(lblRoleID.Text); foreach (ListItem item in chkPermissions.Items) { if (item.Selected) { bllRole.AddPermission(Convert.ToInt32(item.Value)); } else { bllRole.RemovePermission(Convert.ToInt32(item.Value)); } } Maticsoft.Common.MessageBox.Show(this, Resources.Site.TooltipSaveOK); }
//移除权限 public void RemovePermissionButton_Click(object sender, System.EventArgs e) { if (this.PermissionList.SelectedIndex > -1) { int currentRole = Convert.ToInt32(lblRoleID.Text); //RoleID = Request["RoleID"]; Role bizRole = new Role(currentRole); bizRole.RemovePermission(Convert.ToInt32(this.PermissionList.SelectedValue)); CategoryDownList_SelectedIndexChanged(sender, e); } }
public void btnSave_Click(object sender, EventArgs e) { Role role = new Role { RoleID = Convert.ToInt32(this.lblRoleID.Text) }; foreach (ListItem item in this.chkPermissions.Items) { if (item.Selected) { role.AddPermission(Convert.ToInt32(item.Value)); } else { role.RemovePermission(Convert.ToInt32(item.Value)); } } LogHelp.AddUserLog(base.CurrentUser.UserName, base.CurrentUser.UserType, "编辑角色权限", this); MessageBox.ShowSuccessTip(this, Site.TooltipSaveOK); }