public ActionResult Edit(int id) { var onlinePaying = new OnlinePayingService().ViewDetail(id); SetViewBagMethod(onlinePaying.Method); return(View(onlinePaying)); }
// GET: Admin/OnlinePayingAdmin public ActionResult Index(string search, int page = 1, int pageSize = 5) { var service = new OnlinePayingService(); var model = service.DanhSachOPPaging(search).ToPagedList(page, pageSize); ViewBag.Search = search; return(View(model)); }
public JsonResult ChangeStatus(int id) { var result = new OnlinePayingService().ChangeStatus(id); return(Json(new { status = result })); }
public ActionResult Edit(OnlinePaying onlinePaying) { if (ModelState.IsValid) { var service = new OnlinePayingService(); var result = service.Update(onlinePaying); if (result) { SetAlert("Cập nhật thanh toán trực tiếp thành công!", "success"); return(RedirectToAction("Index", "OnlinePayingAdmin")); } else { ModelState.AddModelError("", "Cập nhật thanh toán trực tuyến thất bại!"); } } SetViewBagMethod(onlinePaying.Method); return(View("Index")); }
public ActionResult CreateOnline(OnlinePaying onlinePaying) { if (ModelState.IsValid) { var service = new OnlinePayingService(); int id = service.Insert(onlinePaying); if (id > 0) { SetAlert("Thêm thanh toán trực tiếp thành công!", "success"); return(RedirectToAction("Index", "OnlinePayingAdmin")); } else { ModelState.AddModelError("", "Thêm thanh toán trực tuyến mới thất bại!"); } } SetViewBagMethod(onlinePaying.Method); return(View("Index")); }
public void SetViewBagMethod(int?selectedMethodID = null) { var service = new OnlinePayingService(); ViewBag.Method = new SelectList(service.ListAllPaying(), "ID", "Name", selectedMethodID); }