Changeset 7637 for branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/AccessAdministrationClient.cs
- Timestamp:
- 03/19/12 21:15:33 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClientUserManagement/HeuristicLab.Clients.Access.Administration/3.3/AccessAdministrationClient.cs
r7635 r7637 67 67 ExecuteActionAsync(RefreshUserGroups, exceptionCallback); 68 68 } 69 #endregion 70 71 #region Store 72 public void StoreUsers() { 73 foreach (User u in users) { 74 if (u.Modified) { 75 if (u.Id == Guid.Empty) { 76 CallAccessService(s => u.Id = s.AddUser(u).Id); 77 } else { 78 CallAccessService(s => s.UpdateUser(u)); 79 } 80 u.SetUnmodified(); 81 } 82 } 83 } 84 85 public void StoreUsersAsync(Action<Exception> exceptionCallback) { 86 ExecuteActionAsync(StoreUsers, exceptionCallback); 87 } 88 89 public void StoreUserGroups() { 90 foreach (UserGroup g in Groups) { 91 if (g.Modified) { 92 if (g.Id == Guid.Empty) { 93 CallAccessService(s => g.Id = s.AddUserGroup(g)); 94 } else { 95 CallAccessService(s => s.UpdateUserGroup(g)); 96 } 97 g.SetUnmodified(); 98 } 99 } 100 } 101 102 public void StoreUserGroupsAsync(Action<Exception> exceptionCallback) { 103 ExecuteActionAsync(StoreUserGroups, exceptionCallback); 104 } 105 106 //i don't think such a generic method is a good idea 107 /*public static void Store(IAccessItem item) { 108 109 } */ 110 #endregion 111 112 #region Delete 113 public void DeleteUser(User u) { 114 CallAccessService(s => s.DeleteUser(u)); 115 } 116 117 public void DeleteUserAsync(User u, Action<Exception> exceptionCallback) { 118 Action deleteUserAction = new Action(delegate { DeleteUser(u); }); 119 ExecuteActionAsync(deleteUserAction, exceptionCallback); 120 } 121 122 public void DeleteUserGroup(UserGroup u) { 123 CallAccessService(s => s.DeleteUserGroup(u)); 124 } 125 126 public void DeleteUserGroupAsync(UserGroup u, Action<Exception> exceptionCallback) { 127 Action deleteUserGroupAction = new Action(delegate { DeleteUserGroup(u); }); 128 ExecuteActionAsync(deleteUserGroupAction, exceptionCallback); 129 } 130 #endregion 69 131 70 132 public void ExecuteActionAsync(Action action, Action<Exception> exceptionCallback) { … … 86 148 if (ex != null) exceptionCallback(ex); 87 149 }, null); 88 }89 #endregion90 91 public static void Store(IAccessItem item) {92 //TODO: storing93 150 } 94 151
Note: See TracChangeset
for help on using the changeset viewer.