public IActionResult Index() { var authoers = _authorRepositoryGUI.GetAuthors(); if (authoers.Count() <= 0) { ViewBag.msg = "There is some Problem while getting the authors from the database or Authors does not exist yet"; } return(View(authoers)); }
public IActionResult CreateBook() { var authors = authorRepository.GetAuthors(); var categories = categoryRepository.GetCategories(); if (authors.Count() <= 0 || categories.Count() <= 0) { ModelState.AddModelError("", "Some kind or error getting authors or categories"); } var authorList = new AuthorsList(authors.ToList()); var categoryList = new CategoriesList(categories.ToList()); var createUpdateBook = new CreateUpdateBookViewModel { AuthorSelectListItems = authorList.GetAuthorsList(), CategorySelectListItems = categoryList.GetCategories() }; return(View(createUpdateBook)); }
public IActionResult Index() { var authors = _authorRespository.GetAuthors(); if (authors.Count() <= 0) { ViewBag.Message = "There was a problem retrieving authors from " + "the database or no author exists"; } return(View(authors)); }
public IActionResult Index() { var authors = _authorRepository.GetAuthors(); if (authors.Count() <= 0) { ViewBag.Message = "There was a problem retreving authors from the database or no author exists"; } ViewBag.SuccessMessage = TempData["SuccessMessage"]; return(View(authors)); }
public IActionResult Index() { var authors = authorRepository.GetAuthors(); if (authors.Count() <= 0) { ViewBag.Message = "There are problems retrieving authors " + " or authors does not exist in the database."; } return(View(authors)); }