public ActionResult Edit(Room room, int environmentId, int categoryId) { if (ModelState.IsValid) { Room roo = _roomDao.GetById(room.Id); roo.Code = room.Code; roo.Name = room.Name; roo.Floor = room.Floor; roo.Category = _roomCategoryDao.GetById(categoryId); roo.Purpouse = room.Purpouse; roo.Environment = _environmentDao.GetById(environmentId); _roomDao.Update(roo); return(RedirectToAction("Index", "Room")); } InitViewBag(); return(View("Detail", room)); }
public ActionResult Detail(int id) { RoomCategory roomCategory = _roomCategoryDao.GetById(id); return(View(roomCategory)); }