Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }