From 1a8a7d52c68b88147b621826c40320f8181bf86a Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 22 Jan 2021 06:06:01 +0000 Subject: [PATCH] --- Dao/MyBatis/Maps/CRoom.xml | 7 ++++++- Dao/MyBatis/Maps/Lect.xml | 14 ++++++++++---- FO/Controllers/MyController.cs | 2 +- FO/Views/CRoom/Index.cshtml | 11 +++++++++-- FO/Views/My/Lecture.cshtml | 4 ++-- Model/CM.cs | 13 +++++++++++++ 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index c096da8..e1ee680 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -160,8 +160,11 @@ select a.lectno,a.cmno,a.userno,a.isrebate,a.iscomplete + ,case when a.sdate is null then b.sstime else a.sdate end as sdate + ,case when a.edate is null then b.setime else a.edate end as edate ,b.cmno,b.cname,b.cshape - ,b.sstime,b.setime - ,b.classno,b.isrefund ,c.tyear,c.tseq ,e.isgroup,e.payno @@ -1203,6 +1205,8 @@ and b.cshape=#cshape# union all select a.lectno,a.cmno,a.userno,a.isrebate,a.iscomplete + ,case when a.sdate is null then b.sstime else a.sdate end as sdate + ,case when a.edate is null then b.setime else a.edate end as edate ,b.cmno,b.cname,b.cshape,b.sstime,b.setime,b.classno,b.isrefund ,c.tyear,c.tseq ,e.isgroup,e.payno @@ -1222,6 +1226,8 @@ and b.cshape=#cshape# union all select a.lectno,a.cmno,a.userno,a.isrebate,a.iscomplete + ,case when a.sdate is null then b.sstime else a.sdate end as sdate + ,case when a.edate is null then b.setime else a.edate end as edate ,b.cmno,b.cname,b.cshape,b.sstime,b.setime,b.classno,b.isrefund ,c.tyear,c.tseq ,e.isgroup,e.payno diff --git a/FO/Controllers/MyController.cs b/FO/Controllers/MyController.cs index a3a818a..852353c 100644 --- a/FO/Controllers/MyController.cs +++ b/FO/Controllers/MyController.cs @@ -155,7 +155,7 @@ namespace NP.FO.Controllers public ActionResult Lecture(VMMy vm) { ViewBag.reporturl = GetConfig("reporturl"); - vm.Lects = Dao.Get("lect.mylectures", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "cgcode", vm.intval > 0 ? TestCode3 : null }, { "cshape", vm.stringval } }); + vm.Lects = Dao.Get("lect.mylectures", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "cgcode", vm.intval > 0 ? TestCode3 : null }, { "cshape", vm.stringval } }).Where(x=>x.edate >= DateTime.Now).ToList(); return View(vm); } public ActionResult CertPrint(VMMy vm) diff --git a/FO/Views/CRoom/Index.cshtml b/FO/Views/CRoom/Index.cshtml index 5f887e5..da7a28d 100644 --- a/FO/Views/CRoom/Index.cshtml +++ b/FO/Views/CRoom/Index.cshtml @@ -106,10 +106,17 @@
[@(d.iseq)회] @d.ititle
@(d.isonline == 0 && d.istatus == 2 ? "출석완료" : d.isonline == 0 && d.idate < DateTime.Now ? "결석" : d.isonline == 0 ? "출석전" : d.stime == null ? "학습전(0%)" : d.istatus == 2 ? "학습완료" : string.Format("학습중({0}%)", d.sttime > 0 ? (d.totstudy * 100 / (d.sttime * 60)) : 0))
-
@(d.isonline == 0 ? "강의시작일" : "강의기간") : @(d.isonline == 0 ? string.Format("{0} {1}:{2}", d.idate.ToString("MM/dd"), d.ist.Substring(0, 2), d.ist.Substring(2, 2)) : (d.sstime.ToString("MM/dd") + " ~ " + d.setime.ToString("MM/dd")))
+
@(d.isonline == 0 ? (d.cshape !=2 ? "강의시작일" : "집체교육") : "강의기간") : @(d.isonline == 0 ? (d.cshape != 2 ? string.Format("{0} {1}:{2}", d.idate.ToString("MM/dd"), d.ist.Substring(0, 2), d.ist.Substring(2, 2)) : d.eend.ToString("MM/dd")) : (d.sdate.ToString("MM/dd") + " ~ " + d.edate.ToString("MM/dd")))
@if (d.isonline == 0) { -
강의실 : @(d.icontent??"-")
+ if (d.cshape != 2) + { +
강의실 : @(d.icontent ?? "-")
+ } + else + { +
장소 : @(d.cname ?? "-")
+ } }
diff --git a/FO/Views/My/Lecture.cshtml b/FO/Views/My/Lecture.cshtml index defb465..d40e31e 100644 --- a/FO/Views/My/Lecture.cshtml +++ b/FO/Views/My/Lecture.cshtml @@ -52,9 +52,9 @@ @d.cname (@(d.classno))
-
@(d.setime > DateTime.Now ? "수강기간 학습중" : "종료")
+
@(d.edate > DateTime.Now ? "수강기간 학습중" : "종료")
- 수강기간 : @d.sstime.Value.ToString("yy-MM-dd") ~ @d.setime.Value.ToString("yy-MM-dd") + 수강기간 : @d.sdate.Value.ToString("yy-MM-dd") ~ @d.edate.Value.ToString("yy-MM-dd") @if (d.cshape == 2 && d.estart > Convert.ToDateTime("1900-01-01") && d.eend > Convert.ToDateTime("1900-01-01")) { @:| 집체교육기간 : @("[" + d.studyplacename + "] " + string.Format("{0}", d.estart.ToString("yy-MM-dd"))) diff --git a/Model/CM.cs b/Model/CM.cs index 764de67..6c2dcb7 100644 --- a/Model/CM.cs +++ b/Model/CM.cs @@ -1024,6 +1024,14 @@ namespace NP.Model public DateTime? etime { get; set; } public DateTime? sdate { get; set; } public DateTime? edate { get; set; } + public String sdateymd + { + get { return sdate != null ? Convert.ToDateTime(sdate).ToShortDateString() : null; } + } + public String edateymd + { + get { return edate != null ? Convert.ToDateTime(edate).ToShortDateString() : null; } + } public String sip { get; set; } public String eip { get; set; } public int ispaied { get; set; } @@ -2890,6 +2898,10 @@ namespace NP.Model public int isrebate { get; set; } public DateTime sstime { get; set; } public DateTime setime { get; set; } + public DateTime sdate { get; set; } + public DateTime edate { get; set; } + public DateTime estart { get; set; } + public DateTime eend { get; set; } public int isseq { get; set; } public int preistatus { get; set; } public Int64 precmino { get; set; } @@ -2898,6 +2910,7 @@ namespace NP.Model /// lect회차 존재여부 /// public String existslectinning { get; set; } + public String cname { get; set; } } [Serializable]