void OnAdd() { var userDetailsViewModel = new UserDetailsViewModel(); if (DialogService.ShowModalWindow(userDetailsViewModel)) { FiresecManager.SecurityConfiguration.Users.Add(userDetailsViewModel.User); var userViewModel = new UserViewModel(userDetailsViewModel.User); Users.Add(userViewModel); SelectedUser = userViewModel; ServiceFactory.SaveService.SecurityChanged = true; } }
void OnEdit() { var userDetailsViewModel = new UserDetailsViewModel(SelectedUser.User); if (DialogService.ShowModalWindow(userDetailsViewModel)) { ClientManager.SecurityConfiguration.Users.Remove(SelectedUser.User); SelectedUser.User = userDetailsViewModel.User; ClientManager.SecurityConfiguration.Users.Add(SelectedUser.User); ServiceFactory.SaveService.SecurityChanged = true; } }