diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 9939e40..88b51f4 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -383,10 +383,12 @@ namespace NP.Base.Controllers [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 } }); + var result = Dao.Get("cm.cminningscds.applyedu", new System.Collections.Hashtable() { { "cmno", cmno }, { "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")); + if (item.estart < DateTime.Now) + item.isEnd = true; } return JsonBack(result); @@ -399,6 +401,21 @@ namespace NP.Base.Controllers return JsonBack(result); } + [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 = "개발자에게 문의하세요." }); + } + + } } \ No newline at end of file diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index f14e92d..d6a58df 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1788,24 +1788,27 @@ and a.studyplace=#studyplace# + + + update lect set + ,cmisno =case when #cmisno# is not null then #cmisno# else cmisno end + where lectno=#lectno# + \ No newline at end of file diff --git a/Dao/MyBatis/Maps/Lect.xml b/Dao/MyBatis/Maps/Lect.xml index 0767676..adb12f4 100644 --- a/Dao/MyBatis/Maps/Lect.xml +++ b/Dao/MyBatis/Maps/Lect.xml @@ -34,7 +34,7 @@ ,cg.cgname ,pcg.cgcode pcgcode ,c.tyear,c.tseq - ,u.username + ,u.username,u.uduty ,case when uc.cname = '기타' then u.ccpositionetc else uc.cname end ccpositionname ,ua.asname ,row_number() over(order by $orderby$a.cdt desc) rno diff --git a/FO/Views/Course/ApplyEdu.cshtml b/FO/Views/Course/ApplyEdu.cshtml index 564e5a8..cb88956 100644 --- a/FO/Views/Course/ApplyEdu.cshtml +++ b/FO/Views/Course/ApplyEdu.cshtml @@ -337,29 +337,28 @@ function renderScd() { var ulScd = $("#ulScd"); ulScd.empty(); - var cnt = 0; + var seq = 0; $.each(capResult.obj, function (i, d) { var li = $("
  • "); - if (d.remainPeople <= 0) + if (d.isEnd == true) { - if (cnt == 0) { - li.append(" " + d.scdInfoSummary + ""); - } - else { - li.append(" " + d.scdInfoSummary + ""); - } + li.append(" " + d.scdInfoSummary + ""); } else { - if (cnt == 0) { - li.append(" " + d.scdInfoSummary + ""); + if (d.remainPeople <= 0) { + li.append(" " + d.scdInfoSummary + ""); } - else - { - li.append(" " + d.scdInfoSummary + ""); + else { + if (seq == 0) { + li.append(" " + d.scdInfoSummary + ""); + } + else { + li.append(" " + d.scdInfoSummary + ""); + } } } - cnt++; + seq++; ulScd.append(li); }); } diff --git a/FO/Views/My/Lecture.cshtml b/FO/Views/My/Lecture.cshtml index fbd2fe1..d363e3b 100644 --- a/FO/Views/My/Lecture.cshtml +++ b/FO/Views/My/Lecture.cshtml @@ -61,12 +61,12 @@ } - @if (d.cshape == 2 && d.estart > Convert.ToDateTime("1900-01-01") && d.eend > Convert.ToDateTime("1900-01-01")) + @if (d.cshape == 2 && d.estart > Convert.ToDateTime("1900-01-01") && d.eend > Convert.ToDateTime("1900-01-01") && d.iscomplete != 1 && Convert.ToDateTime(d.estart) > DateTime.Now) {
        - +
    } @@ -146,18 +146,19 @@ @Html.HiddenFor(m => m.intval) @Html.HiddenFor(m => m.stringval) -
  • "); + if (d.isEnd == true) { + li.append(" " + d.scdInfoSummary + ""); + } + else { + if (d.remainPeople <= 0) { + li.append(" " + d.scdInfoSummary + ""); + } + else { + if (seq == 0) { + li.append(" " + d.scdInfoSummary + ""); + } + else { + li.append(" " + d.scdInfoSummary + ""); + } + } + } + seq++; + ulScd.append(li); + }); + } + + function selectScd() { + if (confirm("일정을 변경하시겠습니까?")) { + var cmisno = $("input:radio[name=rdoScds]:checked").val(); + var lectno = vLectno; + if (cmisno == "" || cmisno == undefined || cmisno == null) { + alert("선택한 일정이 없습니다."); + return; + } + capp("/focommon/UpdateScd", { cmisno: cmisno, lectno: lectno }, "scdSave"); + } + } + function scdSave() { + alert(capResult.msg); + if (capResult.code == 1) { + submit(); + } + else { + return; + } + } + } \ No newline at end of file diff --git a/FO/Views/Shared/Partial/Cert1.cshtml b/FO/Views/Shared/Partial/Cert1.cshtml index b2f565f..9510e0b 100644 --- a/FO/Views/Shared/Partial/Cert1.cshtml +++ b/FO/Views/Shared/Partial/Cert1.cshtml @@ -10,7 +10,7 @@ {
  • 속 : @Model.Lect.asname
  • } -
  • 위 : @(string.IsNullOrEmpty(Model.Lect.ccpositionname)?"-":Model.Lect.ccpositionname )
  • +
  • 위 : @Model.Lect.uduty
  • 명 : @Model.Lect.username
  • diff --git a/Model/CM.cs b/Model/CM.cs index 089ccba..3f99a9c 100644 --- a/Model/CM.cs +++ b/Model/CM.cs @@ -1036,8 +1036,18 @@ namespace NP.Model } } public int isacceptemail { get; set; } + /// + /// 교육일정시작일 + /// public DateTime estart { get; set; } + /// + /// 교육일정종료일 + /// public DateTime eend { get; set; } + /// + /// 직위 + /// + public String uduty { get; set; } } /// /// 자격검정시험 @@ -3275,6 +3285,15 @@ namespace NP.Model /// 내용요약 /// public String scdInfoSummary { get; set; } + /// + /// 등록가능인원수 + /// public int remainPeople { get; set; } + /// + /// 교육일자종료여부 + /// + public bool isEnd { get; set; } + public int? termend { get; set; } + public int? peopleend { get; set; } } }