public bool SaveSetting(IPermissionSet setting) { ManageForumPermissionSetNodeCollection tempNodes = new ManageForumPermissionSetNodeCollection(); bool haveAdd = false; foreach (ManageForumPermissionSetNode node in Nodes) { if (node.NodeID == setting.NodeID) { tempNodes.Add((ManageForumPermissionSetNode)setting); haveAdd = true; } else tempNodes.Add(node); } if (haveAdd == false) { tempNodes.Add((ManageForumPermissionSetNode)setting); } ManageForumPermissionSet permissionSet = new ManageForumPermissionSet(); permissionSet.Nodes = tempNodes; bool success = SettingManager.SaveSettings(permissionSet); return success; }
public bool DeleteSetting(int nodeID) { if (nodeID == 0) return true; ManageForumPermissionSetNodeCollection tempNodes = new ManageForumPermissionSetNodeCollection(); foreach (ManageForumPermissionSetNode node in Nodes) { if (node.NodeID != nodeID) { tempNodes.Add(node); } } ManageForumPermissionSet permissionSet = new ManageForumPermissionSet(); permissionSet.Nodes = tempNodes; bool success = SettingManager.SaveSettings(permissionSet); return success; }
public ManageForumPermissionSet() { Nodes = new ManageForumPermissionSetNodeCollection(); ManageForumPermissionSetNode topNode = new ManageForumPermissionSetNode(); Nodes.Add(topNode); }