Skip to content

Commit

Permalink
Show error message when start or destination empty
Browse files Browse the repository at this point in the history
Closes #3
  • Loading branch information
mbeer committed May 14, 2019
1 parent 01de1c4 commit da2df70
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions OutlookSwissPTTimetable/PlanJourneyWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,30 @@ private async void GetConnectionsAsync(Dir dir)
from = InConnComboBox.Text.ToString();
to = LocationComboBox.Text.ToString();
isArrivalTime = true;
InConnProgressRing.IsActive = true;
InConnProgressRing.Visibility = Visibility.Visible;
InConnQryButton.IsEnabled = false;
}
else
{
time = Appointment.End.AddMinutes((double)LocationDistanceUpDown.Value);
to = OutConnComboBox.Text.ToString();
from = LocationComboBox.Text.ToString();
isArrivalTime = false;
OutConnProgressRing.IsActive = true;
OutConnProgressRing.Visibility = Visibility.Visible;
OutConnQryButton.IsEnabled = false;
}

if (from.Length > 2 && to.Length > 2)
{
if (dir == Dir.In)
{
InConnProgressRing.IsActive = true;
InConnProgressRing.Visibility = Visibility.Visible;
InConnQryButton.IsEnabled = false;
}
else
{
OutConnProgressRing.IsActive = true;
OutConnProgressRing.Visibility = Visibility.Visible;
OutConnQryButton.IsEnabled = false;
}

try
{
creq = new TransportOpendataCH.ConnectionsRequest(from, to, dateTime: time, isArrivalTime: isArrivalTime, limit: Properties.Settings.Default.ConnectionsLimit);
Expand Down Expand Up @@ -213,6 +220,9 @@ private async void GetConnectionsAsync(Dir dir)
}


} else
{
MessageBox.Show("Start- und/oder Zielort der Verbindung ist nicht angegeben.");
}

}
Expand Down

0 comments on commit da2df70

Please sign in to comment.