private void UpdateBookButton_Click(object sender, RoutedEventArgs e) { if (!CheckIfEmpty(TitleText.Text) && !CheckIfEmpty(AuthorText.Text) && !CheckIfEmpty(GenreText.Text)) { libService.UpdateBook(editedBookId, TitleText.Text, AuthorText.Text, GenreText.Text); windowCallback(); //Display success message if (editResultWindow == null || !editResultWindow.IsLoaded) { editResultWindow = new ModificationResultWindow(ModificationResultType.BookEditCorrect); editResultWindow.Show(); } } else { //Display error message if (editResultWindow == null || !editResultWindow.IsLoaded) { editResultWindow = new ModificationResultWindow(ModificationResultType.BookEditError); editResultWindow.Show(); } } }
private void UpdateUserButton_Click(object sender, RoutedEventArgs e) { if (!CheckIfEmpty(NameText.Text) && !CheckIfEmpty(SurnameText.Text)) { libService.UpdateUser(editedUserId, NameText.Text, SurnameText.Text); windowCallback(); //Display success message if (editResultWindow == null || !editResultWindow.IsLoaded) { editResultWindow = new ModificationResultWindow(ModificationResultType.UserEditCorrect); editResultWindow.Show(); } } else { //Display error message if (editResultWindow == null || !editResultWindow.IsLoaded) { editResultWindow = new ModificationResultWindow(ModificationResultType.UserEditError); editResultWindow.Show(); } } }
private void AddUserButton_Click(object sender, RoutedEventArgs e) { if (!CheckIfEmpty(NameText.Text) && !CheckIfEmpty(SurnameText.Text)) { libService.AddUser(NameText.Text, SurnameText.Text); windowCallback(); //Display success message if (addResultWindow == null || !addResultWindow.IsLoaded) { addResultWindow = new ModificationResultWindow(ModificationResultType.UserAddition); addResultWindow.Show(); } } else { //Display error message if (addResultWindow == null || !addResultWindow.IsLoaded) { addResultWindow = new ModificationResultWindow(ModificationResultType.UserAdditionFail); addResultWindow.Show(); } } }
private void AddBookButton_Click(object sender, RoutedEventArgs e) { if (!CheckIfEmpty(TitleText.Text) && !CheckIfEmpty(AuthorText.Text) && !CheckIfEmpty(GenreText.Text)) { libService.AddBook(TitleText.Text, AuthorText.Text, GenreText.Text); windowCallback(); //Display success message if (addResultWindow == null || !addResultWindow.IsLoaded) { addResultWindow = new ModificationResultWindow(ModificationResultType.BookAddition); addResultWindow.Show(); } } else { //Display error message if (addResultWindow == null || !addResultWindow.IsLoaded) { addResultWindow = new ModificationResultWindow(ModificationResultType.BookAdditionFail); addResultWindow.Show(); } } }