Exemple #1
0
        public ActionResult Index()
        {
            List <Product> list = new List <Product>();

            foreach (Product item in productService.GetAll())
            {
                item.CatagoryName = catagoryService.Get(item.CatagoryId).CatagoryName;

                list.Add(item);
            }

            return(View(list));
        }
Exemple #2
0
        public ActionResult Index()
        {
            List <Product> productList = new List <Product>();
            List <int>     itemList    = Session["CART"] as List <int>;

            foreach (int item in itemList)
            {
                Product p = productService.Get(item);
                p.CatagoryName = catagoryService.Get(p.CatagoryId).CatagoryName;

                productList.Add(p);
            }

            return(View(productList));
        }
Exemple #3
0
        public ActionResult MyPurchase(int id)
        {
            List <Product> list = new List <Product>();

            foreach (BuyerPurchase item in purchaseService.GetAll())
            {
                if (item.BuyerId == id)
                {
                    Product p = productService.Get(item.ProductId);
                    p.Date         = item.Date;
                    p.CatagoryName = catagoryService.Get(p.CatagoryId).CatagoryName;

                    list.Add(p);
                }
            }

            return(View(list));
        }