Exemplo n.º 1
0
 private void DeleteButton_Click(object sender, RoutedEventArgs e)
 {
     var item = UserList.SelectedItem as UserListItem;
     if (item.Id == MainWindow.CurrentUserId)
         throw new ApplicationException("You can't delete yourself");
     var model = new UserEditModel() { Id = item.Id };
     model.Delete();
     LoadUserList(-1);
 }
Exemplo n.º 2
0
 public UserDetailsPage(int userId, bool forEdit)
 {
     InitializeComponent();
     this.userId = userId;
     var model = new UserEditModel() { Id = forEdit ? userId : -1 };
     model.Load();
     UserEditForm.DataContext = model;
     PasswordInput.Visibility = forEdit ? Visibility.Collapsed : Visibility.Visible;
     PasswordLabel.Visibility = forEdit ? Visibility.Collapsed : Visibility.Visible;
     ConfirmInput.Visibility = forEdit ? Visibility.Collapsed : Visibility.Visible;
     ConfirmLabel.Visibility = forEdit ? Visibility.Collapsed : Visibility.Visible;
     UserNameInput.Focus();
     CommonHelper.InitValidation(UserNameInput, PasswordInput, ConfirmInput, FirstNameInput, LastNameInput);
 }