コード例 #1
0
        // 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));
        }
コード例 #2
0
        // 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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        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));
        }
コード例 #5
0
        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));
        }
コード例 #6
0
        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 = "資料錯誤!!" }));
            }
        }
コード例 #7
0
        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));
        }