From 0e1de85fae5194792162b6e11d64d7be54052af7 Mon Sep 17 00:00:00 2001 From: hyunho Date: Thu, 28 Jan 2021 08:16:49 +0000 Subject: [PATCH] --- Base/Controller/FCommonCRoom.cs | 14 +++++++++++++ Dao/MyBatis/Maps/CRoom.xml | 2 +- Dao/MyBatis/Maps/Grade.xml | 14 ++++++++++++- FO/Views/CRoom/Grade.cshtml | 35 +++++++++++++++++++++++++-------- Model/CM.cs | 1 + 5 files changed, 56 insertions(+), 10 deletions(-) diff --git a/Base/Controller/FCommonCRoom.cs b/Base/Controller/FCommonCRoom.cs index cc7aeba..6ec05de 100644 --- a/Base/Controller/FCommonCRoom.cs +++ b/Base/Controller/FCommonCRoom.cs @@ -182,6 +182,20 @@ namespace NP.Base.Controllers } } } + [HttpPost] + public JsonResult LectComplete(Int64 lectno) + { + var ispass = Dao.Get("grade.ispass", new Hashtable() { { "lectno", lectno } } ).FirstOrDefault().ispass; + if (ispass == 1) + { + return JsonOK(Dao.Save("grade.lectcomplete2", new Hashtable() { { "lectno", lectno }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); + } + else + { + return JsonBack(new JsonRtn() { code = 1, msg = "수료조건이 충족되지 않았습니다. 수료조건을 충족한 이후 요청해주세요" }); + } + } + } diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index c769d19..6e7d873 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -13,7 +13,7 @@ + + diff --git a/FO/Views/CRoom/Grade.cshtml b/FO/Views/CRoom/Grade.cshtml index fedaa78..f0a9123 100644 --- a/FO/Views/CRoom/Grade.cshtml +++ b/FO/Views/CRoom/Grade.cshtml @@ -2,7 +2,11 @@ @{ } -

수료여부 : @(Model.Lect.iscomplete == null ? "처리중" : Model.Lect.iscompletename)

+ +

+ 수료여부 : @(Model.Lect.iscomplete == null || Model.Lect.iscomplete == 0 ? "미수료" : "수료") + @(Model.Lect.iscomplete == null || Model.Lect.iscomplete == 0 ? "(나의성적이 수료기준을 충족하였을 경우 아래 수료요청 버튼을 클릭해주세요)" : "") +

@@ -36,22 +40,21 @@ -@if (Model.Lect.iscomplete == null) -{ - -} -else -{ -}
나의성적공개전@(Model.Lect.attrate)%(@(Model.Lect.attrate)점) @(Model.Lect.ex0lectpoint)점 @(Model.Lect.ex1lectpoint)점 @(Model.Lect.sd0lectpoint)점 @(Model.Lect.sd1lectpoint)점 @(Model.Lect.apoint + Model.Lect.mpoint + Model.Lect.fpoint + Model.Lect.spoint + Model.Lect.dpoint)점
+ @if (Model.Lect.iscomplete == null || Model.Lect.iscomplete == 0) + { + + } @section styles{ } @@ -64,5 +67,21 @@ else }); + function save() { + if (confirm("수료 요청하시겠습니까?")) { + capp("/fcommon/lectcomplete", { lectno: @Model.Lect.lectno}, "cbsave"); + } + } + function cbsave() { + if (capResult.code == 1000) { + msg("수료 처리했습니다.", 0, null, null, "reload()"); + } else { + msg(capResult.msg); + return; + } + } + function reload() { + window.location.reload(); + } } \ No newline at end of file diff --git a/Model/CM.cs b/Model/CM.cs index 77ab34e..39e6a53 100644 --- a/Model/CM.cs +++ b/Model/CM.cs @@ -1168,6 +1168,7 @@ namespace NP.Model } public String pgkey { get; set; } public String itemname { get; set; } + public int? ispass { get; set; } } /// /// 자격검정시험