Exemple #1
0
        public ActionResult BookingTable([FromBody] TableBookingViewModel model)
        {
            if (model != null)
            {
                Booking newBooking = new Booking();
                newBooking.CheckIn       = model.CheckIn;
                newBooking.CheckOut      = model.CheckIn.AddHours(model.Time);
                newBooking.CustomerName  = model.CustomerName;
                newBooking.CustomerPhone = model.CustomerPhone;
                newBooking.Guests        = model.Guests;
                newBooking.Paid          = false;
                newBooking.Completed     = false;
                newBooking.DateCreated   = DateTime.Now;
                newBooking.TotalFee      = 0;
                newBooking.TableID       = model.TableID;

                var BookingList = _context.Bookings;
                BookingList.Add(newBooking);
                _context.SaveChanges();
                string message = "Бронирование успешно завершено. Ближайшее время с Вами свяжется сотрудник ресторана для уточнения деталей.";
                return(Json(message));
            }

            else
            {
                return(Json("Error"));
            }
        }
Exemple #2
0
        public ReservationPage()
        {
            InitializeComponent();
            TableBookingViewModel book;

            book           = new TableBookingViewModel();
            _book          = book;
            BindingContext = _book;
        }