示例#1
0
        public JsonResult Delete(System.Int32 id)
        {
            RemoveRoomRequest request = new RemoveRoomRequest();

            request.RoomId = id;
            RemoveRoomResponse response = _roomService.RemoveRoom(request);

            return(Json(response));
        }
示例#2
0
        public RemoveRoomResponse RemoveRoom(RemoveRoomRequest request)
        {
            RemoveRoomResponse response = new RemoveRoomResponse();

            response.Errors = new List <BusinessRule>();
            try {
                if (_roomRepository.Remove(request.RoomId) > 0)
                {
                    response.RoomDeleted = true;
                }
            } catch (Exception ex)
            {
                response.Errors.Add(new BusinessRule("DAL", "DAL_ERROR: " + ex.Message));
            }
            return(response);
        }