public WCFBook GetBook(string id) { int bookId = Int32.Parse(id); Book b = context.Books.Where(x => x.BookID == bookId).First(); return(WCFBook.Make(b.BookID, b.Title, b.CategoryID, b.ISBN, b.Author, b.Stock, b.Price)); }
public WCFBook GetBook(String id) { Book c = Data.GetBook(id); return(WCFBook.Make(c.id, c.title, c.description, c.price, c.cg, c.image, c.quantity)); }
public WCFBook GetBook(string isbn) { Book b = Data.GetBookDetails(isbn); String categoryName = Data.GetCategory(b.CategoryID).CategoryName; return(WCFBook.Make(b.BookID, b.Title, b.ISBN, b.Author, b.Stock, b.Price, categoryName)); }
public List <WCFBook> List() { List <WCFBook> wlist = new List <WCFBook>(); List <Book> blist = BookData.ListCustomers(); foreach (Book b in blist) { wlist.Add(WCFBook.Make(b.BookID.ToString(), b.Title, b.ISBN, b.Author, b.Stock, b.Price)); } return(wlist); }
public WCFBook[] List() { Book[] books = Bookshop.Data.ListBooks().ToArray <Book>(); WCFBook[] wcfBooks = new WCFBook[books.Length]; for (int i = 0; i < books.Length; i++) { Book b = books[i]; wcfBooks[i] = WCFBook.Make(b.BookID, b.Title, b.CategoryID, b.ISBN, b.Author, b.Stock, b.Price); } return(wcfBooks); }
public WCFBook[] SearchBook(string title) { List <Book> bookList = Data.GetBooksByTitle(title); WCFBook[] wcfBookList = new WCFBook[bookList.Count]; for (int i = 0; i < bookList.Count; i++) { Book b = bookList[i]; String categoryName = Data.GetCategory(b.CategoryID).CategoryName; wcfBookList[i] = WCFBook.Make(b.BookID, b.Title, b.ISBN, b.Author, b.Stock, b.Price, categoryName); } return(wcfBookList); }
public List <WCFBook> GetBookByCg(String cg) { List <WCFBook> wb = new List <WCFBook>(); List <Book> b = Data.GetBookByCg(cg); for (int i = 0; i < b.Count; i++) { Book c = b[i]; wb.Add(WCFBook.Make(c.id, c.title, c.description, c.price, c.cg, c.image, c.quantity)); } return(wb); }
public WCFBook GetBook(string id) { Book b = BookData.GetBook(Int32.Parse(id)); return(WCFBook.Make(b.BookID.ToString(), b.Title, b.ISBN, b.Author, b.Stock, b.Price)); }