diff --git a/Base/Controller/FCommon.cs b/Base/Controller/FCommon.cs index f08fd52..d9832b8 100644 --- a/Base/Controller/FCommon.cs +++ b/Base/Controller/FCommon.cs @@ -137,7 +137,7 @@ namespace NP.Base.Controllers } return JsonOK(Dao.Save("lect.edub2b", e)); } - + //[HttpPost] //public JsonResult SaveUserFile(String type, Int64? fgno) @@ -248,7 +248,84 @@ namespace NP.Base.Controllers // pmno = (pmno??0) < 1 ? (Int64?)null : pmno; // return JsonOK(Dao.Save("common.memo.insert", new Memo() { usernos = userno.ToString(), pmno = pmno, mtitle = mtitle, mcontents = mcontents, uno = SUserInfo.UserNo, uip = GetUserIP(), cno = SUserInfo.UserNo })); //} + [HttpPost] + public JsonResult savePPLog(VMCourse vm) + { + int rtn = 0; + PPLog ppllog = new PPLog(); + ppllog.uno = SUserInfo.UserNo; + ppllog.uip = GetUserIP(); + ppllog.userno = vm.User.userno; + 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); + if (vm.stringval == "0") + { + ppllog.typeman = !string.IsNullOrEmpty(vm.stringval3) ? Convert.ToInt32(vm.stringval3) : (int?)null; + ppllog.typeedu = !string.IsNullOrEmpty(vm.stringval4) ? Convert.ToInt32(vm.stringval4) : (int?)null; + ppllog.typegrade = !string.IsNullOrEmpty(vm.stringval5) ? Convert.ToInt32(vm.stringval5) : (int?)null; + ppllog.typejob = !string.IsNullOrEmpty(vm.stringval6) ? Convert.ToInt32(vm.stringval6) : (int?)null; + } + else + { + ppllog.cgno = !string.IsNullOrEmpty(vm.stringval3) ? Convert.ToInt32(vm.stringval6) : (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["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.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); + if (!string.IsNullOrEmpty(vm.User.userpno1) && !string.IsNullOrEmpty(vm.User.userpno2)) + { + ppllog.userpno = string.Format("{0}-{1}", vm.User.userpno1, vm.User.userpno2); + } + ppllog.mobile = string.Format("{0}-{1}-{2}", vm.User.mobile1, vm.User.mobile2, vm.User.mobile3); + ppllog.email = string.Format("{0}@{1}", vm.User.email1, vm.User.email2); + ppllog.upost = vm.User.post; + ppllog.uaddress1 = vm.User.address1; + ppllog.uaddress2 = vm.User.address2; + ppllog.isassignuser = vm.User.isassignuser; + ppllog.uduty = vm.User.uduty; + ppllog.slevel = vm.User.slevel; + + 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) + { + return JsonOK(ppllog.pplno); + } + return JsonOK(rtn); + + } } } \ No newline at end of file diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index 0512b61..c84346b 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -1831,5 +1831,55 @@ and a.isdel=0 and b.userno=#userno# + + + SELECT * FROM (SELECT LAST_INSERT_ID(0) col1) a WHERE col1 > 0; + + insert into pplog ( + userno,isready,cgcode,cshape,typeman,typeedu,typegrade,typejob,cgno,cmisno,isrebate,rbankname,rbankacc,rbankowner,asname,brno,ceoname,post,address1,address2,btype,bkind,eino,mname + ,mphone,taxemail,userpno,mobile,email,upost,uaddress1,uaddress2,isassignuser,uduty,slevel,) + values ( + #userno#,#isready#,#cgcode#,#cshape#,#typeman#,#typeedu#,#typegrade#,#typejob#,#cgno#,#cmisno#,#isrebate#,#rbankname#,#rbankacc#,#rbankowner#,#asname#,#brno#,#ceoname#,#post#,#address1# + ,#address2#,#btype#,#bkind#,#eino#,#mname# + ,HEX(AES_ENCRYPT(#mphone#, )) + ,HEX(AES_ENCRYPT(#taxemail#, )) + ,HEX(AES_ENCRYPT(#userpno#, )) + ,HEX(AES_ENCRYPT(#mobile#, )) + ,HEX(AES_ENCRYPT(#email#, )) + ,#upost#,#uaddress1#,#uaddress2#,#isassignuser#,#uduty#,#slevel#,) + SELECT LAST_INSERT_ID() + + + + update assign set + ,asname=#asname# + ,ceoname=#ceoname# + ,brno =#brno# + ,post =#post# + ,address1=#address1# + ,address2=#address2# + ,btype =#btype# + ,bkind =#bkind# + ,fgnobno=#fgnobno# + ,eino=#eino# + ,mname=#mname# + ,mphone =case when #mphone# is not null then HEX(AES_ENCRYPT(#mphone#, )) else mphone end + ,taxemail =case when #taxemail# is not null then HEX(AES_ENCRYPT(#taxemail#, )) else taxemail end + where asno=#asno# + + + update users set + ,email =case when #email# is null and #email# > 80 then null when #email# is not null then HEX(AES_ENCRYPT(#email#, )) else email end + ,mobile =HEX(AES_ENCRYPT(#mobile#, )) + ,asno =#asno# + ,userpno =case when #userpno# is not null then HEX(AES_ENCRYPT(#userpno#, )) else null end + ,post =case when #post# is not null then #post# else post end + ,address1 =case when #address1# is not null then #address1# else address1 end + ,address2 =case when #address2# is not null then #address2# else address2 end + ,uduty = #uduty# + ,slevel = #slevel# + ,isassignuser = #isassignuser# + where userno=#userno# + \ No newline at end of file diff --git a/FO/Controllers/CourseController.cs b/FO/Controllers/CourseController.cs index bfe6822..758e017 100644 --- a/FO/Controllers/CourseController.cs +++ b/FO/Controllers/CourseController.cs @@ -772,6 +772,7 @@ namespace NP.FO.Controllers public ActionResult ApplyEdu(VMCourse vm) { + vm.CM = Dao.Get("cm.cms", new System.Collections.Hashtable() { { "cmno", vm.cmno } }).FirstOrDefault(); vm.CM.applicableCM = (vm.CM.quota - vm.CM.lectcnt <= 0) ? "대기접수" : "정상접수"; vm.CMInningscds = Dao.Get("cm.cminningscds.applyedu", new System.Collections.Hashtable() { { "cmno", vm.cmno },{"month", (vm.scdMonth == null)? DateTime.Now.Year : vm.scdMonth } }); @@ -794,6 +795,11 @@ namespace NP.FO.Controllers vm.Assign.taxemail1 = taxemailArr.Length > 0 ? taxemailArr[0] : string.Empty; vm.Assign.taxemail2 = taxemailArr.Length > 1 ? taxemailArr[1] : string.Empty; } + vm.FileList = new List() { }; + if (vm.Assign.fgnobno != null) + { + vm.FileList = GetFiles(vm.Assign.fgnobno.Value); + } vm.User = Dao.Get("cm.user.applyedu", new Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); if (!string.IsNullOrEmpty(vm.User.MobileFormat) && vm.User.MobileFormat.IndexOf("-") >= 0) @@ -803,12 +809,17 @@ namespace NP.FO.Controllers vm.User.mobile2 = mobileArr.Length > 1 ? mobileArr[1] : string.Empty; vm.User.mobile3 = mobileArr.Length > 2 ? mobileArr[2] : string.Empty; } - if (!string.IsNullOrEmpty(vm.User.userpno) && vm.User.userpno.Length == 13) + + if (!string.IsNullOrEmpty(vm.User.userpno)) { - string userpnoString = string.Format("{0}-{1}", vm.User.userpno.Substring(0, 6), vm.User.userpno.Substring(6, 7)); - string[] userpnoArr = userpnoString.Split('-'); - vm.User.userpno1 = userpnoArr.Length > 0 ? userpnoArr[0] : string.Empty; - vm.User.userpno2 = userpnoArr.Length > 1 ? userpnoArr[1] : string.Empty; + vm.User.userpno = vm.User.userpno.Replace("-",""); + if (vm.User.userpno.Length == 13) + { + string userpnoString = string.Format("{0}-{1}", vm.User.userpno.Substring(0, 6), vm.User.userpno.Substring(6, 7)); + string[] userpnoArr = userpnoString.Split('-'); + vm.User.userpno1 = userpnoArr.Length > 0 ? userpnoArr[0] : string.Empty; + vm.User.userpno2 = userpnoArr.Length > 1 ? userpnoArr[1] : string.Empty; + } } if (!string.IsNullOrEmpty(vm.User.email) && vm.User.email.IndexOf("@") >= 0) { diff --git a/FO/Views/Course/ApplyEdu.cshtml b/FO/Views/Course/ApplyEdu.cshtml index d0c8fcc..455151f 100644 --- a/FO/Views/Course/ApplyEdu.cshtml +++ b/FO/Views/Course/ApplyEdu.cshtml @@ -7,7 +7,9 @@ @*교육목적*@ @*등급*@ @*직무분야*@ - @*교육일정 month*@ + + +

신청강좌

  • @@ -65,8 +67,8 @@ 교육비 지원
      -
    • -
    • +
    • +
    @@ -81,15 +83,15 @@ 은행명 - + 계좌번호 - + 예금주 - + @@ -99,19 +101,20 @@ }

    회사정보 확인

    + @Html.HiddenFor(x => x.Assign.asno) - + - + - + @@ -124,7 +127,7 @@ @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", @style = "background-color:#ddd;", @placeholder = "나머지 주소입력" }) + @Html.TextBoxFor(x => x.Assign.address2, new { @class = "postadrsub", @placeholder = "나머지 주소입력", @maxlength = "200" })
  • 우편번호검색 @@ -134,75 +137,77 @@
  • - + - + - + - +
    회사명@Html.TextBoxFor(x=>x.Assign.asname, new { @class = "apylpt"})@Html.TextBoxFor(x => x.Assign.asname, new { @class = "apylpt", @maxlength = "100" })
    사업자등록번호@Html.TextBoxFor(x => x.Assign.brno, new { @class = "apylpt" })@Html.TextBoxFor(x => x.Assign.brno, new { @class = "apylpt", @maxlength = "10" })
    대표자성명@Html.TextBoxFor(x => x.Assign.ceoname, new { @class = "apylpt" })@Html.TextBoxFor(x => x.Assign.ceoname, new { @class = "apylpt", @maxlength = "50" })
    주소
    업태@Html.TextBoxFor(x => x.Assign.btype, new { @class = "apylpt" })@Html.TextBoxFor(x => x.Assign.btype, new { @class = "apylpt", @maxlength = "50" })
    종목@Html.TextBoxFor(x => x.Assign.bkind, new { @class = "apylpt" })@Html.TextBoxFor(x => x.Assign.bkind, new { @class = "apylpt", @maxlength = "50" })
    고용보험관리번호@Html.TextBoxFor(x => x.Assign.eino, new { @class = "apylpt" })@Html.TextBoxFor(x => x.Assign.eino, new { @class = "apylpt", @maxlength = "30" })
    담당자성명@Html.TextBoxFor(x => x.Assign.mname, new { @class = "apylpt" })@Html.TextBoxFor(x => x.Assign.mname, new { @class = "apylpt", @maxlength = "30" })
    담당자연락처
      -
    • @Html.TextBoxFor(x => x.Assign.mphone1)
    • +
    • @Html.TextBoxFor(x => x.Assign.mphone1, new { @maxlength = "3" })
    • -
    • -
    • @Html.TextBoxFor(x => x.Assign.mphone2)
    • +
    • @Html.TextBoxFor(x => x.Assign.mphone2, new { @maxlength = "4" })
    • -
    • -
    • @Html.TextBoxFor(x => x.Assign.mphone3)
    • +
    • @Html.TextBoxFor(x => x.Assign.mphone3, new { @maxlength = "4" })
    계산서받을 이메일
      -
    • @Html.TextBoxFor(x => x.Assign.taxemail1)
    • +
    • @Html.TextBoxFor(x => x.Assign.taxemail1, new { @maxlength = "100" })
    • -
    • @Html.TextBoxFor(x => x.Assign.taxemail2)
    • +
    • @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.TextBoxFor(x => x.User.userpno2, new { @maxlength = "7" })
  • + + @@ -210,9 +215,9 @@ @@ -227,7 +232,7 @@ @Html.TextBoxFor(x => x.User.address1, new { @class = "postadr", @style = "background-color:#ddd;", @readonly = true, @placeholder = "주소입력" })
  • - @Html.TextBoxFor(x => x.User.address2, new { @class = "postadrsub", @style = "background-color:#ddd;", @placeholder = "나머지 주소입력" }) + @Html.TextBoxFor(x => x.User.address2, new { @class = "postadrsub", @placeholder = "나머지 주소입력", @maxlength = "200" })
  • 우편번호검색 @@ -251,7 +256,7 @@
  • @@ -286,13 +291,14 @@ } else { -
  • 수강대기 신청
  • +
  • 수강대기 신청
  • } @section scriptsHeader{ @Html.Partial("./Partial/ScriptPost") + @Html.Partial("./Partial/filescript") } diff --git a/Model/Model.csproj b/Model/Model.csproj index 5082892..81e1ae6 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -48,6 +48,7 @@ + diff --git a/Model/PPLog.cs b/Model/PPLog.cs new file mode 100644 index 0000000..bc302fe --- /dev/null +++ b/Model/PPLog.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NP.Model +{ + [Serializable] + public class PPLog : BaseModel + { + public Int64 pplno { get; set; } + public int userno { get; set; } + public int? isready { get; set; } + public String cgcode { get; set; } + public int? cshape { get; set; } + public int? typeman { get; set; } + public int? typeedu { get; set; } + public int? typegrade { get; set; } + public int? typejob { get; set; } + public int? cgno { get; set; } + public Int64? cmisno { get; set; } + public int? isrebate { get; set; } + public String rbankname { get; set; } + public String rbankacc { get; set; } + public String rbankowner { get; set; } + + public Int64 asno { get; set; } + public String asname { get; set; } + public String brno { get; set; } + public String ceoname { get; set; } + public String post { get; set; } + public String address1 { get; set; } + public String address2 { get; set; } + public String btype { get; set; } + public String bkind { get; set; } + public Int64? fgnobno { get; set; } + public String eino { get; set; } + public String mname { get; set; } + public String mphone { get; set; } + public String taxemail { get; set; } + + public String userpno { get; set; } + public String mobile { get; set; } + public String email { get; set; } + public String upost { get; set; } + public String uaddress1 { get; set; } + public String uaddress2 { get; set; } + public int? isassignuser { get; set; } + public String uduty { get; set; } + public int? slevel { get; set; } + + } +}
    이름

    @Html.TextBoxFor(x => x.User.username, new { @class = "apylpt" })

    @Html.TextBoxFor(x => x.User.username, new { @class = "apylpt", @maxlength = "10", @style = "background-color:#ddd;", @readonly = true })

    주민등록번호
      -
    • @Html.TextBoxFor(x => x.User.userpno1)
    • +
    • @Html.TextBoxFor(x => x.User.userpno1, new { @maxlength = "6" })
    • -
    • -
    • @Html.TextBoxFor(x => x.User.userpno2)
    • -
    휴대전화
      -
    • @Html.TextBoxFor(x => x.User.mobile1)
    • +
    • @Html.TextBoxFor(x => x.User.mobile1, new { @maxlength = "3" })
    • -
    • -
    • @Html.TextBoxFor(x => x.User.mobile2)
    • +
    • @Html.TextBoxFor(x => x.User.mobile2, new { @maxlength = "4" })
    • -
    • -
    • @Html.TextBoxFor(x => x.User.mobile3)
    • +
    • @Html.TextBoxFor(x => x.User.mobile3, new { @maxlength = "4" })
    이메일
      -
    • @Html.TextBoxFor(x => x.User.email1)
    • +
    • @Html.TextBoxFor(x => x.User.email1, new { @maxlength = "100" })
    • -
    • @Html.TextBoxFor(x => x.User.email2)
    • +
    • @Html.TextBoxFor(x => x.User.email2, new { @maxlength = "30" })
    직위 - @Html.TextBoxFor(x => x.User.uduty, new { @class = "apylpt"}) + @Html.TextBoxFor(x => x.User.uduty, new { @class = "apylpt", @maxlength = "20" })