Exemplo n.º 1
0
 //helper method
 private WCFBook[] ConvertFromBookList(List <Book> bList)
 {
     WCFBook[] bk = new WCFBook[bList.Count];
     for (int i = 0; i < bList.Count; i++)
     {
         bk[i] = WCFBook.MakeBook(bList[i]);
     }
     return(bk);
 }
Exemplo n.º 2
0
        public WCFBook FindBookById(string id)
        {
            int  bookId;
            bool result = Int32.TryParse(id, out bookId);

            if (result)
            {
                return(WCFBook.MakeBook(BusinessLogic.SearchBookByBookId(bookId)));
            }
            return(null);
        }
        public static WCFBook MakeBook(Book book)
        {
            WCFBook wcfBook = new WCFBook();

            wcfBook.title      = book.Title;
            wcfBook.bookID     = book.BookID;
            wcfBook.author     = book.Author;
            wcfBook.categoryID = book.CategoryID;
            wcfBook.isbn       = book.ISBN;
            wcfBook.stock      = book.Stock;
            wcfBook.price      = book.Price;
            return(wcfBook);
        }
Exemplo n.º 4
0
 public int Update(WCFBook wcfbook)
 {
     return(BusinessLogic.UpdateBook(wcfbook.BookID, wcfbook.Title, wcfbook.Category, wcfbook.ISBN, wcfbook.Author, wcfbook.Stock, wcfbook.Price));
 }