From ec88c3e57b11af718dfdfefa0d29bb8f9ebd59b7 Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 6 Nov 2020 00:13:04 +0000 Subject: [PATCH] --- Base/Controller/FOCommon.cs | 13 ++++++++++ FO/Views/Course/ApplyEdu.cshtml | 44 ++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 6fb80fd..daa6c16 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -380,6 +380,19 @@ namespace NP.Base.Controllers return JsonBack(result); } + [HttpPost] + public JsonResult GetScdForMixEdu(int cmno, int? month) + { + var result = Dao.Get("cm.cminningscds.applyedu", new System.Collections.Hashtable() { { "cmno", cmno }, { "month", (month == null) ? DateTime.Now.Year : month } }); + foreach (var item in result) + { + item.scdInfoSummary = string.Format("[{0}] {1}", item.studyplacename, item.estart.ToString("yyyy년 MM월 dd일 ddd요일 HH:mm")); + item.remainPeople = Convert.ToInt32(item.quota) - Convert.ToInt32(item.regmem); + } + + return JsonBack(result); + } + } } \ No newline at end of file diff --git a/FO/Views/Course/ApplyEdu.cshtml b/FO/Views/Course/ApplyEdu.cshtml index 3bc57bd..635c6e1 100644 --- a/FO/Views/Course/ApplyEdu.cshtml +++ b/FO/Views/Course/ApplyEdu.cshtml @@ -53,20 +53,7 @@    ※지정하신 일자가 수료일자가 됩니다.

- + } @if (Model.CM.cshape == 1) @@ -294,8 +281,7 @@ $(document).ready(function () { initControl(); $("#selMonth").change(function () { - $("#scdMonth").val($("#selMonth").val()); - $("#applyEduForm").submit(); + setScd(); }); $("input[name='rdoRefund']").change(function () { @@ -306,7 +292,11 @@ }); function initControl() { $("#selMonth").val(@Model.scdMonth); - refundAccountShowHide(); + setTimeout(function () { + setScd(); + refundAccountShowHide(); + }, 300); + } function refundAccountShowHide() { if ($("#rdoRefund01").prop("checked")) { @@ -316,4 +306,24 @@ $("#divRefundAccount").hide(); } } + + function setScd() { + capp("/focommon/GetScdForMixEdu", { cmno: @Model.cmno, month: $("#selMonth").val() }, "renderScd"); + } + function renderScd() { + var ulScd = $("#ulScd"); + ulScd.empty(); + $.each(capResult.obj, function (i, d) { + var li = $("
  • "); + if (d.remainPeople <= 0) + { + li.append(" "+d.scdInfoSummary+""); + } + else + { + li.append(" " + d.scdInfoSummary + ""); + } + ulScd.append(li); + }); + }