Ejemplo n.º 1
0
        public ActionResult CustomerBooking(BookingViewModel bookVM)
        {
            bookVM.Booking = dbBooking.GetBookings().Where(x => x.Id.Equals(bookVM.Booking.Id)).FirstOrDefault();

            var selectedAccessoires = bookVM.Accessories.Where(x => x.IsChecked == true).ToList <Accessory>();

            foreach (var selectedAccessory in selectedAccessoires)
            {
                dbBooking.AddAccessoriesToOrder(selectedAccessory.Id, bookVM.Booking.Id);
                var accessory = dbAccessory.GetAccesories().ToList().Where(a => a.Id == selectedAccessory.Id).FirstOrDefault();
                bookVM.BookingAccessories.Add(selectedAccessory);
            }

            return(View(bookVM));
        }