public JsonResult Create(RoomDetailView vm) { CreateRoomRequest request = new CreateRoomRequest(); request.RoomName = vm.RoomName; request.Address = vm.Address; request.PhoneNumber = vm.PhoneNumber; CreateRoomResponse response = _roomService.CreateRoom(request); return(Json(response)); }
public JsonResult GetDetail(System.Int32 id) { RoomDetailView vm = new RoomDetailView(); GetRoomRequest request = new GetRoomRequest(); request.RoomId = id; GetRoomResponse response = _roomService.GetRoom(request); if (response.RoomFound) { vm = response.Room.ConvertToRoomDetailView(); } return(Json(vm, JsonRequestBehavior.AllowGet)); }
public JsonResult Update(RoomDetailView vm) { GetRoomRequest request = new GetRoomRequest(); request.RoomId = vm.RoomId; ModifyRoomRequest updateRequest = _roomService.GetRoom(request).Room.ConvertToModifyRoomRequest(); updateRequest.RoomId = vm.RoomId; updateRequest.RoomName = vm.RoomName; updateRequest.Address = vm.Address; updateRequest.PhoneNumber = vm.PhoneNumber; ModifyRoomResponse response = _roomService.ModifyRoom(updateRequest); return(Json(response)); }