<추가사항>

1. 개인정보수정 팝업 (p7)

 - 개인정보 수정 팝업 및 저장

 - 메뉴 등록 및 권한 추가 /user/editinfo


# 커밋 파일
Base\Controller\ACommonUser.cs
BO\Controllers\userController.cs
BO\Views\Shared\_Layout.cshtml
BO\Views\user\editinfo.cshtml
Dao\MyBatis\Maps\User.xml
Model\Common.cs
Model\Users.cs


# 테스트 결과
- 이상없음

# 특이사항 및 이슈사항
- 이상없음
This commit is contained in:
swpark 2021-12-08 08:28:59 +00:00
parent 3c421e9d6a
commit 449a5802dd
6 changed files with 106 additions and 3 deletions

View File

@ -302,5 +302,40 @@ namespace NP.BO.Controllers
vm.User = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "includesysadmin", 1 } }).First();
return View(vm);
}
/// <summary>
/// 개인정보 수정(우측 상단 드랍박스 내)
/// </summary>
/// <param name="vm"></param>
/// <returns></returns>
public ActionResult editinfo(VMUser vm)
{
ViewBag.isadmin = SUserInfo.IsAdmin;
ViewBag.issiteadmin = SUserInfo.IsSiteAdmin;
ViewBag.isprofessor = SUserInfo.IsTeacher;
vm.FileList = new List<File>() { };
vm.User = Dao.Get<Users>("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo }, { "includesysadmin", 1 } }).First();
if (SUserInfo.IsTeacher)
{
vm.ComCodes = GetComCodes("jobposition,job", true);
for (int i = vm.ComCodes.Count() - 1; i > -1; i--)
{
if (vm.ComCodes[i].isuse == 0 && (vm.ComCodes[i].cgroup != "jobposition" || (vm.ComCodes[i].cgroup == "jobposition" && vm.ComCodes[i].refcode != "9")))
{
vm.ComCodes.RemoveAt(i);
}
}
}
else
{
vm.ComCodes = GetComCodes("jobposition,job");
}
if ((vm.User.fgnoprofile ?? 0) > 0)
{
vm.FileList = GetFiles(vm.User.fgnoprofile.Value);
}
return View(vm);
}
}
}

View File

@ -96,6 +96,7 @@
{
<li><a href="~/Content/file/YNICTEManual@(ViewBag.SSUserType == 11 ? "axds" : (ViewBag.SSUserType == 81) ? "axds" : "axds").pdf" target="_blank">매뉴얼 다운로드</a></li>
}
<li><a href="#" onclick="showramemainlayer('/user/editinfo');" title="개인정보수정">개인정보수정</a></li>
<li><a href="/Account/Logout" title="로그아웃">로그아웃</a></li>
</ul>
</li>

View File

@ -295,6 +295,50 @@ namespace NP.Base.Controllers
}
return JsonOK(0);
}
/// <summary>
/// 개인정보수정
/// </summary>
/// <param name="vm"></param>
/// <returns></returns>
[HttpPost]
[ValidateInput(false)]
public JsonResult UserEdit(VMUser vm)
{
vm.User.uno = SUserInfo.UserNo; vm.User.uip = GetUserIP();
if (!string.IsNullOrEmpty(vm.User.userpass)) { vm.User.userpass = NP.Base.Lib.KISA_SHA256.SHA256Hash(vm.User.userpass); }
vm.User.userid = vm.User.userid.Trim();
if (!string.IsNullOrEmpty(vm.User.email)) { vm.User.email = vm.User.email.Trim(); }
vm.User.mobile = vm.User.MobileFormat;
var check = Dao.Get<int>("users.checkuser", new Hashtable() { { "usernonot", vm.User.userno > 0 ? vm.User.userno : (int?)null }, { "userid", vm.User.userno > 0 ? null : vm.User.userid }, { "email", vm.User.email }, { "mobile", string.IsNullOrEmpty(vm.User.mobile) ? null : vm.User.mobile } }).First();
if (check < 9)
{
if (vm.User.usertype == 1 || check != 3)
{
return JsonOK(check * -1);
}
}
if (Request.Files.GetMultiple("file").Where(w => !string.IsNullOrEmpty(w.FileName)).Count() > 0)
{
vm.User.fgnoprofile = SetFile(Request.Files.GetMultiple("file").Where(w => !string.IsNullOrEmpty(w.FileName)).ToList(), vm.User.fgnoprofile ?? 0, "users", "fgnoprofile");
}
if (vm.User.usertype > 90)
{
vm.User.asno = 1;
}
LogSet(new ActLog() { logtype = 30, logtarget = 21, logdata = vm.User.username + "(" + vm.User.userid + ")", userno = vm.User.userno, uno = SUserInfo.UserNo, uip = GetUserIP() });
if (vm.User.usertype > 1)
{
AuthSet(new AuthLog() { uno = SUserInfo.UserNo, uip = GetUserIP(), logtype = 1, usertypenew = vm.User.usertype, userno = vm.User.userno });
}
return JsonOK(Dao.Save("users.edit", vm.User));
}
}
}

View File

@ -852,7 +852,30 @@
from users a
where a.usertype =1 and a.status=1
and date_format(date_add(a.logintime, interval 366 day),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
</select>
</select>
<update id="users.edit" parameterClass="hashtable">
update users set <include refid="sql.up"></include>
,usertype=#usertype#
<isNotNull property="userpass">,userpass =#userpass#</isNotNull>
,username =case when #username# is not null then #username# else username end
,email =HEX(AES_ENCRYPT(#email#, <include refid="sql.digest"></include>))
,mobile =HEX(AES_ENCRYPT(#mobile#, <include refid="sql.digest"></include>))
,asno =case when #asno# is not null then #asno# else asno end
,depart =#depart#
,ccposition =case when #ccposition# is not null then #ccposition# else ccposition end
,ccpositionetc =case when #ccpositionetc# is not null then #ccpositionetc# else ccpositionetc end
<isNotNull property="fgnoprofile">,fgnoprofile =#fgnoprofile#</isNotNull>
,userpno =case when #userpno# is not null then HEX(AES_ENCRYPT(#userpno#, <include refid="sql.digest"></include>)) else userpno end
,bankname =case when #bankname# is not null then #bankname# else bankname end
,bankno =case when #bankno# is not null then HEX(AES_ENCRYPT(#bankno#, <include refid="sql.digest"></include>)) else bankno 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
,introhtml =case when #introhtml# is not null then #introhtml# else introhtml end
where userno=#userno#
</update>
</statements>
</sqlMap>

View File

@ -113,7 +113,7 @@ namespace NP.Model
{
get
{
return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : "-";
return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : usertype == 95 ? "일반관리자" : "-";
}
}
public String msgid { get; set; }

View File

@ -29,7 +29,7 @@ namespace NP.Model
{
get
{
return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : "-";
return usertype == 1 ? "교육생" : usertype == 11 ? "교강사" : usertype == 81 ? "고객사관리자" : usertype == 91 ? "통합관리자" : usertype == 92 ? "일반관리자" : usertype == 95 ? "일반관리자" : "-";
}
}
/// <summary>