Esempio n. 1
0
    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));
    }
Esempio n. 2
0
    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));
    }
Esempio n. 3
0
    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));
    }
Esempio n. 4
0
    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);
    }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
    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);
    }
Esempio n. 7
0
    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);
    }
Esempio n. 8
0
    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));
    }