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

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