private void DisplayBooks()
        {
            LibraryService   service = ServiceFactory.CreateLibraryService();
            FindBooksRequest request = new FindBooksRequest();

            request.All = true;
            FindBooksResponse response = service.FindBooks(request);

            rptBooks.DataSource = response.Books;
            rptBooks.DataBind();

            FindBookTitlesRequest bookTitleRequest = new FindBookTitlesRequest();

            bookTitleRequest.All = true;
            FindBookTitlesResponse bookTitlesResponse = service.FindBookTitles(bookTitleRequest);


            ddlBookTitles.DataSource     = bookTitlesResponse.BookTitles;
            ddlBookTitles.DataTextField  = "Title";
            ddlBookTitles.DataValueField = "ISBN";
            ddlBookTitles.DataBind();

            rptBookTitles.DataSource = bookTitlesResponse.BookTitles;
            rptBookTitles.DataBind();
        }
        public FindBooksResponse FindBooks(FindBooksRequest request)
        {
            FindBooksResponse  response = new FindBooksResponse();
            IEnumerable <Book> books    = _bookRepository.FindAll();

            response.Books   = books.ConvertToBookViews();
            response.Success = true;

            return(response);
        }
示例#3
0
        private void DisplayBooks()
        {
            LibraryService   service = ServiceFactory.CreateLibraryService();
            FindBooksRequest request = new FindBooksRequest();

            request.All = true;
            FindBooksResponse response = service.FindBooks(request);

            this.rptBooks.DataSource = response.Books;
            rptBooks.DataBind();
        }