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()); }
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()); }
// GET: Admin/Brand public ActionResult Index() { Session["URL"] = null; var brand = new BrandModel(); var model = brand.ListAllBrand(); ViewBag.Brand = model; return(View()); }
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)); }
// 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()); }
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)); }
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)); }
// 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()); } }
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)); } }
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)); } }