using System; using System.Collections.Generic; using System.Text; using SEIeSCM.Models.Dto; using SEIeSCM.Models.Dto.SysLogin; using SEIeSCM.Models.Dto.Home; using SEIeSCM.Service; using System.Collections; using System.Globalization; namespace SEIeSCM { public class UserInfoManager { private static UserInfoManager userInfoManager; private IUserService UserService = new UserService(); public UserInfo GetUserInfo(string strCompanyCd, string strUserId) { SysDto cdto = this.UserService.GetUser(strCompanyCd, strUserId); if (cdto == null) { return new UserInfo(); } return new UserInfo(cdto.Sy_UserGb, cdto.Sy_CompanyCd, cdto.Sy_UserId, cdto.Sy_UserName, cdto.Sy_DeptCode, cdto.Sy_DeptName, cdto.Sy_UserChk, cdto.Sy_UserEis, cdto.Sy_UserPwd, cdto.Sy_SvCode, cdto.Sy_SvName, cdto.Sy_StoreCode, cdto.Sy_StoreType) { UserMenuList = this.GetMenuList(cdto.Sy_CompanyCd, cdto.Sy_UserId, cdto.Sy_UserGb) }; } public IList GetMenuList(string strCompanyCd, string strUserId, string strUserGb) { IList userAuthorities = this.UserService.GetMenuList(strCompanyCd, strUserId, strUserGb); return userAuthorities; } public string GetCompanyCode(string strDeptCode) { string retDeptCode = ""; return retDeptCode; } public static void Init(IUserService service) { if (service == null) { throw new Exception("UserInfoManager.Init... IUserRepository가 null입니다!"); } Instance().UserService = service; } public static UserInfoManager Instance() { if (userInfoManager == null) { userInfoManager = new UserInfoManager(); } return userInfoManager; } } }