Пример #1
0
        public ActionResult Create(vHotel vhotel)
        {
            if (ModelState.IsValid)
            {
                db.vHotels.AddObject(vhotel);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(vhotel);
        }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the vHotels EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTovHotels(vHotel vHotel)
 {
     base.AddObject("vHotels", vHotel);
 }
Пример #3
0
 /// <summary>
 /// Create a new vHotel object.
 /// </summary>
 /// <param name="hpk_idHotel">Initial value of the Hpk_idHotel property.</param>
 public static vHotel CreatevHotel(global::System.Int64 hpk_idHotel)
 {
     vHotel vHotel = new vHotel();
     vHotel.Hpk_idHotel = hpk_idHotel;
     return vHotel;
 }
Пример #4
0
 public ActionResult Edit(vHotel vhotel)
 {
     if (ModelState.IsValid)
     {
         db.vHotels.Attach(vhotel);
         db.ObjectStateManager.ChangeObjectState(vhotel, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(vhotel);
 }