From d3b30a0d331db3181b5f53c11dcb38055de143de Mon Sep 17 00:00:00 2001 From: lch Date: Mon, 3 May 2021 08:28:27 +0000 Subject: [PATCH] =?UTF-8?q?=ED=95=B4=EB=8B=B9=EA=B3=BC=EC=A0=95:=20?= =?UTF-8?q?=E2=91=A0=20=EC=98=A8=EB=9D=BC=EC=9D=B8/=ED=98=BC=ED=95=A9=20?= =?UTF-8?q?=E2=91=A1=20=EC=98=A4=ED=94=84=EB=9D=BC=EC=9D=B8=20=EC=A4=91=20?= =?UTF-8?q?=EB=B9=84=ED=99=98=EA=B8=89=20=EC=84=A0=ED=83=9D=20=EC=8B=9C=20?= =?UTF-8?q?=EC=86=8C=EC=86=8D=20=EC=84=A0=ED=83=9D=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8A=94=20=EB=B6=80=EB=B6=84=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Base/Controller/FCommon.cs | 112 +++++++++------ Dao/MyBatis/Maps/CM.xml | 11 ++ FO/Views/Course/ApplyEdu.cshtml | 235 +++++++++++++++++++------------- FO/Views/Course/ApplyPay.cshtml | 7 +- Model/PPLog.cs | 2 +- 5 files changed, 230 insertions(+), 137 deletions(-) diff --git a/Base/Controller/FCommon.cs b/Base/Controller/FCommon.cs index 6e1f068..fe3a9ce 100644 --- a/Base/Controller/FCommon.cs +++ b/Base/Controller/FCommon.cs @@ -260,8 +260,8 @@ namespace NP.Base.Controllers ppllog.asno = vm.Assign.asno; ppllog.isready = Request["applicableCM"].ToString() == "정상접수" ? 0 : 1; ppllog.cgcode = vm.stringval; - if (!string.IsNullOrEmpty(vm.stringval2)) - ppllog.cshape = Convert.ToInt32(vm.stringval2); + ppllog.cshape = !string.IsNullOrEmpty(vm.stringval2) ? Convert.ToInt32(vm.stringval2) : (int?)null; + ppllog.asname = string.Empty; if (vm.stringval == "0") { ppllog.typeman = !string.IsNullOrEmpty(vm.stringval3) ? Convert.ToInt32(vm.stringval3) : (int?)null; @@ -273,43 +273,75 @@ namespace NP.Base.Controllers { ppllog.cgno = !string.IsNullOrEmpty(vm.stringval3) ? Convert.ToInt32(vm.stringval3) : (int?)null; } - if (!string.IsNullOrEmpty(Request["cmisno"])) - ppllog.cmisno = Convert.ToInt64(Request["cmisno"]); - - if (!string.IsNullOrEmpty(Request["isrebate"])) - ppllog.isrebate = Convert.ToInt32(Request["isrebate"]); - - if (!string.IsNullOrEmpty(Request["isrebate"]) && Convert.ToInt32(Request["isrebate"]) == 1) - { - if (!string.IsNullOrEmpty(Request["rbankname"])) - ppllog.rbankname = Request["rbankname"].ToString(); - if (!string.IsNullOrEmpty(Request["rbankacc"])) - ppllog.rbankacc = Request["rbankacc"].ToString(); - if (!string.IsNullOrEmpty(Request["rbankowner"])) - ppllog.rbankowner = Request["rbankowner"].ToString(); + + ppllog.cmisno = !string.IsNullOrEmpty(Request["cmisno"]) ? Convert.ToInt64(Request["cmisno"]) : (long?)null ; + ppllog.isrebate = !string.IsNullOrEmpty(Request["isrebate"]) ? Convert.ToInt32(Request["isrebate"]) : (int?)null; + + if (ppllog.isrebate == 1) + { + ppllog.rbankname = !string.IsNullOrEmpty(Request["rbankname"]) ? Request["rbankname"].ToString() : null; + ppllog.rbankacc = !string.IsNullOrEmpty(Request["rbankacc"]) ? Request["rbankacc"].ToString() : null; + ppllog.rbankowner = !string.IsNullOrEmpty(Request["rbankowner"]) ? Request["rbankowner"].ToString() : null; } - if (!string.IsNullOrEmpty(Request["isaccommodation"])) - ppllog.isaccommodation = Convert.ToInt32(Request["isaccommodation"].ToString()); + ppllog.isaccommodation = !string.IsNullOrEmpty(Request["isaccommodation"]) ? Convert.ToInt32(Request["isaccommodation"].ToString()) : (int?)null; - ppllog.asname = vm.Assign.asname; - ppllog.brno = vm.Assign.brno.IndexOf("-") > 0 ? vm.Assign.brno.Replace("-", "") : vm.Assign.brno; - ppllog.ceoname = vm.Assign.ceoname; - ppllog.post = vm.Assign.post; - ppllog.address1 = vm.Assign.address1; - ppllog.address2 = vm.Assign.address2; - ppllog.btype = vm.Assign.btype; - ppllog.bkind = vm.Assign.bkind; - - Int64? fgnobno = (Int64?)null; - if (Request.Files.GetMultiple("file1").Where(w => !string.IsNullOrEmpty(w.FileName)).Count() > 0) - { - fgnobno = SetFile(Request.Files.GetMultiple("file1").Where(w => !string.IsNullOrEmpty(w.FileName)).ToList(), fgnobno ?? 0, "assign", "fgnobno"); + //강의유형 온라인 or 혼합(온+오프) or (교육장 and 비환급): + if (ppllog.cshape == 0 || (ppllog.cshape == 1 && ppllog.isrebate == 0) || ppllog.cshape == 2) { + var isCompany = !string.IsNullOrEmpty(Request["isCompany"]) ? Convert.ToInt32(Request["isCompany"]) : (int?)null; + if (isCompany == 0) //개인 + { + ppllog.asno = null; + vm.Assign = null; + } + else if (isCompany == 1) //업체 + { + if(vm.Assign.asno != vm.asno) //기존 등록된 회사랑 소속업체명에서 선택한 회사가 다르면 소속업체명에서 선택한 회사로 변경 + { + ppllog.asno = vm.asno; + vm.Assign = Dao.Get("cm.assign.applyedu.byasno", new Hashtable() { { "asno", vm.asno } }).FirstOrDefault(); + if (vm.Assign != null) + { + if (!string.IsNullOrEmpty(vm.Assign.MphoneFormat) && vm.Assign.MphoneFormat.IndexOf("-") >= 0) + { + string[] mphoneArr = vm.Assign.MphoneFormat.Split('-'); + vm.Assign.mphone1 = mphoneArr.Length > 0 ? mphoneArr[0] : string.Empty; + vm.Assign.mphone2 = mphoneArr.Length > 1 ? mphoneArr[1] : string.Empty; + vm.Assign.mphone3 = mphoneArr.Length > 2 ? mphoneArr[2] : string.Empty; + } + if (!string.IsNullOrEmpty(vm.Assign.taxemail) && vm.Assign.taxemail.IndexOf("@") >= 0) + { + string[] taxemailArr = vm.Assign.taxemail.Split('@'); + vm.Assign.taxemail1 = taxemailArr.Length > 0 ? taxemailArr[0] : string.Empty; + vm.Assign.taxemail2 = taxemailArr.Length > 1 ? taxemailArr[1] : string.Empty; + } + } + } + } + } + + if (vm.Assign != null) + { + ppllog.asname = vm.Assign.asname; + ppllog.brno = vm.Assign.brno.IndexOf("-") > 0 ? vm.Assign.brno.Replace("-", "") : vm.Assign.brno; + ppllog.ceoname = vm.Assign.ceoname; + ppllog.post = vm.Assign.post; + ppllog.address1 = vm.Assign.address1; + ppllog.address2 = vm.Assign.address2; + ppllog.btype = vm.Assign.btype; + ppllog.bkind = vm.Assign.bkind; + + Int64? fgnobno = (Int64?)null; + if (Request.Files.GetMultiple("file1").Where(w => !string.IsNullOrEmpty(w.FileName)).Count() > 0) + { + fgnobno = SetFile(Request.Files.GetMultiple("file1").Where(w => !string.IsNullOrEmpty(w.FileName)).ToList(), fgnobno ?? 0, "assign", "fgnobno"); + } + ppllog.fgnobno = fgnobno; + + ppllog.eino = vm.Assign.eino; + ppllog.mname = vm.Assign.mname; + ppllog.mphone = string.Format("{0}-{1}-{2}", vm.Assign.mphone1, vm.Assign.mphone2, vm.Assign.mphone3); + ppllog.taxemail = string.Format("{0}@{1}", vm.Assign.taxemail1, vm.Assign.taxemail2); } - ppllog.fgnobno = fgnobno; - ppllog.eino = vm.Assign.eino; - ppllog.mname = vm.Assign.mname; - ppllog.mphone = string.Format("{0}-{1}-{2}", vm.Assign.mphone1, vm.Assign.mphone2, vm.Assign.mphone3); - ppllog.taxemail = string.Format("{0}@{1}", vm.Assign.taxemail1, vm.Assign.taxemail2); if (!string.IsNullOrEmpty(vm.User.userpno1) && !string.IsNullOrEmpty(vm.User.userpno2)) { ppllog.userpno = string.Format("{0}{1}", vm.User.userpno1, vm.User.userpno2); @@ -322,8 +354,12 @@ namespace NP.Base.Controllers ppllog.isassignuser = vm.User.isassignuser; ppllog.uduty = vm.User.uduty; ppllog.slevel = vm.User.slevel; - - Dao.Save("cm.assign.applyedu.up", ppllog); + + if (ppllog.asno != null) + { + //ppllog.asno 값이 중간에 변경이 안되었을 때만 호출 + Dao.Save("cm.assign.applyedu.up", ppllog); + } Dao.Save("cm.users.applyedu.up", ppllog); Dao.Insert("cm.pplog.applyedu.in", ppllog); if (ppllog.pplno > 0) diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index 20a2356..6304693 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1859,6 +1859,17 @@ and a.isdel=0 and b.userno=#userno# + + SELECT * FROM (SELECT LAST_INSERT_ID(0) col1) a WHERE col1 > 0; diff --git a/FO/Views/Course/ApplyEdu.cshtml b/FO/Views/Course/ApplyEdu.cshtml index d874529..55f8fbf 100644 --- a/FO/Views/Course/ApplyEdu.cshtml +++ b/FO/Views/Course/ApplyEdu.cshtml @@ -1,5 +1,5 @@ @model NP.Model.VMCourse -@{ +@{ var isallday = Model.CM.retimeymd == "2099-12-31" ? true : false; }
@@ -11,9 +11,9 @@ @*등급*@ @*직무분야*@ - +

신청강좌

  • @@ -103,8 +103,8 @@ 환급여부
      -
    • -
    • +
    • +
    @@ -112,7 +112,26 @@

    ※ 고용보험에 가입되어 있는 재직자의 경우에만 교육비 중 기준된 일정금액 환급이 가능 하며 고용보험 미 가입자는 환급이 불가 합니다.

    - + } +

    소속업체명

    + + + + + + + +
    업체/개인 선택 + + +    + +
    +

    + ※수료증 소속부분에 기재될 내용으로 소속업체가 없으면 개인을 선택해 주세요. +

    + @if (Model.CM.cshape == 1) + {

    환급금 수령계좌 등록

    *는 필수 입력사항입니다.

    @@ -135,91 +154,93 @@ } -

    회사정보 확인

    -

    *는 필수 입력사항입니다.

    - @Html.HiddenFor(x => x.Assign.asno) -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    *회사명@Html.TextBoxFor(x => x.Assign.asname, new { @class = "apylpt", @maxlength = "100" })
    *사업자등록번호@Html.TextBoxFor(x => x.Assign.brno, new { @class = "apylpt", @maxlength = "10" })
    *대표자성명@Html.TextBoxFor(x => x.Assign.ceoname, new { @class = "apylpt", @maxlength = "50" })
    *주소 -
      -
    • - @Html.TextBoxFor(x => x.Assign.post, new { @class = "postno", @style = "background-color:#ddd;", @readonly = true }) -
    • -
    • - @Html.TextBoxFor(x => x.Assign.address1, new { @class = "postadr", @style = "background-color:#ddd;", @readonly = true, @placeholder = "주소입력" }) -
    • -
    • - @Html.TextBoxFor(x => x.Assign.address2, new { @class = "postadrsub", @placeholder = "나머지 주소입력", @maxlength = "200" }) -
    • -
    • - 우편번호검색 -
    • -
    -
    *업태@Html.TextBoxFor(x => x.Assign.btype, new { @class = "apylpt", @maxlength = "50" })
    *종목@Html.TextBoxFor(x => x.Assign.bkind, new { @class = "apylpt", @maxlength = "50" })
    *고용보험관리번호@Html.TextBoxFor(x => x.Assign.eino, new { @class = "apylpt", @maxlength = "30" })
    *담당자성명@Html.TextBoxFor(x => x.Assign.mname, new { @class = "apylpt", @maxlength = "30" })
    *담당자연락처 -
      -
    • @Html.TextBoxFor(x => x.Assign.mphone1, new { @maxlength = "3" })
    • -
    • -
    • -
    • @Html.TextBoxFor(x => x.Assign.mphone2, new { @maxlength = "4" })
    • -
    • -
    • -
    • @Html.TextBoxFor(x => x.Assign.mphone3, new { @maxlength = "4" })
    • -
    -
    *계산서받을 이메일 -
      -
    • @Html.TextBoxFor(x => x.Assign.taxemail1, new { @maxlength = "100" })
    • -
    • -
    • @Html.TextBoxFor(x => x.Assign.taxemail2, new { @maxlength = "30" })
    • -
    -
    사업자등록증 - @Html.Partial("./Partial/file", Model.FileList, new ViewDataDictionary { { "fgn", "fgnobno" }, { "fgv", Model.Assign.fgnobno ?? 0 }, { "filename", "file1" }, { "filecount", 1 }, { "fileext", "png,jpg,gif,pdf" }, { "datakey", "assign.fgnobno" } }) -
    - + @if (Model.Assign != null) + { +

    회사정보 확인

    +

    *는 필수 입력사항입니다.

    + @Html.HiddenFor(x => x.Assign.asno) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    *회사명@Html.TextBoxFor(x => x.Assign.asname, new { @class = "apylpt", @maxlength = "100" })
    *사업자등록번호@Html.TextBoxFor(x => x.Assign.brno, new { @class = "apylpt", @maxlength = "10" })
    *대표자성명@Html.TextBoxFor(x => x.Assign.ceoname, new { @class = "apylpt", @maxlength = "50" })
    *주소 +
      +
    • + @Html.TextBoxFor(x => x.Assign.post, new { @class = "postno", @style = "background-color:#ddd;", @readonly = true }) +
    • +
    • + @Html.TextBoxFor(x => x.Assign.address1, new { @class = "postadr", @style = "background-color:#ddd;", @readonly = true, @placeholder = "주소입력" }) +
    • +
    • + @Html.TextBoxFor(x => x.Assign.address2, new { @class = "postadrsub", @placeholder = "나머지 주소입력", @maxlength = "200" }) +
    • +
    • + 우편번호검색 +
    • +
    +
    *업태@Html.TextBoxFor(x => x.Assign.btype, new { @class = "apylpt", @maxlength = "50" })
    *종목@Html.TextBoxFor(x => x.Assign.bkind, new { @class = "apylpt", @maxlength = "50" })
    *고용보험관리번호@Html.TextBoxFor(x => x.Assign.eino, new { @class = "apylpt", @maxlength = "30" })
    *담당자성명@Html.TextBoxFor(x => x.Assign.mname, new { @class = "apylpt", @maxlength = "30" })
    *담당자연락처 +
      +
    • @Html.TextBoxFor(x => x.Assign.mphone1, new { @maxlength = "3" })
    • +
    • -
    • +
    • @Html.TextBoxFor(x => x.Assign.mphone2, new { @maxlength = "4" })
    • +
    • -
    • +
    • @Html.TextBoxFor(x => x.Assign.mphone3, new { @maxlength = "4" })
    • +
    +
    *계산서받을 이메일 +
      +
    • @Html.TextBoxFor(x => x.Assign.taxemail1, new { @maxlength = "100" })
    • +
    • +
    • @Html.TextBoxFor(x => x.Assign.taxemail2, new { @maxlength = "30" })
    • +
    +
    사업자등록증 + @Html.Partial("./Partial/file", Model.FileList, new ViewDataDictionary { { "fgn", "fgnobno" }, { "fgv", Model.Assign.fgnobno ?? 0 }, { "filename", "file1" }, { "filecount", 1 }, { "fileext", "png,jpg,gif,pdf" }, { "datakey", "assign.fgnobno" } }) +
    + }

    개인정보 확인

    *는 필수 입력사항입니다.

    - @Html.HiddenFor(x => x.User.userno) + @Html.HiddenFor(x => x.User.userno) @@ -333,6 +354,7 @@ +@Html.Partial("./Partial/BoxAssign", null, new ViewDataDictionary { { "bindmethod", "bindassign" } }) @section scriptsHeader{ @Html.Partial("./Partial/ScriptPost") @Html.Partial("./Partial/filescript") @@ -349,11 +371,13 @@ $(".rbankInfo").show(); $(".companyInfo").show(); $(".uduty").show(); + $(".isCompany").hide(); } else { $(".rbankInfo").hide(); $(".companyInfo").hide(); $(".uduty").hide(); + $(".isCompany").show(); } }); @@ -366,11 +390,17 @@ total = @Model.CM.infee; } $("#spninfeecost").html(bindComma(total)); - }); - - + $("input:radio[name='isCompany']").on("click", function () { + var isCompany = $(this).val(); + if (isCompany == "0") { + setv("asno", ""); + $("#asname").val(""); + } else { + boxassignview(); + } + }); }); function initControl() { $("#spninfee").html(bindComma(@Model.CM.infee)); @@ -380,10 +410,24 @@ setTimeout(function () { if (@Model.CM.cshape == 2) { setScd(); - } + } }, 300); - } + if ($("#cshape").val() == "0") { + $(".companyInfo").hide(); + $(".isCompany").show(); + } else if ($("#cshape").val() == "1") { + $(".companyInfo").show(); + $(".isCompany").hide(); + } else if ($("#cshape").val() == "2") { + $(".companyInfo").hide(); + $(".isCompany").show(); + } + } + function bindassign(v) { + $("#asno").val(v.split(':')[0]); + $("#asname").val(v.split(':')[1]); + } function setScd() { capp("/focommon/GetScdForMixEdu", { cmno: @Model.cmno, month: $("#selMonth").val() }, "renderScd"); } @@ -441,9 +485,8 @@ else { if (@ViewBag.SSUserNo > 0) { $("#cmisno").val($("input:radio[name=rdoScds]:checked").val()); - $("#isrebate").val($("input:radio[name=isrebate]:checked").val()); $("#isaccommodation").val($("input:radio[name=rdoAccommo]:checked").val()); - + $("#applicableCM").val("@Model.CM.applicableCM"); capfileform('/fcommon/savePPLog', 'applyEduForm', 'saveResult'); @@ -463,4 +506,4 @@ } return; } - + \ No newline at end of file diff --git a/FO/Views/Course/ApplyPay.cshtml b/FO/Views/Course/ApplyPay.cshtml index 85451ae..a6193e1 100644 --- a/FO/Views/Course/ApplyPay.cshtml +++ b/FO/Views/Course/ApplyPay.cshtml @@ -99,8 +99,11 @@ ) -
  • - + @if (!string.IsNullOrEmpty(Model.PPLog.asname)) + { +
  • + } +
    • 수강신청
    • diff --git a/Model/PPLog.cs b/Model/PPLog.cs index 4584772..0dca488 100644 --- a/Model/PPLog.cs +++ b/Model/PPLog.cs @@ -26,7 +26,7 @@ namespace NP.Model public String rbankacc { get; set; } public String rbankowner { get; set; } - public Int64 asno { get; set; } + public Int64? asno { get; set; } public String asname { get; set; } public String brno { get; set; } public String ceoname { get; set; }