private void accept_Click(object sender, EventArgs e) { if (airportA.Text.Length == 0 || airportB.Text.Length == 0 || dateTimePicker.Text.Length == 0 || time.Text.Length == 0) { connections.Text = service.GetEveryConnection(); } else if (airportA.Text.Length > 0 && airportB.Text.Length > 0 && dateTimePicker.Text.Length > 0 && time.Text.Length > 0 && time.Text.Contains(":")) { connections.Text = service.GetConnectionBetween(airportA.Text.ToLower(), airportB.Text.ToLower(), CreateDateFromStringAndTime(dateTimePicker.Value.ToShortDateString(), time.Text)); } else { throw new WrongUserInput(); } }