Exemplo n.º 1
0
        /// <summary>
        /// Allows you to search for books based to title
        /// </summary>
        public void SearchBooksByTitle()
        {
            BookViews.SearchPage();
            var keyword = Console.ReadLine();

            if (keyword != "")
            {
                WebbShopAPI api         = new WebbShopAPI();
                var         listOfBooks = api.GetBooks(keyword).ToList();
                if (listOfBooks != null)
                {
                    BookViews.DisplayBookList(listOfBooks);
                    return;
                }
            }

            MessageViews.DisplayErrorMessage();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Allows you to search for a specific category
        /// </summary>
        public void SearchFunctionCategories()
        {
            BookViews.SearchPage();
            var keyword = Console.ReadLine();

            if (keyword != "")
            {
                WebbShopAPI api = new WebbShopAPI();
                var         listOfCategories = api.GetCategories(keyword).ToList();
                if (listOfCategories != null)
                {
                    BookViews.DisplayCategoryList(listOfCategories);
                    return;
                }
            }

            MessageViews.DisplayErrorMessage();
        }