示例#1
0
 public void AddRoomViewModel(CreateRoomViewModel model)
 {
     Room Room = db.Rooms.Create();
     Room.RoomName = model.RoomName;
     db.Rooms.Add(Room);
     //Creating the relationship in the KidRoom table between the two
     //Tables.
     KidRoom kr = new KidRoom(){KidId = model.KidId, RoomId = Room.Id};
     db.KidRooms.Add(kr);
     db.SaveChanges();
 }
示例#2
0
 public ActionResult CreateRoom(CreateRoomViewModel model)
 {
     _homeAdapter.AddRoomViewModel(model);
     return RedirectToAction("Index");
 }