// GET: Products/Details/5
        public IActionResult Details(int id)
        {
            var product = _Iproduct.GetProduct(id);

            if (product == null)
            {
                return(NotFound());
            }

            return(View(product));
        }
示例#2
0
        public IActionResult Card()
        {
            var        orders1     = _Icard.Get_AllProductsInCard();
            OrderModel orders      = new OrderModel();
            string     customer_Id = _UserManager.GetUserId(HttpContext.User);

            foreach (var order in orders1)
            {
                if (order.CustomerID.Equals(customer_Id))
                {
                    orders.orders.Add(order);
                    orders.products.Add(_Iproduct.GetProduct(order.ProductID));
                }
            }
            return(View(orders));
        }
 /// <summary>
 /// get the product with the ID, if not exsits create a new one
 /// </summary>
 /// <returns>the product</returns>
 public async Task OnGet()
 {
     Product = await _product.GetProduct(ID.GetValueOrDefault()) ?? new Product();
 }
示例#4
0
 /// <summary>
 /// get that specific product by ID
 /// </summary>
 /// <returns>the product</returns>
 public async Task OnGet()
 {
     Product = await _product.GetProduct(ID);
 }
        /// <summary>
        /// calls the details page
        /// </summary>
        /// <param name="id">id of the specific product</param>
        /// <returns>the page of the product</returns>
        public async Task <IActionResult> Details(int id)
        {
            var prod = await _product.GetProduct(id);

            return(View(prod));
        }