コード例 #1
0
        public static WCFBook create(
            int bookID,
            string title,
            int categoryID,
            string isbn,
            string author,
            int stock,
            decimal price,
            decimal?discount)
        {
            WCFBook b = new WCFBook();

            b.bookID     = bookID;
            b.title      = title;
            b.categoryID = categoryID;
            b.isbn       = isbn;
            b.author     = author;
            b.stock      = stock;
            b.price      = price;
            b.discount   = discount;

            b.categoryName = new BusinessModel().getCategory(categoryID);
            return(b);
        }
コード例 #2
0
ファイル: Service1.svc.cs プロジェクト: maziesmith/MyBookshop
        public WCFBook GetBook(string id)
        {
            Book b = new BusinessModel().getBook(int.Parse(id));

            return(WCFBook.create(b.BookID, b.Title, b.CategoryID, b.ISBN, b.Author, b.Stock, b.Price, b.Discount));
        }