/// <summary> /// Allows you to view all book categories /// </summary> public void ViewAllCategories() { WebbShopAPI api = new WebbShopAPI(); var listOfCategories = api.GetCategories().ToList(); if (listOfCategories != null) { var sortCategoryList = listOfCategories.OrderBy(c => c.ID).ToList(); BookViews.DisplayCategoryList(sortCategoryList); return; } MessageViews.DisplayErrorMessage(); }
/// <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(); }