private void loadTravelContent(object sender, MouseButtonEventArgs e)
        {
            this.TabIndex = 2;
            List <Reise>    Travels         = M120Entities.Reises.ToList();
            ReiseRepository reiseRepository = new ReiseRepository();

            foreach (var travel in Travels)
            {
                PurchaseForm purchaseForm = new PurchaseForm();
                purchaseForm.Enddtdtpck.IsEnabled    = false;
                purchaseForm.Startdtpck.SelectedDate = travel.Start;
                purchaseForm.Enddtdtpck.SelectedDate = travel.Ende;
                purchaseForm.HotelNameLbl.Content    = reiseRepository.CountriesList.Find(x => x.LandID == travel.Land).Name;
                purchaseForm.Pricelbl.Content        = travel.Preis;
                purchaseForm.HotelDescriptiontb.Text =
                    travel.Leitung ? "geleitet" : "ungeleitet" + travel.NameLeitung != "" ? travel.NameLeitung : "";
                travelGrid.Children.Add(purchaseForm);
            }
        }
        private void loadHotelContent(object sender, MouseButtonEventArgs e)
        {
            this.TabIndex = 1;
            List <Hotel>         allHotels       = M120Entities.Hotels.ToList();
            HotelImageRepository imageRepository = new HotelImageRepository();

            foreach (var hotel in allHotels)
            {
                PurchaseForm purchaseForm = new PurchaseForm();
                purchaseForm.Name = hotel.Name;
                purchaseForm.HotelImage.Source       = imageRepository.BitmapImageFromBytes(M120Entities.HotelBilds.Find(hotel)?.Bild);
                purchaseForm.Startdtpck.DisplayDate  = DateTime.Now.Date;
                purchaseForm.Enddtdtpck.DisplayDate  = DateTime.Now.Date;
                purchaseForm.HotelDescriptiontb.Text = "Email:" + hotel.Email + "Anzahl Zimmer: " + hotel.AnzahlZimmer.ToString("F") + "Manager: " + hotel.Manager + "Telefon: " +
                                                       hotel.Telefon + "Ort: " + hotel.Ort + "Website: " + hotel.Web;

                hotelGrid.Children.Add(purchaseForm);
            }
        }
Beispiel #3
0
        private void LoadHotels(object sender, MouseButtonEventArgs e)
        {
            M120Entities         m120Entities   = new M120Entities();
            HotelImageRepository HotelImageRepo = new HotelImageRepository();
            List <Hotel>         hotels         = m120Entities.Hotels.ToList();

            foreach (var hotel in hotels)
            {
                PurchaseForm purchaseForm = new PurchaseForm();
                purchaseForm.Name = hotel.Name;
                purchaseForm.HotelImage.Source       = HotelImageRepo.BitmapImageFromBytes(m120Entities.HotelBilds.Find(hotel)?.Bild);
                purchaseForm.Startdtpck.DisplayDate  = DateTime.Now.Date;
                purchaseForm.Enddtdtpck.DisplayDate  = DateTime.Now.Date;
                purchaseForm.HotelDescriptiontb.Text = "Email:" + hotel.Email + "Anzahl Zimmer: " + hotel.AnzahlZimmer.ToString("F") + "Manager: " + hotel.Manager + "Telefon: " +
                                                       hotel.Telefon + "Ort: " + hotel.Ort + "Website: " + hotel.Web;
                purchaseForm.DeleteBtn.Visibility = Visibility.Hidden;
                HotelStackPanel.Children.Add(purchaseForm);
                //Load Data into CustomControl
                //Load all CustomControls into Panel
            }
        }
Beispiel #4
0
        private void LoadTravels(object sender, MouseButtonEventArgs e)
        {
            M120Entities    m120Entities    = new M120Entities();
            List <Reise>    travels         = m120Entities.Reises.ToList();
            ReiseRepository reiseRepository = new ReiseRepository();

            foreach (var travel in travels)
            {
                PurchaseForm purchaseForm = new PurchaseForm();
                purchaseForm.Enddtdtpck.IsEnabled    = false;
                purchaseForm.Startdtpck.SelectedDate = travel.Start;
                purchaseForm.Enddtdtpck.SelectedDate = travel.Ende;
                purchaseForm.HotelNameLbl.Content    = reiseRepository.CountriesList.Find(x => x.LandID == travel.Land).Name;
                purchaseForm.Pricelbl.Content        = travel.Preis;
                purchaseForm.HotelDescriptiontb.Text =
                    travel.Leitung?"geleitet":"ungeleitet" + travel.NameLeitung != "" ? travel.NameLeitung : "";
                purchaseForm.DeleteBtn.Visibility = Visibility.Hidden;
                TravelsStackPanel.Children.Add(purchaseForm);
                //Load into same CustomControl as hotels
                //Do the same step again
            }
        }