Beispiel #1
0
        public ActionResult Insert(string type = null)
        {
            //Lưu URL
            if (Session["URL"] == null)
            {
                Session["URL"] = HttpContext.Request.UrlReferrer.AbsoluteUri.ToString();
                ViewBag.URL    = Session["URL"];
            }
            else
            {
                ViewBag.URL = Session["URL"];
            }

            if (type == "success")
            {
                TempData["Alert-Message"] = "Thêm sản phẩm thành công";
                TempData["AlertType"]     = "alert-success";
            }
            else
            {
                if (type == "fail")
                {
                    TempData["Alert-Message"] = "Thêm sản phẩm thất bại";
                    TempData["AlertType"]     = "alert-danger";
                }
            }
            var brand    = new BrandModel();
            var category = new CategoryModel();

            ViewBag.Brand    = brand.ListAllBrand();
            ViewBag.Category = category.ListAllCategory();
            return(View());
        }
Beispiel #2
0
        public ActionResult Edit(string maSP, string type = null)
        {
            if (Session["URL"] == null)
            {
                Session["URL"] = HttpContext.Request.UrlReferrer.AbsoluteUri.ToString();
                ViewBag.URL    = Session["URL"];
            }
            else
            {
                ViewBag.URL = Session["URL"];
            }
            if (type == "success")
            {
                TempData["Alert-Message"] = "Chỉnh sửa sản phẩm " + maSP + " thành công";
                TempData["AlertType"]     = "alert-success";
            }
            else
            {
                if (type == "fail")
                {
                    TempData["Alert-Message"] = "Chỉnh sửa sản phẩm " + maSP + " thất bại";
                    TempData["AlertType"]     = "alert-danger";
                }
            }
            var product  = new ProductModel();
            var brand    = new BrandModel();
            var category = new CategoryModel();

            ViewBag.Product  = product.infoProduct(maSP);
            ViewBag.Brand    = brand.ListAllBrand();
            ViewBag.Category = category.ListAllCategory();
            return(View());
        }
Beispiel #3
0
        // GET: Admin/Brand
        public ActionResult Index()
        {
            Session["URL"] = null;

            var brand = new BrandModel();
            var model = brand.ListAllBrand();

            ViewBag.Brand = model;
            return(View());
        }
Beispiel #4
0
        public ActionResult Stored()
        {
            Session["URL"] = null;

            var product  = new ProductModel();
            var brand    = new BrandModel();
            var category = new CategoryModel();
            var model    = product.ListAlllowQuantity();

            ViewBag.Brand    = brand.ListAllBrand();
            ViewBag.Category = category.ListAllCategory();
            return(View(model));
        }
Beispiel #5
0
        // GET: Admin/Product
        public ActionResult Index()
        {
            Session["URL"] = null;

            var product  = new ProductModel();
            var brand    = new BrandModel();
            var category = new CategoryModel();

            ViewBag.Product  = product.ListAll();
            ViewBag.Brand    = brand.ListAllBrand();
            ViewBag.Category = category.ListAllCategory();
            return(View());
        }
Beispiel #6
0
        public ActionResult SanPhamTheoDanhMuc(string maDM)
        {
            Session["URL"] = null;

            ViewBag.maDM = maDM;
            var product  = new ProductModel();
            var brand    = new BrandModel();
            var category = new CategoryModel();
            var model    = product.ListAllbyCategory(maDM);

            ViewBag.Brand    = brand.ListAllBrand();
            ViewBag.Category = category.ListAllCategory();
            return(View(model));
        }
Beispiel #7
0
        public ActionResult SanPhamTheoThuongHieu(string maTH)
        {
            Session["URL"] = null;

            ViewBag.maTh = maTH;
            var product  = new ProductModel();
            var brand    = new BrandModel();
            var category = new CategoryModel();
            var model    = product.ListAllbyBrand(maTH);

            ViewBag.Brand    = brand.ListAllBrand();
            ViewBag.Category = category.ListAllCategory();
            return(View(model));
        }
Beispiel #8
0
 // GET: Admin/Brand
 public ActionResult Index()
 {
     if (Session["Account"] == null)
     {
         return(RedirectToAction("Index", "Login", new { area = "" }));
     }
     else
     {
         Session["URL"] = null;
         var brand = new BrandModel();
         var model = brand.ListAllBrand();
         ViewBag.Brand = model;
         return(View());
     }
 }
Beispiel #9
0
 public ActionResult SanPhamTheoThuongHieu(string maTH)
 {
     if (Session["Account"] == null)
     {
         return(RedirectToAction("Index", "Login", new { area = "" }));
     }
     else
     {
         Session["URL"] = null;
         ViewBag.maTh   = maTH;
         var product  = new ProductModel();
         var brand    = new BrandModel();
         var category = new CategoryModel();
         var model    = product.ListAllbyBrand(maTH);
         ViewBag.Brand    = brand.ListAllBrand();
         ViewBag.Category = category.ListAllCategory();
         return(View(model));
     }
 }
Beispiel #10
0
        public ActionResult Stored()
        {
            if (Session["Account"] == null)
            {
                return(RedirectToAction("Index", "Login", new { area = "" }));
            }
            else
            {
                Session["URL"] = null;

                var product  = new ProductModel();
                var brand    = new BrandModel();
                var category = new CategoryModel();
                var model    = product.ListAlllowQuantity();
                ViewBag.Brand    = brand.ListAllBrand();
                ViewBag.Category = category.ListAllCategory();
                return(View(model));
            }
        }