示例#1
0
 /// <summary>
 /// Create a new Reservation object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="idCustomer">Initial value of the IdCustomer property.</param>
 /// <param name="arrival">Initial value of the Arrival property.</param>
 /// <param name="departure">Initial value of the Departure property.</param>
 /// <param name="reservationDate">Initial value of the ReservationDate property.</param>
 /// <param name="adults">Initial value of the Adults property.</param>
 /// <param name="childrens">Initial value of the Childrens property.</param>
 /// <param name="price">Initial value of the Price property.</param>
 /// <param name="priceRack">Initial value of the PriceRack property.</param>
 /// <param name="idReservationStatus">Initial value of the IdReservationStatus property.</param>
 /// <param name="priceBase">Initial value of the PriceBase property.</param>
 public static Reservation CreateReservation(global::System.Int32 id, global::System.Int32 idCustomer, global::System.DateTime arrival, global::System.DateTime departure, global::System.DateTime reservationDate, global::System.Int32 adults, global::System.Int32 childrens, global::System.Decimal price, global::System.Decimal priceRack, global::System.Int32 idReservationStatus, global::System.Decimal priceBase)
 {
     Reservation reservation = new Reservation();
     reservation.Id = id;
     reservation.IdCustomer = idCustomer;
     reservation.Arrival = arrival;
     reservation.Departure = departure;
     reservation.ReservationDate = reservationDate;
     reservation.Adults = adults;
     reservation.Childrens = childrens;
     reservation.Price = price;
     reservation.PriceRack = priceRack;
     reservation.IdReservationStatus = idReservationStatus;
     reservation.PriceBase = priceBase;
     return reservation;
 }
示例#2
0
        public ActionResult Edit(Reservation reservation)
        {
            var __toedit = db.Reservation.SingleOrDefault(x => x.Id.Equals(reservation.Id));
            if (reservation.IdReservationStatus != 0)
            {
                __toedit.IdReservationStatus = reservation.IdReservationStatus;
                if (reservation.PayLimit.HasValue)
                    __toedit.PayLimit = reservation.PayLimit;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.IdCustomer = new SelectList(db.Customer, "Id", "Name", reservation.IdCustomer);
            ViewBag.IdReservationStatus = new SelectList(db.ReservationStatus, "Id", "Name", reservation.IdReservationStatus);
            return View(reservation);
        }
示例#3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Reservation EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToReservation(Reservation reservation)
 {
     base.AddObject("Reservation", reservation);
 }