public FavStopDialog(MeansOfTransport meanOfTrans)
 {
     meameanOfTransport = meanOfTrans;
     InitializeComponent();
     Task.Run(async() => { TestItems = await NewFavoriteStop.GetStaionNames(meameanOfTransport); }).Wait();
     StopName.ItemsSource = TestItems;
 }
 private void OkButton_OnClick(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(StopName.Text) && !string.IsNullOrEmpty(LineName.Text))
     {
         var x = NewFavoriteStop.GetTimeForNextBus(StopName.Text, LineName.Text, Direction.Text);
         //BSV = new BusStopView(StopName.Text, LineName.Text, );
     }
 }
        private async void LineName_OnDropDownClosed(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(StopName.Text) && !string.IsNullOrEmpty(LineName.Text))
            {
                var lineItems = await NewFavoriteStop.GetDirections(StopName.Text, LineName.Text);

                Direction.ItemsSource = lineItems.Values;
            }
        }
        private async void StopName_DropDownClosed(object sender, RoutedPropertyChangedEventArgs <bool> e)
        {
            if (!string.IsNullOrEmpty(StopName.Text))
            {
                var lineItems = await NewFavoriteStop.GetLinesFromStation(StopName.Text, "");

                LineName.ItemsSource = lineItems;
            }
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            var b = MainWindow.loggedInBenutzer;

            if (b != null)
            {
                List <BenutzerHaltestellen> favourites     = userManagement.GetFavouriteStopsFromUser(b);
                List <UserControl>          favouriteStops = new List <UserControl>();
                foreach (var item in favourites)
                {
                    var         station = NewFavoriteStop.GetStationFromId(item.Haltestellen_ID);
                    UserControl test    = new BusStopView(station.Name, item.Linie, item.Richtung);
                    favouriteStops.Add(test);
                }
                Console.WriteLine(favouriteStops.Count);
            }
        }
 private void OkButton_OnClick(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrEmpty(StopName.Text) && !string.IsNullOrEmpty(LineName.Text))
     {
         BSV = new BusStopView(StopName.Text, LineName.Text, Direction.Text);
         var id = NewFavoriteStop.GetStationIdFromName(StopName.Text);
         if (MainWindow.loggedInBenutzer != null)
         {
             BenutzerHaltestellen bh = new BenutzerHaltestellen()
             {
                 Benutzer_ID = MainWindow.loggedInBenutzer.Benutzer_ID, Haltestellen_ID = id, Linie = LineName.Text, Richtung = Direction.Text
             };
             dbEntities.BenutzerHaltestellens.Add(bh);
             dbEntities.SaveChanges();
         }
     }
 }
Exemple #7
0
 private string getTime(string stop, string line, string direction)
 {
     return(NewFavoriteStop.GetTimeForNextBus(stop, line, direction));
 }
Exemple #8
0
 public AutocomFile()
 {
     Task.Run(async() => { TestItems = await NewFavoriteStop.GetStaionNames("ptBusCity"); }).Wait();
 }