From 0acf77ee5408dc75364a7849790c62df2a94407f Mon Sep 17 00:00:00 2001 From: hyunho Date: Mon, 9 Nov 2020 04:29:54 +0000 Subject: [PATCH] --- Base/Controller/FCommon.cs | 2 +- Base/Controller/FOCommon.cs | 7 +++++++ Dao/MyBatis/Maps/CM.xml | 7 +++++++ FO/Views/Course/SmartSearch.cshtml | 19 +++++++++++++++++-- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Base/Controller/FCommon.cs b/Base/Controller/FCommon.cs index 43dd4b4..358bf3a 100644 --- a/Base/Controller/FCommon.cs +++ b/Base/Controller/FCommon.cs @@ -251,7 +251,7 @@ namespace NP.Base.Controllers [HttpPost] public JsonResult savePPLog(VMCourse vm) { - int rtn = 0; + int rtn = 0; PPLog ppllog = new PPLog(); ppllog.uno = SUserInfo.UserNo; ppllog.uip = GetUserIP(); diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index daa6c16..6bfbe01 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -393,6 +393,13 @@ namespace NP.Base.Controllers return JsonBack(result); } + [HttpPost] + public JsonResult GetCheckLectIsComplete(int cmno) + { + var result = Dao.Get("cm.lectcheckuser", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo },{ "cmno", cmno } }).First(); + return JsonBack(result); + } + } } \ No newline at end of file diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index c84346b..4ea4964 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1881,5 +1881,12 @@ ,isassignuser = #isassignuser# where userno=#userno# + \ No newline at end of file diff --git a/FO/Views/Course/SmartSearch.cshtml b/FO/Views/Course/SmartSearch.cshtml index d5ecd37..6d4de4a 100644 --- a/FO/Views/Course/SmartSearch.cshtml +++ b/FO/Views/Course/SmartSearch.cshtml @@ -284,12 +284,27 @@ function applyClass(cmno) { if (@ViewBag.SSUserNo > 0) { - $("#cmno").val(cmno); - $("#smartSearchForm").attr("action", "/Course/ApplyEdu").submit(); + checkLectIsComplete(cmno); } else { alert("로그인 후 신청 할 수 있습니다."); return; } } + + function checkLectIsComplete(cmno) { + _cmno = cmno; + capp("/focommon/GetCheckLectIsComplete", { cmno: cmno }, "check"); + } + function check() { + var cnt = capResult.obj; + if (cnt > 0) { + alert("이미 수강/수료한 과정입니다."); + return; + } + else { + $("#cmno").val(_cmno); + $("#smartSearchForm").attr("action", "/Course/ApplyEdu").submit(); + } + }