Esempio n. 1
0
        public string CreateBooking(string name)
        {
            using (var db = new CinemaNewDB())
            {
                db.UserBookings.Add(new UserBookings()
                {
                    Name = name,
                });

                db.SaveChanges();
            }
            return(null);
        }
Esempio n. 2
0
        public UserBookings CancelBooking(string name)
        {
            using (var db = new CinemaNewDB())
            {
                var booking = db.UserBookings.FirstOrDefault(b => b.Name.ToLower() == name.ToLower());
                if (booking != null)
                {
                    db.UserBookings.Remove(booking);

                    db.SaveChanges();

                    return(booking);
                }
            }

            return(null);
        }