예제 #1
0
        public BookList GetBookList(BookListRequest bookListRequest)
        {
            BookList bookList;
            using (var dataAccess = new LibraryDataAccess())
            {
                var dt = dataAccess.GetBookList(bookListRequest.BookName, bookListRequest.AuthorName, bookListRequest.CategoryName, bookListRequest.Order);
                bookList = new BookList();
                bookList.AddData(dt);
            }

            return bookList;
        }
예제 #2
0
        public ActionResult Index(string bookname, string author, string category, string order)
        {
            //BookListRequest bookListRequest = new BookListRequest(bookname, author, category, Convert.ToInt32(order));
            BookListRequest bookListRequest = new BookListRequest(bookname, author, category, Convert.ToInt32(order));
            LibraryBusinessRules businessRules = new LibraryBusinessRules();
            BookList bookList = businessRules.GetBookList(bookListRequest);

            //ViewBag.Order = Convert.ToString(Convert.ToInt32(order), 2).PadLeft(3,'0');
            //ViewBag.Order = order;

            if (bookList != null)
            {
                return PartialView("PartialViews/BookList", bookList);
            }

            return View();
        }