Beispiel #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);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ExtraBookings EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToExtraBookings(ExtraBooking extraBooking)
 {
     base.AddObject("ExtraBookings", extraBooking);
 }
 /// <summary>
 /// Create a new ExtraBooking object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="extra_id">Initial value of the extra_id property.</param>
 /// <param name="booking_id">Initial value of the booking_id property.</param>
 /// <param name="participants">Initial value of the participants property.</param>
 /// <param name="booked_date">Initial value of the booked_date property.</param>
 public static ExtraBooking CreateExtraBooking(global::System.Int32 id, global::System.Int32 extra_id, global::System.Guid booking_id, global::System.Int32 participants, global::System.DateTime booked_date)
 {
     ExtraBooking extraBooking = new ExtraBooking();
     extraBooking.id = id;
     extraBooking.extra_id = extra_id;
     extraBooking.booking_id = booking_id;
     extraBooking.participants = participants;
     extraBooking.booked_date = booked_date;
     return extraBooking;
 }
 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);
 }