private async void registerButton_Click(object sender, EventArgs e) { var client = new UserService.UserServiceClient(); var charityId = int.Parse(charityComboBox.SelectedValue.ToString()); try { await client.RegisterForEventAsync(user.email, listEvents.ToArray(), raceKitOptions, charityId, marathonCost); Form registrationConfirmation = new RegistrationConfirmation.RegistrationConfirmationForm(user); Hide(); registrationConfirmation.Show(); } catch { MessageBox.Show("Что-то пошло не так"); } }