Esempio n. 1
0
        private async Task <IActionResult> GetListView(string userId, CourseListType courseListType)
        {
            var listItems = (await appCourseListService.GetCoursesInListForApplicationUserAsync(Guid.Parse(userId), courseListType)).ToList();

            ViewBag.IsShoppingList = courseListType == CourseListType.ShoppingCart;
            return(View("List", listItems));
        }
Esempio n. 2
0
        public async Task <IActionResult> Index()
        {
            var userId  = User.FindFirstValue(ClaimTypes.NameIdentifier);
            var courses = (await appCourseListService
                           .GetCoursesInListForApplicationUserAsync
                               (Guid.Parse(userId),
                               Core.Entities.Enums.CourseListType.ShoppingCart))
                          .ToList();

            await orderService.AddNewOrderAsync(userId, courses);

            //TODO: remove everything from shopping list

            return(View());
        }