Beispiel #1
0
        public ActionResult AddProduct()
        {
            Category_Bll category_Bll = new Category_Bll();
            var          categoryList = category_Bll.GetAllCategories();
            SelectList   items        = new SelectList(categoryList, "Id", "Name");

            ViewBag.category = items;
            return(PartialView());
        }
Beispiel #2
0
        public ActionResult EditProduct(int id)
        {
            Product_Bll product_Bll = new Product_Bll();

            var          result       = product_Bll.GetProductById(id);
            Category_Bll category_Bll = new Category_Bll();
            var          categoryList = category_Bll.GetAllCategories();
            SelectList   items        = new SelectList(categoryList, "Id", "Name");

            ViewBag.category = items;
            return(PartialView(result));
        }
        public ActionResult Index()
        {
            TempData["Contact"]        = string.Empty;
            ViewBag.order              = TempData["order"];
            ViewBag.errorLogin         = TempData["LoginError"];
            ViewBag.register           = TempData["rigster"];
            ViewBag.profile            = TempData["profile"];
            TempData["editUser"]       = string.Empty;
            TempData["ChangePassword"] = string.Empty;
            Product_Bll  bll          = new Product_Bll();
            var          result       = bll.GetAllProducts();
            Category_Bll category_bll = new Category_Bll();
            var          categoryList = category_bll.GetAllCategories();

            ViewBag.categoryList = categoryList;
            return(View(result));
        }