示例#1
0
 private void handleUpdate(Response response)
 {
     if (response is BorrowBookResponse)
     {
         BorrowBookResponse borrowBookResponse = (BorrowBookResponse)response;
         BookQuantityDTO    bookQuantityDto    = borrowBookResponse.BookQuantityDto;
         client.bookUpdated(bookQuantityDto.BookId, bookQuantityDto.NewQuantity);
     }
     if (response is ReturnBookResponse)
     {
         ReturnBookResponse returnBookResponse = (ReturnBookResponse)response;
         BookDTO            bookDto            = returnBookResponse.BookDto;
         client.bookReturned(bookDto.Id, bookDto.Author, bookDto.Title);
     }
 }
示例#2
0
        public void bookUpdated(int bookId, int newQuantity)
        {
            BookQuantityDTO bookQuantityDto = new BookQuantityDTO(bookId, newQuantity);

            sendResponse(new BorrowBookResponse(bookQuantityDto));
        }
示例#3
0
 public BorrowBookResponse(BookQuantityDTO bookQuantityDto)
 {
     this.bookQuantityDto = bookQuantityDto;
 }