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