public static bool AreEqual(ModulePermissionSet permissionSet, DataTable dataTable) { return ((permissionSet.ModulePermissions.Count == dataTable.Rows.Count) && (permissionSet.ModuleName == dataTable.TableName) && (permissionSet.ModulePermissions[0].Permissions.Keys.Count + 2 == dataTable.Columns.Count) ); }
public static ModulePermissionSet[] GetNewModulePermissionSet() { Dictionary<string, bool> permissions = new Dictionary<string, bool>(); permissions["role01"] = true; ModulePermissionSet group = new ModulePermissionSet("moduleName", new List<ModulePermission>(new ModulePermission[] { new ModulePermission("moduleName", "rule", permissions), new ModulePermission("moduleName", "rule", permissions) })); return new ModulePermissionSet[] { group }; }
public static bool AreEqual(ModulePermissionSet[] permissionSets, DataTable[] dataTables) { if (permissionSets.Length != dataTables.Length) { return false; } for (int i = 0; i < permissionSets.Length - 1; i++) { if (!AreEqual(permissionSets[i], dataTables[1])) { return false; } } return true; }