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.category = book.Category.Name;
            wcfBook.isbn     = book.ISBN;
            wcfBook.stock    = book.Stock;
            wcfBook.price    = book.Price;
            return(wcfBook);
        }