From 2b497989b485550411eaba617434ae894b9771dd Mon Sep 17 00:00:00 2001 From: shjang Date: Wed, 3 Aug 2022 07:50:01 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9E=84=EC=8B=9C=EC=BB=A4=EB=B0=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Controller/FOCommon.cs | 52 +++++++++-- Dao/MyBatis/Maps/CM.xml | 47 ++++++---- FO/Views/Course/ApplyEdu.cshtml | 11 +-- FO/Views/Course/ApplyPay.cshtml | 30 +++++-- FO/Views/Course/SmartSearch.cshtml | 29 ++++--- FO/Views/My/Index.cshtml | 135 +++++++++++++++++------------ FO/Views/My/Lecture.cshtml | 17 ++-- FO/js/mypage.js | 39 +++++++-- 8 files changed, 249 insertions(+), 111 deletions(-) diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index cb3735f..ecfdf5e 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -529,12 +529,24 @@ namespace NP.Base.Controllers hsData.Add("month", month); hsData.Add("studyplace", studyPlace); var result = Dao.Get("cm.cminningscds.applyedu" + (lectno != null ? ".lectno" : ""), hsData); - + + hsData.Clear(); + hsData.Add("cmno", cmno); + var resultTmp = Dao.Get("cm.cms", hsData).FirstOrDefault(); //var result = Dao.Get("cm.cminningscds.applyedu"+(lectno != null ? ".lectno" : ""), new System.Collections.Hashtable() { { "cmno", cmno },{"lectno",lectno }, { "month", (month == null) ? null : month } }); foreach (var item in result) { //item.scdInfoSummary = string.Format("[{0}] {1}", item.studyplacename, item.estart.ToString("yyyy년 MM월 dd일 ddd요일 HH:mm")); - item.scdInfoSummary = string.Format("{0}", item.estart.ToString("yyyy년 MM월 dd일까지")); + //item.scdInfoSummary = string.Format("{0}", item.estart.ToString("yyyy년 MM월 dd일까지")); + if (resultTmp.cshape == 1) + { + item.scdInfoSummary = string.Format("{0} ~ {1}", item.estart.ToString("yyyy년 MM월 dd일"), item.eend.ToString("MM월 dd일")); + } + else + { + item.scdInfoSummary = string.Format("{0}", item.estart.ToString("yyyy년 MM월 dd일까지")); + } + if (item.estart < Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd 00:00:00"))) item.isEnd = true; } @@ -628,15 +640,43 @@ where t1.status = 1 and t4.pstatus= 1 return JsonBack(result); } + /// + /// 수강신청시 가능인원 체크하기 + /// 20220803 + /// + /// + /// [HttpPost] - public JsonResult UpdateScd(int cmisno, int lectno) + public JsonResult CheckQtyScd(int cmisno) { var pass = Dao.Get("cm.cminningscdcheck", new System.Collections.Hashtable() { { "cmisno", cmisno }}).First(); if (pass == 0) - return JsonBack(new JsonRtn() { code = 0, msg = "해당 일정은 모집 인원이 마감되었습니다." }); - else if(pass > 0) { - Dao.Save("cm.lectcmisno.up" , new System.Collections.Hashtable() { { "cmisno", cmisno }, { "lectno", lectno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }); + return JsonBack(new JsonRtn() { code = 0, msg = "해당 일정은 모집 인원이 마감되었습니다." }); + } + else if (pass > 0) + { + return JsonBack(new JsonRtn() { code = 1000, msg = "" }); + } + + return JsonBack(new JsonRtn() { code = -1, msg = "개발자에게 문의하세요." }); + } + + /// + /// + /// + /// + /// + /// + [HttpPost] + public JsonResult UpdateScd(int cmisno, int lectno) + { + var pass = Dao.Get("cm.cminningscdcheck", new System.Collections.Hashtable() { { "cmisno", cmisno } }).First(); + if (pass == 0) + return JsonBack(new JsonRtn() { code = 0, msg = "해당 일정은 모집 인원이 마감되었습니다." }); + else if (pass > 0) + { + Dao.Save("cm.lectcmisno.up", new System.Collections.Hashtable() { { "cmisno", cmisno }, { "lectno", lectno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } }); return JsonBack(new JsonRtn() { code = 1, msg = "일정을 변경하였습니다." }); } return JsonBack(new JsonRtn() { code = -1, msg = "개발자에게 문의하세요." }); diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index a9b352b..7e483b1 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1883,6 +1883,7 @@ and a.cmno=#cmno# and a.studyplace=#studyplace# + + + + @*교육목적*@ @*등급*@ @*직무분야*@ + @*전문분야*@ @*pplno*@ @*교육일정선택(selMonth)*@ @*업체/개인 선택*@ - - + +
@Html.HiddenFor(m => m.payno) @@ -25,12 +26,13 @@ @*교육목적*@ @*등급*@ @*직무분야*@ + @*직무분야*@ @*업체/개인 선택*@ - - + +

신청강좌

  • @@ -175,7 +177,7 @@ }); function save() { - + if ($("#becmisno").val() == '') { return;} var isCompanyInfo = true; $.each(model.pplog, function (key, value) { if (!value && key != "address2") { @@ -198,10 +200,26 @@ } else if ($("#isbill").val() == 1 && $("#taxdatereq").val() == "") { msg("계산서날짜를 입력해주세요."); }else { - cap("/fcommon/paystart", "mform", "cbsave"); + capp("/focommon/CheckQtyScd", { cmisno: $("#becmisno").val()}, "CheckQtyScdResult"); } } + + /*20220803 수강인원체크*/ + function CheckQtyScdResult() { + if (capResult.code == 1000) { + cap("/fcommon/paystart", "mform", "cbsave"); + } + else if (capResult.code == 0) { + $("#historyForm").attr("action", "/Course/SmartSearch"); + $("#historyForm").submit(); + } + else { + msgadmin(); + } + } + function cbsave() { + return; if (capResult.code == 1000) { if (capResult.obj == 0) { var resultmsg = capResult.msg; diff --git a/FO/Views/Course/SmartSearch.cshtml b/FO/Views/Course/SmartSearch.cshtml index f8f5326..c819570 100644 --- a/FO/Views/Course/SmartSearch.cshtml +++ b/FO/Views/Course/SmartSearch.cshtml @@ -1,6 +1,6 @@ @model NP.Model.VMCourse
    -
  • - +
    @d.intval-@(d.intval2)기 @(d.intval3 == 0 ? "온라인" : d.intval3 == 1 ? "교육장" : "온라인") @@ -113,59 +113,84 @@
} -
- +
+
신청중인 과정 (신청되어 있는 과정이며 입금완료 시 수강 중인 과정으로 이동합니다.)
더보기

온라인교육은 입금완료 시 바로 동영상 강의 시청이 가능합니다.

※ 교육신청 취소는 신청과정 메뉴에서 가능 합니다.

-
+ @*@if (Model.Datas.Where(w=>w.dtype == 1).Count() < 1 && Model.CMs.Count() > 0) + { + foreach (var d in Model.CMs) + { +
  • + +
    + @(d.tyear)-@(d.tseq)기 + @(d.cshape == 0 ? "ON" : d.cshape == 1 ? "OFF" : "혼합") + @Html.Raw(d.isrefund == 1 ? "환급" : "") + @d.cname +
    +
    +
    추천강좌
    +
    신청기간 : @d.rstime.Value.ToString("yy/MM/dd") ~ @d.retime.Value.ToString("yy/MM/dd")
    +
    +
    +
  • + } + }*@ + + @if (Model.Datas.Where(w => w.dtype == 1).Count() < 1) + { +
    신청중인 강좌가 없습니다.
    + } +
    @@ -179,7 +204,7 @@ {
  • - +
    @d.strval (@(d.intval3)반)
    @string.Format((d.intval < 3 ? "출석마감일이" : d.intval == 3 ? "진행평가마감일이" : d.intval == 4 ? "최종평가마감일이" : d.intval == 5 ? "과제마감일이" : d.intval == 6 ? "토론마감일이" : d.intval == 7 ? "강의평가마감일이" : d.intval == 8 ? "교육일이" : d.intval == 9 ? "시험일이" : "") + " {0}일 남았습니다.", d.intval2)

    (@d.time.ToString("MM/dd HH:mm"))

    diff --git a/FO/Views/My/Lecture.cshtml b/FO/Views/My/Lecture.cshtml index 73852b6..d794055 100644 --- a/FO/Views/My/Lecture.cshtml +++ b/FO/Views/My/Lecture.cshtml @@ -45,12 +45,19 @@ -@foreach (var d in Model.Lects.Where(w=>w.rno == 1)) +@foreach (var d in Model.Lects.Where(w => w.rno == 1)) {
    - w.payno == d.payno && w.userno==ViewBag.SSUserNo).First().lectno, d.cmno) : "#")" class="gocroom"> + @{ + string strComplete = string.Format(" data-cshape={0} ", d.cshape); + if (d.iscomplete != 1 && d.edate < DateTime.Now) + { + strComplete = string.Format(" data-cshape={0} data-complete=0 ", d.cshape); + } + } + w.payno == d.payno && w.userno==ViewBag.SSUserNo).First().lectno, d.cmno) : "#")" @strComplete class="gocroom">
    @if(d.cshape == 1) { @@ -90,11 +97,11 @@ @if (d.cshape == 1) { - - + - } else if (Model.Lects.Where(w => w.payno == d.payno && w.userno == ViewBag.SSUserNo).Count() > 0) { - 입장 + 입장 } else { @@ -234,7 +241,7 @@ setScd(cmno); } function setScd(cmno) { - capp("/focommon/GetScdForMixEdu", { cmno: cmno, lectno: vLectno }, "renderScd"); + capp("/focommon/GetScdForMixEdu", { cmno: cmno, lectno: vLectno}, "renderScd"); } function renderScd() { var ulScd = $("#ulScd"); diff --git a/FO/js/mypage.js b/FO/js/mypage.js index f8510fc..8ec4efd 100644 --- a/FO/js/mypage.js +++ b/FO/js/mypage.js @@ -58,12 +58,41 @@ $(document).ready(function () { $('html, body').removeClass('lock'); }); + //2022083 교육유형별로 처리 $(".gocroom").on("click", function () { - var href = $(this).data("href") || this.href; - if (href != undefined && href != null && href.toLowerCase().indexOf("croom/index?croomlectno=") != -1) { - msg("강의장으로 입장합니다.", null, null, null, "location.href='" + href + "'"); + var href = $(this).data("href") || this.href; + var complete = $(this).data("complete"); + + if (complete != undefined && complete == 0) + { + msg("해당 과정은 미 수료 상태 입니다." + + "교육일정변경 메뉴에서 교육일정을 변경 해주세요." + + "※ 미 수료 상태로 교육시작일 이후 1년 경과 시 교육이 취소되어 일정변경이 불가합니다." + + "※ 확인 클릭 시 교육일정변경 메뉴로 이동합니다." + ); return false; - } - return true; + } + if (href != undefined && href != null && href.toLowerCase().indexOf("croom/index?croomlectno=") != -1) { + var cshape = $(this).data("cshape"); + if (cshape != undefined && cshape == 1) { + msg("해당 과정은 교육장에 직접 오셔서 수강하는 과정 입니다." + + "교육기간을 확인하시고 시작일에 해당 교육장으로 입교 부탁 드립니다."); + return false; + } + else if (cshape != undefined && cshape == 2) { + msg("강의장으로 입장합니다.", null, null, null, "location.href='" + href + "'"); + return false; + } + } + return true; }); + + //$(".gocroom").on("click", function () { + // var href = $(this).data("href") || this.href; + // if (href != undefined && href != null && href.toLowerCase().indexOf("croom/index?croomlectno=") != -1) { + // msg("강의장으로 입장합니다.", null, null, null, "location.href='" + href + "'"); + // return false; + // } + // return true; + //}); }); \ No newline at end of file