private void UpdateButton_Click(object sender, RoutedEventArgs e) { if ((this.UpdatePrivateNameTextBox.Text != "" || this.UpdatefamilyNameTextBox.Text != "") && this.UpdateKey.Text != "") { MessageBox.Show("please enter only one field, byname or by key."); Window UpdateDeleteByWindow = new UpdateDeleteBy(); UpdateDeleteByWindow.Show(); this.Close(); } else if (this.UpdatefamilyNameTextBox.Text != "" && this.UpdatePrivateNameTextBox.Text != "") { try { //sends to a window with a scroll box and then the user updates the gs he wants to update Window UpdateByNameChooseWindow = new UpdateByNameChoose(this.UpdatePrivateNameTextBox.Text, this.UpdatefamilyNameTextBox.Text); UpdateByNameChooseWindow.Show(); this.Close(); } catch (Exception) { MessageBox.Show("Guest Requests for this user don't exist"); } } else if (this.UpdateKey.Text != "") { try { Window updateRequestWindow = new UpdateGuestRequest(long.Parse(this.UpdateKey.Text)); updateRequestWindow.Show(); this.Close(); } catch (Exception) { MessageBox.Show("Guest Request does not exist"); } } else { MessageBox.Show("Guest Request does not exist, " + "or you entered info into wrong fields"); } }
private void updateGuests_Click(object sender, RoutedEventArgs e) { Window UpdateGuestRequest = new UpdateGuestRequest(); UpdateGuestRequest.Show(); }