using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ShopOnline.Models;
using ShopOnline.ViewModels;

namespace ShopOnline.Controllers
{
    public class ProductController : Controller
    {
        //
        // GET: /Product/

        public ActionResult Index()
        {
            return View();
        }

        DataRepository _repository = new DataRepository();

        public ActionResult AllProducts()
        {
            List<Product> productModel = new List<Product>();
            productModel = _repository.GetProducts();
            return View(productModel);
        }

        public ActionResult CategoryWiseProducts()
        {
            ProductCategoryVM vm = new ProductCategoryVM();
            vm.AllCategories = _repository.GetCategories();
            vm.AllProducts = _repository.GetProducts();
            return View(vm);
        }


    }
}
