private void DemoErstellen()
        {
            // Platz (kurze Syntax)
            DAL.Platz platz1 = new DAL.Platz {
                Name = "Platz 1 Halle", IstGedeckt = true
            };
            Int64 platz1Id = BLL.Platz.Erstellen(platz1);

            Debug.Print("Platz erstellt mit Id:" + platz1Id);
            DAL.Platz platz2 = new DAL.Platz {
                Name = "Platz A Aussen", IstGedeckt = false
            };
            Int64 platz2Id = BLL.Platz.Erstellen(platz2);

            Debug.Print("Platz erstellt mit Id:" + platz2Id);
            // Reservation (detaillierte Syntax)
            DAL.Reservation reservation1 = new DAL.Reservation();
            reservation1.Spielername = "Roger";
            reservation1.Startzeit   = DateTime.Today.AddDays(5).AddHours(13);
            reservation1.Endzeit     = reservation1.Startzeit.AddHours(2);
            reservation1.Platz       = platz1;
            Int64 classA1Id = BLL.Reservation.Erstellen(reservation1);

            Debug.Print("Kunde erstellt mit Id:" + classA1Id);
        }
Example #2
0
 private void Reservationen_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (Reservationen.SelectedItem != null)
     {
         DAL.Reservation auswahl     = (DAL.Reservation)Reservationen.SelectedItem;
         long            id          = auswahl.ReservationId;
         Reservieren     reservation = new Reservieren(id, gesamtAnsicht);
         gesamtAnsicht.Content = reservation;
     }
 }
        private void update()
        {
            reservation             = new DAL.Reservation();
            reservation.Spielername = kundenname.Text;
            // date.Year;
            //  startzeit.
            reservation.ReservationId = id;
            reservation.Startzeit     = new DateTime(date.SelectedDate.Value.Year, date.SelectedDate.Value.Month, date.SelectedDate.Value.Day, startzeit.SelectedTime.Value.Hour, startzeit.SelectedTime.Value.Minute, startzeit.SelectedTime.Value.Second);
            reservation.Endzeit       = new DateTime(date.SelectedDate.Value.Year, date.SelectedDate.Value.Month, date.SelectedDate.Value.Day, endzeit.SelectedTime.Value.Hour, endzeit.SelectedTime.Value.Minute, endzeit.SelectedTime.Value.Second);
            if (platz.SelectedValue != null)
            {
                reservation.Platz = BLL.Platz.LesenID((long)platz.SelectedValue);
            }

            BLL.Reservation.Aktualisieren(reservation);
        }
 private void delete()
 {
     DAL.Reservation r = BLL.Reservation.LesenID(id);
     BLL.Reservation.Loeschen(r);
 }