"주민등록번호 아래에 생년월일 칸 추가 (birth)
- 입력/수정 불가 - 주민등록번호 앞 6자리 정보를 저장 및 출력 - 주민등록번호 앞 6자리가 날짜 정보와 일치하지 않다면 (예, 123456) 저장 버튼 클릭 시 '주민등록번호를 확인해주세요' alert 출력 * 만일 주민등록번호 앞 6자리 정보를 가져오기 어렵다면 생년월일 입력/수정 칸 추가"
This commit is contained in:
parent
8ae87d9b52
commit
6fc6d67ce2
|
|
@ -46,7 +46,7 @@
|
||||||
@if (Model.viewname == "user")
|
@if (Model.viewname == "user")
|
||||||
{
|
{
|
||||||
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
|
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
|
||||||
<label class="col-sm-4 col-md-2 control-label">주민등록번호</label>
|
<label class="col-sm-4 col-md-2 control-label @(Model.viewname =="user" ? "req" : "")">주민등록번호</label>
|
||||||
<div class="col-sm-8 col-md-10">
|
<div class="col-sm-8 col-md-10">
|
||||||
@Html.HiddenFor(m => m.User.userpno)
|
@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("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" }) -
|
||||||
|
|
@ -80,8 +80,12 @@
|
||||||
</div>
|
</div>
|
||||||
@if (Model.viewname == "user")
|
@if (Model.viewname == "user")
|
||||||
{
|
{
|
||||||
@Html.HiddenFor(w => w.User.birthday)
|
<div class="line line-dashed line-lg pull-in"></div><div class="form-group">
|
||||||
@*@Html.Partial("./Partial/Date", Model.User.birthday == null ? (DateTime?)null : Convert.ToDateTime(Model.User.birthday), new ViewDataDictionary { { "name", "User.birthday" } })*@
|
<label class="col-sm-4 col-md-2 control-label @(Model.viewname =="user" ? "req" : "") ">생년월일</label>
|
||||||
|
<div class="col-sm-8 col-md-10">
|
||||||
|
@Html.TextBoxFor(m => m.User.birthday, new { @readonly = "readonly", @style = "width: 300px; background-color: #ddd;", @class = "postno form-control disp-init" })
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
@if (Model.viewname == "user")
|
@if (Model.viewname == "user")
|
||||||
{
|
{
|
||||||
|
|
@ -392,6 +396,7 @@
|
||||||
</style>
|
</style>
|
||||||
}
|
}
|
||||||
@section scripts{
|
@section scripts{
|
||||||
|
<script src="~/js/moment.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function gotab(idx) {
|
function gotab(idx) {
|
||||||
$("#tabidx").val(idx);
|
$("#tabidx").val(idx);
|
||||||
|
|
@ -451,22 +456,74 @@
|
||||||
$("#User_ccpositionetc").show().focus();
|
$("#User_ccpositionetc").show().focus();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$("#userpno1, #userpno2").on("keyup", function () {
|
||||||
|
var birthday = makebirthday(val("userpno1") + val("userpno2"));
|
||||||
|
if (birthday != "") {
|
||||||
|
setv("User_birthday", birthday);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (val("User_birthday") == "") {
|
||||||
|
setv("User_birthday", makebirthday(val("userpno1") + val("userpno2")));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
function makebirthday(userpno) {
|
||||||
|
var birthday = "";
|
||||||
|
|
||||||
|
if (userpno.length == 13 && moment(userpno.substr(0, 6), 'YYMMDD', true).isValid() && userpno.substr(6, 1) > 0)
|
||||||
|
{
|
||||||
|
switch (userpno.substr(6, 1))
|
||||||
|
{
|
||||||
|
case "1":
|
||||||
|
birthday = "19";
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
birthday = "19";
|
||||||
|
break;
|
||||||
|
case "3":
|
||||||
|
birthday = "20";
|
||||||
|
break;
|
||||||
|
case "4":
|
||||||
|
birthday = "20";
|
||||||
|
break;
|
||||||
|
case "5":
|
||||||
|
birthday = "19";
|
||||||
|
break;
|
||||||
|
case "6":
|
||||||
|
birthday = "19";
|
||||||
|
break;
|
||||||
|
case "7":
|
||||||
|
birthday = "20";
|
||||||
|
break;
|
||||||
|
case "8":
|
||||||
|
birthday = "20";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
birthday += userpno.substr(0, 2) + "-" + userpno.substr(2, 2) + "-" + userpno.substr(4, 2);
|
||||||
|
}
|
||||||
|
return birthday
|
||||||
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
setv("User_userpno", val("userpno1")+val("userpno2"));
|
setv("User_userpno", val("userpno1")+val("userpno2"));
|
||||||
setv("User_mobile", formatmobile(val("User_mobile")));
|
setv("User_mobile", formatmobile(val("User_mobile")));
|
||||||
setv("User_telno", formatphone(val("User_telno")));
|
setv("User_telno", formatphone(val("User_telno")));
|
||||||
|
setv("User_birthday", makebirthday(val("userpno1") + val("userpno2")));
|
||||||
if (val("User_usertype") == "0" || val("User_usertype") == "") { focus("User_usertype");msg("권한을 선택해주세요."); }
|
if (val("User_usertype") == "0" || val("User_usertype") == "") { focus("User_usertype");msg("권한을 선택해주세요."); }
|
||||||
else if (check("User_userid", null, "ID를 입력해주세요.")) { }
|
else if (check("User_userid", null, "ID를 입력해주세요.")) { }
|
||||||
else if (val("User_userid").length < 6) {focus("User_userid"); msg("ID를 6글자 이상으로 입력해주세요.");}
|
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 (val("User_userno") == '0' && !ispassword(val("User_userpass"))) { focus("User_userpass"); msg("6글자이상의 비밀번호를 입력해주세요."); }
|
||||||
else if (val("userpno1") != "" && val("userpno2") == "") { focus("userpno2"); msg("주민등록번호를 제대로 입력해주세요."); }
|
else if (val("userpno1") != "" && val("userpno2") == "") { focus("userpno2"); msg("주민등록번호를 제대로 입력해주세요."); }
|
||||||
else if ((val("userpno1") != "" && val("userpno2") != "") && $("#User_userpno").val().length < 13) { focus("userpno2"); msg("주민등록번호를 제대로 입력해주세요."); }
|
else if ((val("userpno1") != "" && val("userpno2") != "") && $("#User_userpno").val().length < 13) { focus("userpno2"); msg("주민등록번호를 제대로 입력해주세요."); }
|
||||||
|
else if (!moment(val("userpno1"), 'YYMMDD', true).isValid()) { focus("userpno1"); msg("주민등록번호를 제대로 입력해주세요."); }
|
||||||
|
else if (!moment(val("User_birthday"), 'YYYY-MM-DD',true).isValid()) { focus("userpno2"); msg("주민등록번호를 제대로 입력해주세요."); }
|
||||||
else if (check("User_username", null, "이름을 입력해주세요.")) { }
|
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_email",null,"이메일을 입력해주세요")) { }
|
||||||
else if (('@Model.viewname' == 'professor' || '@Model.viewname' == 'user') && check("User_mobile", 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_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 (!isnulloremt(val("User_mobile")) && (!ismobile(val("User_mobile")) )) { focus("User_mobile"); msg("핸드폰번호를 올바르게 입력해주세요."); }
|
||||||
//else if ((val("User_usertype") == "1" || val("User_usertype") == "81") && val("User_asno") == "") { msg("소속을 등록해주세요.");}
|
//else if ((val("User_usertype") == "1" || val("User_usertype") == "81") && val("User_asno") == "") { msg("소속을 등록해주세요.");}
|
||||||
else if (confirm("저장하시겠습니까?")) {
|
else if (confirm("저장하시겠습니까?")) {
|
||||||
|
|
|
||||||
|
|
@ -1338,15 +1338,11 @@ namespace NP.Base.Controllers
|
||||||
completion.edate = new DateTime(completion.edate.Value.Year, completion.edate.Value.Month, completion.edate.Value.Day, 23, 59, 59);
|
completion.edate = new DateTime(completion.edate.Value.Year, completion.edate.Value.Month, completion.edate.Value.Day, 23, 59, 59);
|
||||||
}
|
}
|
||||||
|
|
||||||
var check = Dao.Get<int>("users.checkuser", new Hashtable() { { "usernonot", completion.userno }, { "mobile", completion.mobile }, { "userpno", completion.userpno } }).First();
|
var check = Dao.Get<int>("users.checkuser", new Hashtable() { { "usernonot", completion.userno }, { "mobile", completion.mobile }}).First();
|
||||||
if (check == 3)
|
if (check == 3)
|
||||||
{
|
{
|
||||||
return JsonError(JSONCode.Error, "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.", false);
|
return JsonError(JSONCode.Error, "이미 해당 휴대폰번호로 등록된 회원이 존재합니다.", false);
|
||||||
}
|
}
|
||||||
else if (check == 4)
|
|
||||||
{
|
|
||||||
return JsonError(JSONCode.Error, "이미 해당 주민번호로 등록된 회원이 존재합니다.", false);
|
|
||||||
}
|
|
||||||
return JsonOK(Dao.Save("cr.completion.up", completion));
|
return JsonOK(Dao.Save("cr.completion.up", completion));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue