diff --git a/BO/Controllers/cmController.cs b/BO/Controllers/cmController.cs index 6c828ad..3b63c76 100644 --- a/BO/Controllers/cmController.cs +++ b/BO/Controllers/cmController.cs @@ -255,10 +255,19 @@ namespace NP.BO.Controllers public ActionResult cmregeduschedule(VMCM vm) { - vm.CM = Dao.Get("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.intval } }).First(); - vm.CMMenus = Dao.Get("cm.cmmenus", vm.CM.cmno); - vm.CMMenu = vm.CMMenus.First(); - vm.BoardMasters = Dao.Get("board.bms", new System.Collections.Hashtable() { { "bmposition", 1 }, { "isopen", 1 }, { "orderby", "a.cdt" } }); + vm.CM = Dao.Get("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.intval } }).FirstOrDefault(); + if (vm.CM == null) + { + return Redirect("/"); + } + vm.CMInnings = Dao.Get("cm.cminnings", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno }, { "isonline", 0 } }); + if (vm.CMInnings.Count > 0) + { + vm.CMInningscds = Dao.Get("cm.cminningscds", new System.Collections.Hashtable() { { "cmno", vm.CMInnings[0].cmino } }); + } + vm.ComCodes = GetComCodes("studyplace"); + vm.CMPRs = Dao.Get("cm.cmprs", new System.Collections.Hashtable() { { "cmno", vm.CM.cmno } }); + ViewBag.fronturl = GetConfig("fronturl"); return View("cmregeduschedule", vm); } diff --git a/BO/Views/cm/cmreg.cshtml b/BO/Views/cm/cmreg.cshtml index 55fe497..2e98c14 100644 --- a/BO/Views/cm/cmreg.cshtml +++ b/BO/Views/cm/cmreg.cshtml @@ -3,7 +3,7 @@
  • 기본정보
  • 회차설정
  • - @if (Model.CM.ismaster == 0) + @if (Model.CM.ismaster == 0 && Model.CM.cshape == 2) {
  • 교육일정
  • } diff --git a/BO/Views/cm/cmregeduschedule.cshtml b/BO/Views/cm/cmregeduschedule.cshtml index de5acee..80f9efd 100644 --- a/BO/Views/cm/cmregeduschedule.cshtml +++ b/BO/Views/cm/cmregeduschedule.cshtml @@ -1,407 +1,398 @@ @model NP.Model.VMCM -
    +
    -
    -
    -
    -
    -
    - -
    - @Html.Partial("./Partial/Select", Model.CGs.Where(w => w.pcgno == null), new ViewDataDictionary { { "special", "reg" }, { "name", "pcgno" }, { "selected", Model.CM.pcgno }, { "df", ":-상위분류" }, { "class", "disp-init" } }) - @Html.Partial("./Partial/Select", Model.CGs.Where(w => w.pcgno == Model.CM.pcgno), new ViewDataDictionary { { "special", "reg" }, { "name", "CM.cgno" }, { "selected", Model.CM.cgno }, { "df", ":-과정분류" }, { "class", "disp-init" } }) - @if (Model.CM.ismaster == 0) - { - - - - } -
    -
    - @if (Model.CM.ismaster == 0) - { -
    - -
    - - @Html.TextBoxFor(m => m.CM.cname, new { @class = "form-control disp-init ff", @style = "width: 50%", @maxlength = "100", @placeholder = Model.viewidxname + "명을 입력하세요." }) - -
    -
    -
    -
    - -
    - @Html.TextBoxFor(m => m.CM.kname, new { @class = "form-control disp-init ff", @style = "width: 60%", @maxlength = "100" })
    - -
    -
    -
    -
    - -
    @Html.Partial("./Partial/Date", Model.CM.rstime == null ? (DateTime?)null : Convert.ToDateTime(Model.CM.rstime), new ViewDataDictionary { { "name", "CM.rstime" } }) ~ @Html.Partial("./Partial/Date", Model.CM.retime == null ? (DateTime?)null : Convert.ToDateTime(Model.CM.retime), new ViewDataDictionary { { "name", "CM.retime" } })
    -
    -
    - -
    @Html.Partial("./Partial/Date", Model.CM.sstime == null ? (DateTime?)null : Convert.ToDateTime(Model.CM.sstime), new ViewDataDictionary { { "name", "CM.sstime" } }) ~ @Html.Partial("./Partial/Date", Model.CM.setime == null ? (DateTime?)null : Convert.ToDateTime(Model.CM.setime), new ViewDataDictionary { { "name", "CM.setime" } })
    -
    -
    - -
    @Html.Partial("./Partial/Date", Model.CM.gstime == null ? (DateTime?)null : Convert.ToDateTime(Model.CM.gstime), new ViewDataDictionary { { "name", "CM.gstime" } }) ~ @Html.Partial("./Partial/Date", Model.CM.getime == null ? (DateTime?)null : Convert.ToDateTime(Model.CM.getime), new ViewDataDictionary { { "name", "CM.getime" } })
    -
    - } - else - { -
    - -
    @Html.TextBoxFor(m => m.CM.cname, new { @class = "form-control disp-init ff", @style = "width: 50%", @maxlength = "100", @placeholder = Model.viewidxname + "명을 입력하세요." })
    -
    -
    -
    - -
    - @Html.TextBoxFor(m => m.CM.kname, new { @class = "form-control disp-init ff", @style = "width: 60%", @maxlength = "100" })
    - -
    -
    -
    - } -
    - -
    @Html.Partial("./Partial/Radio", Model.CM.cshape, new ViewDataDictionary() { { "valuetext", "0:온라인;1:오프라인;2:혼합(온라인+오프라인)" }, { "checked", Model.CM.cshape }, { "name", "CM.cshape" } })
    -
    - - -
    - -
    - 정회원 : @Html.TextBoxFor(m => m.CM.infee, new { @class = "form-control disp-init int text-right", @style = "width: 150px;", @maxlength = "12" }) -     비회원 : @Html.TextBoxFor(m => m.CM.outfee, new { @class = "form-control disp-init int text-right", @style = "width: 150px;", @maxlength = "12" }) -     정원 : @Html.TextBoxFor(m => m.CM.quota, new { @class = "form-control disp-init int text-right", @style = "width: 150px;", @maxlength = "6" }) -
    -
    -
    - -
    -
    - -
      - @foreach (var d in Model.Datas.Where(w => w.dtype == 1)) - { -
    • X
    • - } -
    -
    -
    -
    - -
    - -
      - @foreach (var d in Model.Datas.Where(w => w.dtype == 2)) - { -
    • X
    • - } -
    -
    -
    -
    - -
    @Html.TextAreaFor(m => m.CM.introhtml, new { @class = "form-control", @style = "resize: none; width: 90%; height: 80px; padding: 3px 5px;" })
    -
    -
    - -
    @Html.TextAreaFor(m => m.CM.targethtml, new { @class = "form-control", @style = "resize: none; width: 90%; height: 80px; padding: 3px 5px;" })
    -
    -
    - -
    @Html.TextAreaFor(m => m.CM.goalhtml, new { @class = "form-control", @style = "resize: none; width: 90%; height: 80px; padding: 3px 5px;" })
    -
    -
    - -
    @Html.TextAreaFor(m => m.CM.contenthtml, new { @class = "form-control", @style = "resize: none; width: 90%; height: 80px; padding: 3px 5px;" })
    -
    -
    - -
    - @*@Html.TextBoxFor(m => m.CM.studyplace, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "150", @placeholder = "" })*@ - @Html.Partial("./Partial/Radio", Model.ComCodes.Where(w => w.cgroup == "studyplace"), new ViewDataDictionary() { { "checked", Model.CM.studyplace }, { "name", "CM.studyplace" } }) - ※ 유형이 온라인일 경우 출력되지 않음 -
    -
    -
    - -
    - @Html.TextBoxFor(m => m.CM.studytime, new { @class = "form-control disp-init float text-center", @style = "width: 100px;", @maxlength = "5", @placeholder = "" }) - 시간 -
    -
    - @if (Model.CM.ismaster == 0) - { -
    - -
    @Html.Partial("./Partial/Radio", Model.CM.iscertificate, new ViewDataDictionary() { { "valuetext", "1:발행;0:미발행" }, { "checked", Model.CM.iscertificate }, { "name", "CM.iscertificate" } })
    -
    - } - else - { -
    -
    - -
    @Html.Partial("./Partial/Radio", Model.CM.iscertificate, new ViewDataDictionary() { { "valuetext", "1:발행;0:미발행" }, { "checked", Model.CM.iscertificate }, { "name", "CM.iscertificate" } })
    -
    -
    - } -
    - -
    - @Html.Partial("./Partial/File", Model.FileList.ToList(), new ViewDataDictionary { - { "name", "CM.fgnocm" },{"value", Model.CM.fgnocm },{ "fname", "fgnocm"}, - {"width", null },{"table", "cm" },{ "column", "fgnocm"},{"filecount", 100 }, - {"readmode", 0 },{"hidemode", 0 }, - { "isimage", 0 }, { "fileext", "" }}) -
    -
    -
    - -
    @Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:공개;0:비공개" }, { "checked", Model.CM.isuse }, { "name", "CM.isuse" } })
    -
    + +
    +
    기본설정
    +
    +
    + +
    -
    - @Html.HiddenFor(m => m.intval) - @Html.HiddenFor(m => m.CM.cmno) - @Html.HiddenFor(m => m.CM.pcmno) - @Html.HiddenFor(m => m.CM.ismaster) - @Html.HiddenFor(m => m.CM.usernos) - @Html.HiddenFor(m => m.CM.bknos) - @Html.HiddenFor(m => m.CM.cmnospre) - @Html.HiddenFor(m => m.CM.cmnosnext) - @Html.HiddenFor(m => m.CM.ncsnos) - -
    -
     
    -
    - 저장 - @if (Model.CM.cmno > 0) - { - 삭제 - } - 목록 -
    +
    +
    + + @Html.Partial("./Partial/Radio", Model.ComCodes.Where(w => w.cgroup == "studyplace"), new ViewDataDictionary() { { "checked", Model.CM.studyplace }, { "name", "CM.studyplace" }, { "isreadonly", 1 } }) +
    +
    + @Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:온라인;0:오프라인" }, { "checked", 0 }, { "name", "isonline" } }) +
    +
    + + +
    +
    교육회차등록
    +
    + + + + + + + + + + + + @foreach (var item in Model.CMInnings) + { + + + + + + + + } + +
    회차학습방식강의주제강사최근수정일
    @item.iseq @(item.istaste == 1 ? "(S)" : "")@item.isonlinename@item.username@item.udtymd
    +
    +
    + +
    +
    교육일정등록
    +
    + + + + + + + + + + + + @foreach (var item in Model.CMInningscds) + { + + + + + + + + } + +
    순서교육일정제한인원등록인원최근수정일
    @item.scdseq@item.quota@item.regmem@item.udt
    +
    +
    +
    @Html.Partial("./Partial/DForm", Model, new ViewDataDictionary { { "preform", 1 } })
    -@Html.Partial("./Partial/UserBox", "bindUser;강사/담당자 선택;999_1", new ViewDataDictionary { { "assigns", Model.Assigns }, { "userauths", Model.userauths } }) -@Html.Partial("./Partial/BookBox", "bindBook;교재선택 선택") -@Html.Partial("./Partial/CMBox", "bindCM;과정 선택;1") -@Html.Partial("./Partial/NCSBox", "bindNCS;NCS 세분류(직무) 선택;3") +
    +

    회차등록/수정닫기

    + + + + + + + + + + + + + + + + + + +
    강의주제@Html.TextBox("ititle", "", new { @class = "form-control", @style = "", @maxlength = "100" })
    교안 + + +
    +
    강사@Html.Partial("./Partial/Select", Model.CMPRs, new ViewDataDictionary { { "special", "reg" }, { "name", "userno" }, { "selected", "" }, { "df", ":-강사선택" }, { "class", "disp-init" } })
    회차(순서)@Html.TextBox("iseq", "", new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })
    +
    + 저장 + 삭제 +
    +

    +
    + +
    +

    일정등록/수정닫기

    + + + + + + + + + + +
    교육일정 + @Html.Partial("./Partial/Date", (DateTime?)null, new ViewDataDictionary { { "name", "idate" } }) + @Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "isth" }, { "start", 0 }, { "end", 23 }, { "textadd", "시" }, { "df", ":-시" }, { "class", "disp-init" }, { "style", "width: 80px;" } }) + @Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "istm" }, { "start", 0 }, { "end", 59 }, { "textadd", "분" }, { "df", ":-분" }, { "class", "disp-init" }, { "style", "width: 80px;" } }) + ~ + @Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "ieth" }, { "start", 0 }, { "end", 23 }, { "textadd", "시" }, { "df", ":-시" }, { "class", "disp-init" }, { "style", "width: 80px;" } }) + @Html.Partial("./Partial/Select", "", new ViewDataDictionary { { "special", "fromto" }, { "name", "ietm" }, { "start", 0 }, { "end", 59 }, { "textadd", "분" }, { "df", ":-분" }, { "class", "disp-init" }, { "style", "width: 80px;" } }) +
    제한인원@Html.TextBox("iquota", "", new { @class = "form-control disp-init int nocomma text-center", @style = "width: 80px;", @maxlength = "3" })
    +
    + 저장 + 삭제 +
    +

    +
    @section styles{ - @Html.Partial("./Partial/Summernotestyle") + } @section scriptsHeader{ @Html.Partial("./Partial/ScriptDate") - @Html.Partial("./Partial/Summernote") - @Html.Partial("./Partial/FileScript") } @section scripts{ - + } + } diff --git a/BO/Views/cm/cmregest.cshtml b/BO/Views/cm/cmregest.cshtml index 00f13c8..286516f 100644 --- a/BO/Views/cm/cmregest.cshtml +++ b/BO/Views/cm/cmregest.cshtml @@ -3,7 +3,7 @@
    • 기본정보
    • 회차설정
    • - @if (Model.CM.ismaster == 0) + @if (Model.CM.ismaster == 0 && Model.CM.cshape == 2) {
    • 교육일정
    • } @@ -201,11 +201,11 @@ function cbsave() { if (capResult.code == 1000) { msg("평가기준/비율을 저장했습니다.", null, true, null, true); - gotab(2, 500); + gotab(3, 500); } else { msgadmin(); } } function pagerefresh() { - gotab(2, 500); + gotab(3, 500); } function add(idx, no) { if (idx == 0) { @@ -226,7 +226,7 @@ function cbdel() { if (capResult.code == 1000) { msg("삭제했습니다.", null, true, null, true); - gotab(2, 500); + gotab(3, 500); } else { msg("수강데이터가 생성되어 삭제할 수 없습니다."); } diff --git a/BO/Views/cm/cmreginning.cshtml b/BO/Views/cm/cmreginning.cshtml index c80e3e0..c78eaa1 100644 --- a/BO/Views/cm/cmreginning.cshtml +++ b/BO/Views/cm/cmreginning.cshtml @@ -3,7 +3,7 @@


    + @Html.Partial("./Partial/ContentBox", "bindContent;콘텐츠 선택;1;" + (Model.CM.pcmno ?? Model.CM.cmno) + ";thisbox", new ViewDataDictionary { { "cms", Model.CMs } }) @section styles{ @@ -167,10 +168,11 @@ @Html.Partial("./Partial/ScriptDate") } @section scripts{ - + } diff --git a/BO/Views/cm/cmregmenu.cshtml b/BO/Views/cm/cmregmenu.cshtml index 515530f..80a0ce4 100644 --- a/BO/Views/cm/cmregmenu.cshtml +++ b/BO/Views/cm/cmregmenu.cshtml @@ -3,7 +3,7 @@
    • 기본정보
    • 회차설정
    • - @if (Model.CM.ismaster == 0) + @if (Model.CM.ismaster == 0 && Model.CM.cshape == 2) {
    • 교육일정
    • } diff --git a/Base/Controller/ACommonCM.cs b/Base/Controller/ACommonCM.cs index d549fd0..c6edcc7 100644 --- a/Base/Controller/ACommonCM.cs +++ b/Base/Controller/ACommonCM.cs @@ -242,6 +242,16 @@ namespace NP.Base.Controllers return JsonOK(Dao.Save("cm.cminning.del" + (im==1?"2":""), cmino)); } [HttpPost] + public JsonResult CMInningByScdDel(int im, Int64 cmino) + { + return JsonOK(Dao.Save("cm.cminning.del3" + (im == 1 ? "2" : ""), cmino)); + } + [HttpPost] + public JsonResult CMInningScdDel(int im, Int64 cmisno) + { + return JsonOK(Dao.Save("cm.cminningscd.del" + (im == 1 ? "2" : ""), cmisno)); + } + [HttpPost] public JsonResult CMSeqSave(int cmno, int isseq) { return JsonOK(Dao.Save("cm.cmseqsave", new Hashtable() { { "cmno", cmno },{ "isseq", isseq }, { "uno", SUserInfo.UserNo }, { "uip", GetUserIP() } })); @@ -252,6 +262,14 @@ namespace NP.Base.Controllers return JsonBack(Dao.Get("cm.cminnings", new Hashtable() { { "cmino", cmino } }).First()); } [HttpPost] + public JsonResult CMInningScdGet(Int64 cmino ,Int64 cmisno) + { + var data = Dao.Get("cm.cminningscds", new Hashtable() { { "cmino", cmino }, { "cmisno", cmisno } }).First(); + data.estart2 = data.estart.ToString("yyyy-MM-dd HH:mm"); + data.eend2 = data.eend.ToString("yyyy-MM-dd HH:mm"); + return JsonBack(data); + } + [HttpPost] public JsonResult CMInningSave(CMInning cmi) { cmi.uno = SUserInfo.UserNo; cmi.uip = GetUserIP(); @@ -275,6 +293,27 @@ namespace NP.Base.Controllers } return JsonOK(rtn, true); } + [HttpPost] + public JsonResult CMInningScdSave(CMinningscd cmis) + { + if(!string.IsNullOrEmpty(cmis.estart2)) + cmis.estart = Convert.ToDateTime(cmis.estart2); + if (!string.IsNullOrEmpty(cmis.eend2)) + cmis.eend = Convert.ToDateTime(cmis.eend2); + cmis.uno = SUserInfo.UserNo; + cmis.uip = GetUserIP(); + int rtn = 0; + if (cmis.cmisno < 1) + { + Dao.Insert("cm.cminningscd.in", cmis); + rtn = cmis.cmisno > 0 ? 1 : 0; + } + else + { + rtn = Dao.Save("cm.cminningscd." + (cmis.cmisno > 0 ? "up" : "in"), cmis); + } + return JsonOK(rtn, true); + } [HttpPost] public JsonResult ContentFind(int? cmno, String ctname, int pno) diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index 8d8d397..e0e1637 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -5,6 +5,7 @@ + @@ -335,6 +336,24 @@ delete from cminning where cmino = #cmino# + + delete from cminning where cmino = ( + select a.cmino from ( + select case when count(b.cmisno) < 1 then #cmino# else 0 end cmisno + from (select 1 col1) a + left outer join cminningscd b on b.cmino=#cmino#) a + ) + + + delete from cminningscd where cmisno = ( + select a.cmisno from ( + select case when count(c.lectno) < 1 then #cmisno# else 0 end cmisno + from (select 1 col1) a + left outer join cminningscd b on b.cmisno=#cmisno# + left outer join lect c on c.cmisno=b.cmisno and c.status=1 and c.ischanged=0 + ) a + ) + update cm set isseq=#isseq#, where cmno=#cmno# @@ -488,6 +507,21 @@ order by a.week,a.iseq + delete from cminning where cmno=#cmno#; @@ -505,6 +539,12 @@ where b.cmino is null SELECT last_insert_id() + + SELECT * FROM (SELECT LAST_INSERT_ID(0) col1) a WHERE col1 > 0; + insert into cminningscd(cmino,estart,eend,quota,) + values(#cmino#,#estart#,#eend#,#quota#,) + SELECT last_insert_id() + update cminning a left outer join ( @@ -516,6 +556,11 @@ ,ctno =#ctno#,istaste =#istaste#,sttime=#sttime#,atime =#atime#,mstime =#mstime#,metime =#metime#,userno =#userno# where a.cmino=#cmino# and b.cmino is null + + update cminningscd a + set ,cmino=#cmino#,estart=#estart#,eend=#eend#,quota=#quota# + where a.cmisno=#cmisno# + update cminning set istaste=0 where cmno=#cmno# and cmino <> #cmino# diff --git a/Model/CM.cs b/Model/CM.cs index a15bd87..109f33e 100644 --- a/Model/CM.cs +++ b/Model/CM.cs @@ -3199,4 +3199,43 @@ namespace NP.Model /// public int isdel {get;set;} } + + /// + /// 혼합교육강좌 + /// + [Serializable] + public class CMinningscd : BaseModel + { + /// + /// 일정키 + /// + public Int64 cmisno { get; set; } + /// + /// 회차키 + /// + public Int64 cmino { get; set; } + /// + /// 교육시작 + /// + public DateTime estart { get; set; } + public string estart2 { get; set; } + /// + /// 교육종료 + /// + public DateTime eend { get; set; } + public string eend2 { get; set; } + /// + /// 제한인원 + /// + public int quota { get; set; } + + /// + /// 순서 + /// + public int? scdseq { get; set; } + /// + /// 등록인원 + /// + public int? regmem { get; set; } + } } diff --git a/Model/VMCM.cs b/Model/VMCM.cs index d32747d..076315b 100644 --- a/Model/VMCM.cs +++ b/Model/VMCM.cs @@ -21,6 +21,7 @@ namespace NP.Model public IList Assigns { get; set; } public IList CMInnings { get; set; } public IList Books { get; set; } + public IList CMInningscds { get; set; } public Book Book { get; set; } public CMEV CMEV { get; set; } public IList ESTs { get; set; }