Ejemplo n.º 1
0
        public ActionResult LoadBook(int id, string bookDetails, bool autoCompleteSource)
        {
            var books = bf.FilterByAutocomplete(bookDetails, autoCompleteSource);

            if (books == null)
            {
                return(new EmptyResult());
            }

            ViewBag.CollectionId = id;
            return(PartialView("_LoadBook", books));
        }
Ejemplo n.º 2
0
        public ActionResult Index(string bookDetails, bool autocompleteSource = false)
        {
            if (Request.IsAjaxRequest())
            {
                var books = bf.FilterByAutocomplete(bookDetails, autocompleteSource).ToLookup(b => b.Title);

                return(PartialView("_BookList", books));
            }
            else
            {
                var books = uow.BookRepository.Get(orderBy:
                                                   q => q.OrderBy(b => b.Title)
                                                   .ThenBy(b => b.ReturnDate))
                            .Take(200)
                            .ToLookup(b => b.Title);

                return(View(books));
            }
        }