Beispiel #1
0
        /// <summary>
        /// Vies details of an item to add to cart or order
        /// </summary>
        /// <param name="itemId"></param>
        /// <returns></returns>
        public IActionResult details(int itemId)
        {
            var getItemViewModel = new GetItemViewModel();
            var item             = _context.Item.SingleOrDefault(x => x.Id == itemId);
            var relatedItem      = _context.Item.OrderBy(x => x.Id).Take(4).ToList();

            getItemViewModel.item         = item;
            getItemViewModel.relatedItems = relatedItem;

            return(View(getItemViewModel));
        }
        public ActionResult GetItem(int Id)
        {
            GetItemViewModel context = new GetItemViewModel();

            context.Offset = User.Identity.IsAuthenticated ? (int?)_userManager
                             .FindByNameAsync(User.Identity.Name)
                             .Result.TimeZoneOffset : null;

            context.News = _allNews.getObjectNews(Id);

            return(View(context));
        }