public ActionResult Create(vHotel vhotel) { if (ModelState.IsValid) { db.vHotels.AddObject(vhotel); db.SaveChanges(); return RedirectToAction("Index"); } return View(vhotel); }
/// <summary> /// Deprecated Method for adding a new object to the vHotels EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTovHotels(vHotel vHotel) { base.AddObject("vHotels", vHotel); }
/// <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; }
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); }