From 36ccc916501e0811101df993adb67593dc425c07 Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 10 Dec 2020 06:19:50 +0000 Subject: [PATCH] --- Base/Controller/FOCommon.cs | 35 +++++++++ Dao/MyBatis/Maps/CM.xml | 6 +- FO/Controllers/CourseController.cs | 9 +-- FO/Views/Course/OffList.cshtml | 116 +++++++++++++++++++---------- FO/Views/Course/Offs.cshtml | 34 +++++++-- FO/Views/Course/SmartSearch.cshtml | 4 +- Model/CM.cs | 4 + Model/VMCourse.cs | 1 + 8 files changed, 150 insertions(+), 59 deletions(-) diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 26dbff5..b515aaf 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -378,7 +378,42 @@ namespace NP.Base.Controllers [HttpPost] public JsonResult GetCmUser(int cmno) { + var comcodes = GetComCodes("typeman,typeedu,typegrade,typejob", true); var result = Dao.Get("cm.cmuser", new System.Collections.Hashtable() { { "cmno", cmno } }); + foreach (var r in result) + { + string[] typemanArr = r.typeman.Split(','); + for (int i = 0; i < typemanArr.Length; i++) + { + r.typemans += comcodes.Where(x => x.cgroup == "typeman" && x.ccode == Convert.ToInt32(typemanArr[i])).FirstOrDefault().cname; + if (i < typemanArr.Length -1) + r.typemans += ","; + } + + string[] typeeduArr = r.typeedu.Split(','); + for (int i = 0; i < typeeduArr.Length; i++) + { + r.typeedus += comcodes.Where(x => x.cgroup == "typeedu" && x.ccode == Convert.ToInt32(typeeduArr[i])).FirstOrDefault().cname; + if (i < typeeduArr.Length - 1) + r.typeedus += ","; + } + + string[] typegradeArr = r.typegrade.Split(','); + for (int i = 0; i < typegradeArr.Length; i++) + { + r.typegrades += comcodes.Where(x => x.cgroup == "typegrade" && x.ccode == Convert.ToInt32(typegradeArr[i])).FirstOrDefault().cname; + if (i < typegradeArr.Length - 1) + r.typegrades += ","; + } + + string[] typejobArr = r.typejob.Split(','); + for (int i = 0; i < typejobArr.Length; i++) + { + r.typejobs += comcodes.Where(x => x.cgroup == "typejob" && x.ccode == Convert.ToInt32(typejobArr[i])).FirstOrDefault().cname; + if (i < typejobArr.Length - 1) + r.typejobs += ","; + } + } return JsonBack(result); } diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index 69fca83..ea0b57e 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1923,13 +1923,9 @@ ,a.isrefund,a.isuse,a.isseq,a.isdel,a.fgnocm,a.iscertificate,a.ischkatt ,(select count(l.lectno) cnt from lect l where l.cmno = a.cmno and l.status =1 and l.ischanged=0) lectcnt from cm a - inner join cminning b on a.cmno = b.cmno - where a.ismaster=0 and a.isuse=1 and a.isdel=0 and a.cshape in ('1','2') + where a.ismaster=0 and a.isuse=1 and a.isdel=0 and a.cshape = 1 and a.cmno=#cmno# and year(a.sstime)=#year# - and month(a.sstime)=#month# - and a.cname like concat('%', #cnamelike#,'%') - and a.studyplace=#studyplace# order by a.sstime,a.setime diff --git a/FO/Controllers/CourseController.cs b/FO/Controllers/CourseController.cs index 8313256..f38fb68 100644 --- a/FO/Controllers/CourseController.cs +++ b/FO/Controllers/CourseController.cs @@ -269,14 +269,9 @@ namespace NP.FO.Controllers } public ActionResult Offs(VMCourse vm) { - //vm.pcgcode = vm.pcgcode ?? OffCode; - //vm.CMs = Dao.Get("cm.cms.forbuy", new System.Collections.Hashtable() { { "pcgcode", vm.pcgcode }, { "cgcode", vm.cgcode }, { "userno", SUserInfo.UserNo }, { "year", DateTime.Now.Year }, { "contents", vm.Contents } }); - vm.CMs = Dao.Get("cm.cms.offs", new System.Collections.Hashtable() {{ "year", DateTime.Now.Year }, { "month", vm.stringval }, { "cnamelike", vm.stringval2 } }); - vm.ComCodes = GetComCodes("studyplace", true); + //오프라인교육만 + vm.CMs = Dao.Get("cm.cms.offs", new System.Collections.Hashtable() {{ "year", DateTime.Now.Year } }); vm.viewname = vm.viewname ?? "OffList"; - vm.viewname2 = vm.viewname2 ?? "OffSearch"; - vm.viewname3 = ""; - vm.previewname = "/Course/Offs?cname=" + (vm.cname ?? ""); return View("Offs", vm); } public ActionResult OffDetail(VMCourse vm) diff --git a/FO/Views/Course/OffList.cshtml b/FO/Views/Course/OffList.cshtml index 1102361..bdd2931 100644 --- a/FO/Views/Course/OffList.cshtml +++ b/FO/Views/Course/OffList.cshtml @@ -2,13 +2,11 @@ @{ Layout = null; } - +
  • 1월
  • @@ -27,30 +25,23 @@
-
    -
  • 전체
  • - @foreach (var t in Model.ComCodes.Where(w => w.cgroup.ToString() == "studyplace")) - { -
  • @t.cname 교육장
  • - } -
올해일정 조회
@foreach (var m in Model.CMs.Select(s => s.sstime.Value.Month).Distinct()) { -
+
@(m)월 교육일정
@foreach (var d in Model.CMs.Where(w => w.sstime.Value.Month == m)) {
  • -

    +

    @string.Format("{0}({1})", d.sstime.Value.Day, d.sstime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR"))) ~ @string.Format("{0}({1})", d.setime.Value.Day, d.setime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR")))

    -
    +
    @if (d.cshape == 1) { [교육장교육] @@ -59,7 +50,7 @@ { [혼합교육] } - @d.cname + @d.cname
    @if (DateTime.Now >= d.rstime.Value && DateTime.Now < d.retime.Value) @@ -80,21 +71,49 @@ }
- @* - @string.Format("{0}({1})", d.sstime.Value.Day, d.sstime.Value.ToString("ddd", System.Globalization.CultureInfo.CreateSpecificCulture("ko-KR"))) - - -

환급[@d.cgname] @(d.cname)(@(d.studyplacename)) (@(d.studytime)시간)

-

회원 : @d.infee.ToString("#,0")원 비회원 : @d.outfee.ToString("#,0")원

-
- - *@ }
} -
- @Html.HiddenFor(m => m.cshape) - @Html.HiddenFor(m => m.previewname) + + + + @Html.HiddenFor(m => m.cmno)
@@ -131,15 +150,34 @@ $(".offDesc").find("a").attr("class", "current"); } } - function gothis(cshape) { - setv("cgcode", cgcode); - $("#thisform").submit(); + + function openIntro(cmno) { + $("#divIntro").show(); + capp("/focommon/getcmuser", { cmno: cmno }, "renderCm"); } - function godetail(cmno) { - if (cmno > 0) { - setv("cmno", cmno); - $("#thisform").attr("action", "/Course/OffDetail"); - submit("thisform"); - } + function renderCm() { + //var cmkind; + //cmkind = typeman + " | " + typeedu + " | " + typegrade + " | " + typejob; + //if ($("#stringval").val() == "1") { + // cmkind = $("#stringval3").find("option:selected").text(); + //} + + $.each(capResult.obj, function (i, d) { + $("#spnCmTitle").text(d.text); + $("#spnTypeMan").text(d.typemans); + $("#spnTypeEdu").text(d.typeedus); + $("#spnTypeGrade").text(d.typegrades); + $("#spnTypeJob").text(d.typejobs); + $("#spnCmStudyHour").text(d.studytime); + $("#spnCmAttend").text(d.attendcut); + $("#spnCmFinal").text(d.finalcut); + $("#spnCmUsername").text(d.username); + if (d.introhtml != null && d.introhtml != "" && d.introhtml != undefined) { + $("#spnCmIntroHtml").text(d.introhtml.replace(/(<([^>]+)>)/ig, "")); + } + }); + } + function closeIntro() { + $("#divIntro").hide(); } \ No newline at end of file diff --git a/FO/Views/Course/Offs.cshtml b/FO/Views/Course/Offs.cshtml index 6031fe1..cca7582 100644 --- a/FO/Views/Course/Offs.cshtml +++ b/FO/Views/Course/Offs.cshtml @@ -2,15 +2,28 @@ @{ } -
+ +@*
- - - + +
-
+
*@ @Html.Partial(Model.viewname, Model) @section scriptsHeader{ @@ -18,12 +31,19 @@ @section scripts{