コード例 #1
0
        public ActionResult CustomerIndex()
        {
            var allProducts = new DAL.CRUDProduct().GetProducts();
            var allprodoctindexModelList = new List <Models.ProductIndexModel>();

            foreach (var item in allProducts)
            {
                allprodoctindexModelList.Add(new Models.ProductIndexModel()
                {
                    Id        = item.Id,
                    Image     = item.Image,
                    Name      = item.Name,
                    UnitPrice = item.UnitPrice
                });
            }
            return(View(allprodoctindexModelList));
        }
コード例 #2
0
        public ActionResult ProductIndexV3()
        {
            var allProducts = new DAL.CRUDProduct().GetProducts();

            return(View(allProducts));
        }
コード例 #3
0
        // GET: Product
        public ActionResult Index() //for the admin to checkout the list of products.
        {
            var allProducts = new DAL.CRUDProduct().GetProducts();

            return(View(allProducts));
        }