Ejemplo n.º 1
0
 public ActionResult EditRoom(int id)
 {
     EditRoomViewModel model = new EditRoomViewModel();
     model = _homeAdapter.GetEditRoomViewModel(id);
     return View(model);
 }
Ejemplo n.º 2
0
 public EditRoomViewModel GetEditRoomViewModel(int id)
 {
     Room Room = db.Rooms.Find(id);
     EditRoomViewModel model = new EditRoomViewModel();
     model.Kids = db.Kids.ToList();
     model.Room = Room;
     model.RoomName = Room.Name;
     model.KidId = Room.KidId;
     return model;
 }
Ejemplo n.º 3
0
 public ActionResult EditRoom(int id, EditRoomViewModel model)
 {
     _homeAdapter.SaveRoomViewModel(id, model);
     return RedirectToAction("Index");
 }
Ejemplo n.º 4
0
 public void SaveRoomViewModel(int id, EditRoomViewModel model)
 {
     Room Room = db.Rooms.Find(id);
     Room.Name = model.RoomName;
     Room.KidId = model.KidId;
     db.SaveChanges();
 }