public ActionResult Edit(HotelType hoteltype) { if (ModelState.IsValid) { db.HotelTypes.Attach(hoteltype); db.ObjectStateManager.ChangeObjectState(hoteltype, EntityState.Modified); db.SaveChanges(); return RedirectToAction("Index"); } return View(hoteltype); }
public ActionResult Create(HotelType hoteltype) { if (ModelState.IsValid) { db.HotelTypes.AddObject(hoteltype); db.SaveChanges(); return RedirectToAction("Index"); } return View(hoteltype); }
/// <summary> /// Deprecated Method for adding a new object to the HotelTypes EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHotelTypes(HotelType hotelType) { base.AddObject("HotelTypes", hotelType); }
/// <summary> /// Create a new HotelType object. /// </summary> /// <param name="id">Initial value of the id property.</param> /// <param name="name">Initial value of the name property.</param> /// <param name="price">Initial value of the price property.</param> public static HotelType CreateHotelType(global::System.Int32 id, global::System.String name, global::System.Decimal price) { HotelType hotelType = new HotelType(); hotelType.id = id; hotelType.name = name; hotelType.price = price; return hotelType; }