Example #1
0
        public ActionResult Index(string Category = null)
        {
            List <Product> products;



            if (Category == null)
            {
                products = productContext.Collection().ToList();
            }
            else
            {
//                ProductCategory pcat = productCategoriesContext.Collection().FirstOrDefault(pc => pc.Category == Category);

                products = productContext.Collection().Where(p => p.Category == Category).ToList();
            }


            ProducListViewModel model = new ProducListViewModel();

            model.Products   = products;
            model.Categories = productCategoriesContext.Collection().ToList();

            return(View(model));
        }
Example #2
0
        // List<ProductsOnSpecial> ProductList;
        public Home()
        {
            InitializeComponent();
            StoresInRange SETstoreRanges = new StoresInRange();

            SETstoreRanges.SetStoresInRange();
            //OnSpecialList();
            //GetProductsOnSpecial();
            BindingContext = new ProducListViewModel();

            // RestAPI restAPI = new RestAPI();

            // BindingContext = restAPI.GetProductsOnSpecials();
        }