public void AddUserMethod() { ViewModels.AddUserViewModel addUserViewModel = new AddUserViewModel(new Models.User()); Views.AddUserView addUserView = new Views.AddUserView(addUserViewModel); addUserView.Owner = CurrentUserManagmentView; MakeLogEntry(8, null, null, "open AddUser. Start adding user"); if ((bool)addUserView.ShowDialog()) { Models.User user_to_base = Models.User.GetCopyOfUser(addUserViewModel.CurrentUser); CurrnetUsers.Add(user_to_base); AddEntry <Models.User>(user_to_base); } else { MakeLogEntry(8, null, null, "open AddUser. Cancel adding user"); } }
public void EditUserMethod(Models.User SelectedItem) { if (SelectedItem == null) { return; } Models.User user_to_view = Models.User.GetCopyOfUser(SelectedItem); ViewModels.AddUserViewModel addUserViewModel = new AddUserViewModel(user_to_view); Views.AddUserView addUserView = new Views.AddUserView( addUserViewModel ); addUserView.Owner = CurrentUserManagmentView; MakeLogEntry(8, null, null, "open AddUser. Start editing user"); if ((bool)addUserView.ShowDialog()) { Models.User user_to_base = Models.User.GetCopyOfUser(addUserViewModel.CurrentUser); EditEntry <Models.User>(user_to_base); } else { MakeLogEntry(8, null, null, "open AddUser. Cancel editing user"); } }