Ejemplo n.º 1
0
        public ActionResult AddExtraToBooking(Guid booking_id, int extra_id, int number, DateTime extra_date)
        {
            Cart         cart         = new Cart();
            ExtraBooking extraBooking = new ExtraBooking();

            extraBooking.extra_id     = extra_id;
            extraBooking.participants = number;
            extraBooking.booked_date  = extra_date;
            Extra extra = cart.ctx.Extras.FirstOrDefault(x => x.id == extra_id);

            extraBooking.Extra = extra;
            cart.GetBooking(booking_id).ExtraBookings.Add(extraBooking);
            return(PartialView("_ExtraBookingCartPartial", cart.GetBooking(booking_id).ExtraBookings));
        }
Ejemplo n.º 2
0
 public ExtraBookingViewModel(ExtraBooking eb, int?resort_id)
 {
     ExtraBooking = eb;
     ResortExtras = resort_id.HasValue ? new SelectList(db.Extras.Where(x => x.resort_id == resort_id), "id", "name") : new SelectList(ExtraBooking.Booking.Hotel.Resort.Extras, "id", "name", ExtraBooking.extra_id);
 }