Beispiel #1
0
        public ActionResult Edit(int id)
        {
            var onlinePaying = new OnlinePayingService().ViewDetail(id);

            SetViewBagMethod(onlinePaying.Method);
            return(View(onlinePaying));
        }
Beispiel #2
0
        // 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));
        }
Beispiel #3
0
        public JsonResult ChangeStatus(int id)
        {
            var result = new OnlinePayingService().ChangeStatus(id);

            return(Json(new
            {
                status = result
            }));
        }
Beispiel #4
0
 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"));
 }
Beispiel #5
0
 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"));
 }
Beispiel #6
0
        public void SetViewBagMethod(int?selectedMethodID = null)
        {
            var service = new OnlinePayingService();

            ViewBag.Method = new SelectList(service.ListAllPaying(), "ID", "Name", selectedMethodID);
        }