public ActionResult Edit(int id) { SetProduct(); var dao = new ProductImgDao().GetById(id); return(View(dao)); }
// GET: Admin/ProductImg public ActionResult Index(int page = 1, int pageSize = 10) { var dao = new ProductImgDao(); var model = dao.ListAllPagding(page, pageSize); return(View(model)); }
public ActionResult Edit(ProductImage proImg) { var dao = new ProductImgDao(); bool result = dao.UpdateProductImg(proImg); if (result) { return(RedirectToAction("Index", "ProductImg")); } else { ModelState.AddModelError("", "Khong them duoc anh cua san pham"); } return(View("Index", "Home")); }
public ActionResult Create(ProductImage proImg) { var dao = new ProductImgDao(); int id = dao.InsertProductImg(proImg); if (id > 0) { return(RedirectToAction("Index", "ProductImg")); } else { ModelState.AddModelError("", "Khong them anh san pham duoc"); } return(View("Index", "Home")); }