From fb68d1bf6b7134ed4aba75aa795413857dfdeb4a Mon Sep 17 00:00:00 2001 From: hyunho Date: Fri, 16 Oct 2020 03:57:39 +0000 Subject: [PATCH] --- BO/Views/user/ur.cshtml | 178 ++++++++++++++++++++------------------ Dao/MyBatis/Maps/User.xml | 16 +++- Model/Users.cs | 19 +++- 3 files changed, 126 insertions(+), 87 deletions(-) diff --git a/BO/Views/user/ur.cshtml b/BO/Views/user/ur.cshtml index 279486e..4a60368 100644 --- a/BO/Views/user/ur.cshtml +++ b/BO/Views/user/ur.cshtml @@ -29,15 +29,8 @@ } - @if (Model.viewname == "professor") - { -
- -
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "0:온라인;1:오프라인;2:온/오프라인" }, { "checked", Model.User.userno < 1 ? 1 : Model.User.userkind }, { "name", "User.userkind" } })
-
- }
- +
@Html.TextBoxFor(m => m.User.userid, new { @class = "form-control disp-init ff", @style = "width: 300px;", @maxlength = "50" })
@@ -45,18 +38,18 @@
@Html.PasswordFor(m => m.User.userpass, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "20" })
- +
@Html.TextBoxFor(m => m.User.username, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
@if (Model.viewname == "user") {
- -
@Html.TextBoxFor(m => m.User.usernameeng, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
-
-
- -
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "0:남;1:여" }, { "name", "User.gender" }, { "checked", Model.User.gender } })
+ +
+ @Html.HiddenFor(m => m.User.userpno) + @Html.TextBox("userpno1", (Model.User.userpno ?? "").Length > 5 ? Model.User.userpno.Substring(0, 6) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 143px;", @maxlength = "6" }) - + @Html.TextBox("userpno2", (Model.User.userpno ?? "").Length > 12 ? Model.User.userpno.Substring(6, 7) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 143px;", @maxlength = "7" }) +
}
@@ -70,17 +63,37 @@
- -
@Html.TextBoxFor(m => m.User.mobile, new { @class = "form-control disp-init mobilefmt nocomma", @data_zero = "1", @style = "width: 300px;", @maxlength = "13" })
+ +
+ @Html.TextBoxFor(m => m.User.mobile, new { @class = "form-control disp-init mobilefmt nocomma", @data_zero = "1", @style = "width: 300px;", @maxlength = "13" }) + @if (Model.viewname == "user") + { + + } +
@if (Model.viewname == "user") {
- -
@Html.TextBoxFor(m => m.User.telno, new { @class = "form-control disp-init telnofmt int nocomma", @data_zero = "1", @style = "width: 300px;", @maxlength = "13" })
+ +
+ @Html.Partial("./Partial/Date", Model.User.birthday == null ? (DateTime?)null : Convert.ToDateTime(Model.User.birthday), new ViewDataDictionary { { "name", "User.birthday" } }) +
} -
+ @if (Model.viewname == "user") + { +
+ +
+ @Html.TextBoxFor(m => m.User.post, new { @readonly = "readonly", @style = "width: 70px; background-color: #ddd;", @class = "postno form-control disp-init" }) 주소찾기(클릭 후 상단검색) +
@Html.TextBoxFor(m => m.User.address1, new { @readonly = "readonly", @style = "background-color: #ddd; width: 300px;", @class = "postadr form-control disp-init", @placeholder = "주소" }) + @Html.TextBoxFor(m => m.User.address2, new { @class = "postadrsub form-control disp-init", @placeholder = "상세주소", @style = "width: 400px;" }) +
+
+ } +
+
@@ -93,80 +106,71 @@
- @if (Model.viewname == "professor") + @if (Model.viewname == "user") {
- -
@Html.TextBoxFor(m => m.User.pasname, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
+ +
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:정규직;0:비정규직" }, { "checked", Model.User.isassignuser }, { "name", "User.isassignuser" } })
+
+
+ +
@Html.TextBoxFor(m => m.User.uduty, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
+
+
+ +
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "0:기타;1:고졸;2:학사;3:석사;4:박사" }, { "checked", Model.User.slevel }, { "name", "User.slevel" } })
} -
- -
@Html.TextBoxFor(m => m.User.depart, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
-
-
- -
- @Html.Partial("./Partial/Select", Model.ComCodes.Where(w => w.cgroup == "jobposition"), new ViewDataDictionary { { "special", "reg" }, { "name", "User.ccposition" }, { "selected", Model.User.ccposition }, { "df", ":-직급선택" }, { "class", "disp-init" } }) - @Html.TextBoxFor(m => m.User.ccpositionetc, new { @class = "form-control disp-init", @style = "width: 100px;" + (Model.User.ccposition == null || (Model.ComCodes.Where(w => w.ccode == Model.User.ccposition).FirstOrDefault() ?? new NP.Model.ComCode()).refcode != "9" ? "display:none;" : ""), @maxlength = "40" }) -
-
- @if (Model.viewname != "admin") + @if (Model.viewname == "professor" || Model.viewname == "admin") { -
- -
- @Html.Partial("./Partial/File", Model.FileList, new ViewDataDictionary { - { "name", "User.fgnoprofile" },{"value", Model.User.fgnoprofile },{ "fname", "file"}, - {"width", null },{"table", "users" },{ "column", "fgnoprofile"},{"filecount", 1 }, - {"readmode", 0 },{"hidemode", 0 }, - { "isimage", 1 },{ "imageid", "imgprofile" },{ "dftsrc", "/img/common/profile_sample.jpg" }, - { "fileext", "" }, { "loginfo",Model.User.userno+"|9"} - }) -
- -
-
- if (Model.viewname == "user") + if (Model.viewname == "professor") {
- + +
@Html.TextBoxFor(m => m.User.pasname, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
+
+ } + +
+ +
@Html.TextBoxFor(m => m.User.depart, new { @class = "form-control disp-init", @style = "width: 300px;", @maxlength = "50" })
+
+
+ +
+ @Html.Partial("./Partial/Select", Model.ComCodes.Where(w => w.cgroup == "jobposition"), new ViewDataDictionary { { "special", "reg" }, { "name", "User.ccposition" }, { "selected", Model.User.ccposition }, { "df", ":-직급선택" }, { "class", "disp-init" } }) + @Html.TextBoxFor(m => m.User.ccpositionetc, new { @class = "form-control disp-init", @style = "width: 100px;" + (Model.User.ccposition == null || (Model.ComCodes.Where(w => w.ccode == Model.User.ccposition).FirstOrDefault() ?? new NP.Model.ComCode()).refcode != "9" ? "display:none;" : ""), @maxlength = "40" }) +
+
+ if (Model.viewname == "professor") + { +
+
- @Html.HiddenFor(m => m.User.ccjobs) - @Html.Partial("./Partial/Checkbox", Model.ComCodes.Where(w => w.cgroup == "job"), new ViewDataDictionary { { "name", "ccjobs" }, {"autobind", "User_ccjobs" }, { "checked", Model.User.ccjobs }@*, { "fixwidth", "100px" }*@ }) + @Html.Partial("./Partial/File", Model.FileList, new ViewDataDictionary { + { "name", "User.fgnoprofile" },{"value", Model.User.fgnoprofile },{ "fname", "file"}, + {"width", null },{"table", "users" },{ "column", "fgnoprofile"},{"filecount", 1 }, + {"readmode", 0 },{"hidemode", 0 }, + { "isimage", 1 },{ "imageid", "imgprofile" },{ "dftsrc", "/img/common/profile_sample.jpg" }, + { "fileext", "" }, { "loginfo",Model.User.userno+"|9"} + }) +
+
} } @if (Model.viewname == "user" || Model.viewname == "professor") { -
- -
- @Html.TextBoxFor(m => m.User.post, new { @readonly = "readonly", @style = "width: 70px; background-color: #ddd;", @class = "postno form-control disp-init" }) 주소찾기(클릭 후 상단검색) -
@Html.TextBoxFor(m => m.User.address1, new { @readonly = "readonly", @style = "background-color: #ddd; width: 300px;", @class = "postadr form-control disp-init", @placeholder = "주소" }) - @Html.TextBoxFor(m => m.User.address2, new { @class = "postadrsub form-control disp-init", @placeholder = "상세주소", @style = "width: 400px;" }) -
-
- if (Model.viewname == "user") - { -
- -
- @Html.HiddenFor(m => m.User.userpno) - @Html.TextBox("userpno1", (Model.User.userpno ?? "").Length > 5 ? Model.User.userpno.Substring(0, 6) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 120px;", @maxlength = "6" }) - - - @Html.TextBox("userpno2", (Model.User.userpno ?? "").Length > 6 ? Model.User.userpno.Substring(6) : "", new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 120px;", @maxlength = "7" }) -
-
- } + if (Model.viewname == "professor") {
- +
@Html.HiddenFor(m => m.User.userpno) - @Html.TextBox("userpno1", (Model.User.userpno ?? "").Length > 5 ? Model.User.userpno.Substring(0, 6) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 120px;", @maxlength = "6" }) + @Html.TextBox("userpno1", (Model.User.userpno ?? "").Length > 5 ? Model.User.userpno.Substring(0, 6) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 143px;", @maxlength = "6" }) - + @Html.TextBox("userpno2", (Model.User.userpno ?? "").Length > 12 ? Model.User.userpno.Substring(6, 7) : Model.User.userpno, new { @class = "form-control disp-init int nocomma text-center", @data_zero = "1", @style = "width: 143px;", @maxlength = "7" })
@@ -176,6 +180,14 @@ @Html.TextBoxFor(m => m.User.bankno, new { @class = "form-control disp-init", @style = "width: 400px;", @maxlength = "30", @placeholder = "계좌번호입력" })
+
+ +
+ @Html.TextBoxFor(m => m.User.post, new { @readonly = "readonly", @style = "width: 70px; background-color: #ddd;", @class = "postno form-control disp-init" }) 주소찾기(클릭 후 상단검색) +
@Html.TextBoxFor(m => m.User.address1, new { @readonly = "readonly", @style = "background-color: #ddd; width: 300px;", @class = "postadr form-control disp-init", @placeholder = "주소" }) + @Html.TextBoxFor(m => m.User.address2, new { @class = "postadrsub form-control disp-init", @placeholder = "상세주소", @style = "width: 400px;" }) +
+
@Html.TextAreaFor(m => m.User.introhtml, new { @class = "form-control", @style = "resize: none; width: 90%; height: 80px; padding: 3px 5px;" })
@@ -292,6 +304,7 @@ @section scriptsHeader{ @Html.Partial("./Partial/ScriptPost") @Html.Partial("./Partial/FileScript") + @Html.Partial("./Partial/ScriptDate") @if (Model.viewname == "professor") { @Html.Partial("./Partial/Summernote") @@ -345,20 +358,19 @@ } }); } + if ('@Model.viewname' == 'admin') { + $("#User_") + } $("#User_ccposition").on("change", function () { $("#User_ccpositionetc").hide(); if ($(this).find("option:selected").attr("data-refcode") == "9") { $("#User_ccpositionetc").show().focus(); - } + } }); }); function save() { - if ('@(Model.viewname)' == 'professor') { - setv("User_userpno", val("userpno1")); - } else { - setv("User_userpno", val("userpno1") + val("userpno2")); - } + setv("User_userpno", val("userpno1") + val("userpno2")); setv("User_mobile", formatmobile(val("User_mobile"))); setv("User_telno", formatphone(val("User_telno"))); if (val("User_usertype") == "0" || val("User_usertype") == "") { focus("User_usertype");msg("권한을 선택해주세요."); } @@ -366,8 +378,8 @@ else if (val("User_userid").length < 6) {focus("User_userid"); msg("ID를 6글자 이상으로 입력해주세요.");} else if (val("User_userno") == '0' && !ispassword(val("User_userpass"))) { focus("User_userpass"); msg("6글자이상의 비밀번호를 입력해주세요."); } else if (check("User_username", null, "이름을 입력해주세요.")) { } - @*else if (('@Model.viewname' == 'professor' || '@Model.viewname' == 'user') && check("User_email",null,"이메일을 입력해주세요")) { }*@ - //else if (('@Model.viewname' == 'professor' || '@Model.viewname' == 'user') && check("User_mobile", null, "핸드폰 번호를 입력해주세요")) { } + else if (('@Model.viewname' == 'professor' || '@Model.viewname' == 'user') && check("User_email",null,"이메일을 입력해주세요")) { } + else if (('@Model.viewname' == 'professor' || '@Model.viewname' == 'user') && check("User_mobile", null, "핸드폰 번호를 입력해주세요")) { } else if (!isnulloremt(val("User_email")) && !isemail(val("User_email"))) { focus("User_email"); msg("이메일주소를 올바르게 입력해주세요."); } //else if (!isnulloremt(val("User_mobile")) && (!ismobile(val("User_mobile")) )) { focus("User_mobile"); msg("핸드폰번호를 올바르게 입력해주세요."); } else if (val("User_usertype") == "81" && val("User_asno") == "") { msg("소속을 등록해주세요.");} diff --git a/Dao/MyBatis/Maps/User.xml b/Dao/MyBatis/Maps/User.xml index 1704a78..8d001ce 100644 --- a/Dao/MyBatis/Maps/User.xml +++ b/Dao/MyBatis/Maps/User.xml @@ -229,6 +229,8 @@ ,a.kfcfyear,a.isassignuser,a.edus ,case when c.refcode='9' then a.ccpositionetc else c.cname end ccpositionname ,case when a.usertype=1 then '교육생' when d.authname is null then '-' else d.authname end usertypestr + ,CAST(AES_DECRYPT(UNHEX(a.birthday), ) AS char) birthday + ,a.uduty,a.slevel,a.isacceptmobile ,row_number() over(order by $orderby$a.username) rno ,count(a.cdt) over() pagetotalcount from users a @@ -285,12 +287,14 @@ ,gender,email,isacceptemail,mobile,telno ,asno,pasname,depart,ccposition,ccpositionetc,fgnoprofile,ccjobs ,userpno,bankname,bankno - ,post,address1,address2,introhtml,status,logintime,send335time,pwcalltime,pwcallno,eastereggkey,eetime,kfcfyear,isassignuser,edus,) + ,post,address1,address2,introhtml,status,logintime,send335time,pwcalltime,pwcallno,eastereggkey,eetime,kfcfyear,isassignuser,edus + ,isacceptmobile,uduty,slevel,jointype,birthday,) values (#usertype#,#userkind#,#userid#,#userpass#,#username#,#usernameeng# ,gender,HEX(AES_ENCRYPT(#email#, )),#isacceptemail#,HEX(AES_ENCRYPT(#mobile#, )),HEX(AES_ENCRYPT(#telno#, )) ,#asno#,#pasname#,#depart#,#ccposition#,#ccpositionetc#,#fgnoprofile#,#ccjobs# - ,HEX(AES_ENCRYPT(#userpno#, )),bankname,HEX(AES_ENCRYPT(#bankno#, )) - ,#post#,#address1#,#address2#,#introhtml#,#status#,,null,null,null,null,null,#kfcfyear#,#isassignuser#,#edus#,); + ,HEX(AES_ENCRYPT(#userpno#, )),#bankname#,HEX(AES_ENCRYPT(#bankno#, )) + ,#post#,#address1#,#address2#,#introhtml#,#status#,,null,null,null,null,null,#kfcfyear#,#isassignuser#,#edus# + ,#isacceptmobile#,#uduty#,#slevel#,0,HEX(AES_ENCRYPT(#birthday#, )),); SELECT LAST_INSERT_ID() @@ -320,6 +324,12 @@ ,address1 =case when #address1# is not null then #address1# else address1 end ,address2 =case when #address2# is not null then #address2# else address2 end ,introhtml =case when #introhtml# is not null then #introhtml# else introhtml end + ,isacceptmobile = #isacceptmobile# + ,uduty = #uduty# + ,slevel = #slevel# + ,jointype = 0 + ,isassignuser = #isassignuser# + ,birthday =case when #birthday# is not null then HEX(AES_ENCRYPT(#birthday#, )) else birthday end ,kfcfyear =case when #kfcfyear# is not null then #kfcfyear# else kfcfyear end ,isassignuser =#isassignuser#,kfcfyear =#kfcfyear#,edus=#edus# diff --git a/Model/Users.cs b/Model/Users.cs index 6c103f1..7f44417 100644 --- a/Model/Users.cs +++ b/Model/Users.cs @@ -60,6 +60,10 @@ namespace NP.Model /// public int isacceptemail { get; set; } /// + /// 휴대폰정보수신 + /// + public int isacceptmobile { get; set; } + /// /// 200 ev50 모바일번호 "-"생성 /// public String mobile { get; set; } @@ -169,8 +173,21 @@ namespace NP.Model public int? pwcallno {get;set;} public int? eastereggkey { get; set; } + /// + /// 생년월일 + /// + public String birthday { get; set; } + /// + /// 직위 + /// + public String uduty { get; set; } + /// + /// 학력 + /// + public int slevel { get; set; } + + - public String MobileFormat { get