public ActionResult Admin_Category() { CateDB tool = new CateDB(); DataTable dtCate = tool.GetAllCate(); return(View(dtCate)); }
public ActionResult Detail_Product() { string ProductID = Request["PRODUCTID"]; string prePage = Request["prepage"]; if (ProductID != null) { DataTable dtCate = new CateDB().GetAllCate(); ViewBag.CateList = dtCate; Product p = ProductTool.FindProduct(ProductID); if (p != null) { if (prePage.Equals("del")) { TempData["ACTION"] = "Show_Deleted_Product"; } else { TempData["ACTION"] = "Show_Product"; } return(View(p)); } else { return(RedirectToAction("Show_Product")); } } else { return(RedirectToAction("Show_Product")); } }
public ActionResult Insert_Product() { DataTable dtCate = new CateDB().GetAllCate(); ViewBag.CateList = dtCate; if (TempData["ProductModel"] != null) { return(View(TempData["ProductModel"])); } else { return(View()); } }
public ActionResult Staff_Category() { DataTable dtCate; try { CateDB tool = new CateDB(); dtCate = tool.GetAllCate(); } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(RedirectToAction("Error", "Error")); } return(View(dtCate)); }
public ActionResult Insert_Product(Product p) { if (ModelState.IsValid) { if (!ProductTool.InsertProduct(p)) { TempData["ERROR"] = "Insert Fail, Error at Model"; TempData["ProductModel"] = p; return(RedirectToAction("Insert_Product")); } @TempData["InsertSuccess"] = "Insert Success " + p.ProductName; return(RedirectToAction("Insert_Product")); } else { DataTable dtCate = new CateDB().GetAllCate(); ViewBag.CateList = dtCate; return(View()); } }