// GET: PaymentConsole public async Task <ActionResult> ShowPaymentListAsync(PaymentQueryViewModel viewModel) { if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } IQueryable <Payment> items = await viewModel.InquirePaymentAsync(this); return(View("~/Views/PaymentConsole/Module/PaymentItemsList.cshtml", items)); }
// GET: PaymentConsole public ActionResult ShowPaymentList(PaymentQueryViewModel viewModel) { if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } IQueryable <Payment> items = viewModel.InquirePayment(this, out string alertMessage); return(View("~/Views/PaymentConsole/Module/PaymentItemsList.cshtml", items)); }
public ActionResult ShowAchievementShareList(PaymentQueryViewModel viewModel) { ViewBag.ViewModel = viewModel; if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } var items = models.GetTable <TuitionAchievement>().Where(t => t.InstallmentID == viewModel.PaymentID); return(View("~/Views/PaymentConsole/Module/AchievementShareList.cshtml", items)); }
public async Task <ActionResult> InquirePaymentAsync(PaymentQueryViewModel viewModel) { if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } viewModel.CustomQuery = viewModel.CustomQuery.GetEfficientString(); //if (viewModel.CustomQuery != null) //{ // viewModel.ContractNo = viewModel.UserName = viewModel.InvoiceNo = viewModel.CustomQuery; //} if (viewModel.CustomQuery == null) { bool hasQuery = false; if (!viewModel.PayoffDateFrom.HasValue) { ModelState.AddModelError("PayoffDateFrom", "請選擇查詢起日"); } else { hasQuery = true; } if (!viewModel.PayoffDateTo.HasValue) { ModelState.AddModelError("PayoffDateTo", "請選擇查詢迄日"); } else { hasQuery = true; } if (!hasQuery) { ModelState.AddModelError("CustomQuery", "請輸入學生姓名(暱稱) 或 合約編號 或 發票號碼"); } } if (!ModelState.IsValid) { ViewBag.ModelState = ModelState; return(View(ConsoleHomeController.InputErrorView)); } IQueryable <Payment> items = await viewModel.InquirePaymentAsync(this); return(View("~/Views/PaymentConsole/Module/CustomPaymentList.cshtml", items)); }
public ActionResult ProcessPayment(PaymentQueryViewModel viewModel) { if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } var item = models.GetTable <Payment>().Where(c => c.PaymentID == viewModel.PaymentID).FirstOrDefault(); if (item == null) { return(View("~/Views/ConsoleHome/Shared/JsAlert.cshtml", model: "收款資料錯誤!!")); } return(View("~/Views/PaymentConsole/Module/ProcessPayment.cshtml", item)); }
public ActionResult DeleteAchievementShare(PaymentQueryViewModel viewModel) { ViewBag.ViewModel = viewModel; if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } if (models.ExecuteCommand("delete TuitionAchievement where CoachID = {0} and InstallmentID = {1}", viewModel.CoachID, viewModel.PaymentID) > 0) { return(Json(new { result = true })); } else { return(Json(new { result = false, message = "資料錯誤!!" })); } }
public ActionResult ProcessAchievementShare(PaymentQueryViewModel viewModel) { ViewBag.ViewModel = viewModel; if (viewModel.KeyID != null) { viewModel.PaymentID = viewModel.DecryptKeyValue(); } var item = models.GetTable <TuitionAchievement>() .Where(t => t.InstallmentID == viewModel.PaymentID) .Where(t => t.CoachID == viewModel.CoachID) .FirstOrDefault(); if (item == null) { return(View("~/Views/ConsoleHome/Shared/JsAlert.cshtml", model: "收款資料錯誤!!")); } return(View("~/Views/PaymentConsole/Module/ProcessAchievementShare.cshtml", item)); }