Ejemplo n.º 1
0
        //Admin panal for add the item
        public ActionResult AdminPanalHome()
        {
            var data = new AdminPanalCRUDViewModel();

            var products  = data.ShowAllProduct();
            var viewmodel = new AdminPanalViewModel();

            viewmodel.ShowAllProduct = products;    // here is a list of show all product in view model

            return(View(viewmodel));
        }
        public ActionResult Index(int CategoryId = 1)
        {
            var viewmodel = new AdminPanalViewModel();

            var data = new CustomerCRUDViewModel();

            var category = data.ShowAllCatogery();
            var product  = data.ShowAllProduct(CategoryId);

            viewmodel.ShowAllCategory = category;    // here is a list of show all product in view model

            viewmodel.ShowAllProduct = product;

            if (Session["CustomerId"] != null)
            {
                var CartOrderQuantaty = data.CarTOrderQuantaty(Session["CustomerId"]);
                Session["CartOrderQuantaty"] = CartOrderQuantaty;
            }
            else
            {
                Session["CartOrderQuantaty"] = 0;
            }
            return(View(viewmodel));
        }