Exemplo n.º 1
0
        private void AddReservation()
        {
            ReservationDBContect ReservationDB = new ReservationDBContect();

            ReservationDB.Reservations.Add(new Reservation {
                Email = Used.Email, TableId = int.Parse(materialLabel12.Text), Date = DateTime.Now
            });
            ReservationDB.SaveChanges();
        }
Exemplo n.º 2
0
        private void RemoveReservation()
        {
            ReservationDBContect ReservationDB = new ReservationDBContect();
            Reservation          reservation;

            try
            {
                reservation = ReservationDB.Reservations.FirstOrDefault(e => e.Email == Used.Email);
                if (reservation != null)
                {
                    ReservationDB.Reservations.Remove(reservation);
                    ReservationDB.SaveChanges();
                }
            }
            catch (Exception)
            {
            }
        }