public async Task <IActionResult> OrderBooks(string id) { var user = await userManager.FindByIdAsync(id); if (user == null) { ViewBag.ErrorMessage = $"User with the respective ID:{id} cannot be found."; return(View("NotFound")); } OrderBooksViewModels orderedBooks = new OrderBooksViewModels() { UserBooksDB = _bookStore.GetUserSpecificBooks(user.Id) }; return(View(orderedBooks)); }
public async Task <IActionResult> FinalCommand() { var user = await userManager.GetUserAsync(HttpContext.User); if (user == null) { ViewBag.ErrorMessage = $"User with the respective ID:{user.Id} cannot be found."; return(View("NotFound")); } if (string.IsNullOrEmpty(user.SurName) || string.IsNullOrEmpty(user.Name) || string.IsNullOrEmpty(user.PhoneNumber) || string.IsNullOrEmpty(user.Adress) || ((user.Age == 0) || (user.City == 0) || (user.Country == 0))) { return(RedirectToAction("CaptureUserDetails", "UserDetails")); } OrderBooksViewModels orderedBooks = new OrderBooksViewModels() { UserBooksDB = _bookStore.GetUserSpecificBooks(user.Id) }; return(View(orderedBooks)); }