public ActionResult AddRoom(RoomVm roomVm) { try { Roomtype roomtype = _hotelReservationService.GetRoomTypeById(roomVm.RoomTypeId); Room room = new Room(); room.Roomno = roomVm.RoomNo; room.Noofadult = roomVm.NoOfAdult; room.Roomtype = roomtype; room.Description = roomVm.Description; room.Maxchild = roomVm.MaxChild; _hotelReservationService.SaveRoom(room); ViewBag.roomTypes = new SelectList(_hotelReservationService.LoadAllRoomType(), "Id", "Name"); ViewBag.SuccessMessage = "Room Saved Successfully"; } catch (Exception) { ViewBag.ErrorMessage = "Failed to Save!"; } return(View()); }