// GET: Admin/Method public ActionResult Index(int page = 1, int pageSize = 10) { var dao = new MethodDao(); var model = dao.ListAllPagding(page, pageSize); return(View(model)); }
public ActionResult Edit(Method method) { var dao = new MethodDao(); bool result = dao.UpdateMethod(method); if (result) { return(RedirectToAction("Index", "Transaction")); } else { ModelState.AddModelError("", "Khong them duoc"); } return(View("Index", "Home")); }
public ActionResult CreateProduct(Method method) { var dao = new MethodDao(); int id = dao.InsertMethod(method); if (id > 0) { return(RedirectToAction("Index", "Method")); } else { ModelState.AddModelError("", "Khong them san pham thanh cong"); } return(View("Index", "Home")); }
public void SetMethod(int?selectedId = null) { var dao = new MethodDao(); ViewBag.methodId = new SelectList(dao.ListAll(), "methodId", "methodName", "selectedId"); }
public ActionResult Edit(int id) { var method = new MethodDao().GetById(id); return(View(method)); }