/// <summary> /// 构造函数 /// </summary> public LoginForm() { InitializeComponent(); this.Loaded += new RoutedEventHandler(LoginForm_Loaded); this.KeyUp += new System.Windows.Input.KeyEventHandler(LoginForm_KeyUp); sysloginClinet = new MainUIServicesClient(); sysloginClinet.SystemLoginCompleted += new EventHandler <SystemLoginCompletedEventArgs>(sysloginClinet_SystemLoginCompleted); EmployeeInfoClient = new EmployeeInfoServiceClient(); EmployeeInfoClient.getEmployeeInfobyLoginCompleted += new EventHandler <getEmployeeInfobyLoginCompletedEventArgs>(EmployeeInfoClient_getEmployeeInfobyLoginCompleted);; employee = new V_EMPLOYEEDETAIL(); MainPageManeger = new MainPagePartManager(); MainPageManeger.NotifyUserMessageEvent += MainPageManeger_NotifyUserMessageEvent; MainPageManeger.isFirstUser = this.isFirstUser; MainPageManeger.LoadXapName = "SMT.SAAS.Platform.xap"; MainPageManeger.VertionFileName = "DllVersion.xml"; MainPageManeger.LoadDLLCompleted += new EventHandler(loadMainPage_LoadCompleted); MainPageManeger.UpdateDllCompleted += new EventHandler(MainPageManeger_UpdateDllCompleted); #if DEBUG //this.txbUserName.Text = "smtwangl"; //this.txbUserPassword.Password = "******"; #endif }
/// <summary> /// 构造函数 /// </summary> public LoginForm() { InitializeComponent(); this.Loaded += new RoutedEventHandler(LoginForm_Loaded); this.KeyUp += new System.Windows.Input.KeyEventHandler(LoginForm_KeyUp); sysloginClinet = new MainUIServicesClient(); sysloginClinet.SystemLoginCompleted += new EventHandler<SystemLoginCompletedEventArgs>(sysloginClinet_SystemLoginCompleted); EmployeeInfoClient = new EmployeeInfoServiceClient(); EmployeeInfoClient.getEmployeeInfobyLoginCompleted += new EventHandler<getEmployeeInfobyLoginCompletedEventArgs>(EmployeeInfoClient_getEmployeeInfobyLoginCompleted); ; employee = new V_EMPLOYEEDETAIL(); MainPageManeger = new MainPagePartManager(); MainPageManeger.NotifyUserMessageEvent += MainPageManeger_NotifyUserMessageEvent; MainPageManeger.isFirstUser = this.isFirstUser; MainPageManeger.LoadXapName = "SMT.SAAS.Platform.xap"; MainPageManeger.VertionFileName = "DllVersion.xml"; MainPageManeger.LoadDLLCompleted += new EventHandler(loadMainPage_LoadCompleted); MainPageManeger.UpdateDllCompleted += new EventHandler(MainPageManeger_UpdateDllCompleted); #if DEBUG //this.txbUserName.Text = "smtwangl"; //this.txbUserPassword.Password = "******"; #endif }
/// <summary> /// 构造函数 /// </summary> public LoginForm() { InitializeComponent(); this.Loaded += new RoutedEventHandler(LoginForm_Loaded); this.KeyUp += new System.Windows.Input.KeyEventHandler(LoginForm_KeyUp); sysloginClinet = new MainUIServicesClient(); sysloginClinet.SystemLoginCompleted += new EventHandler <SystemLoginCompletedEventArgs>(sysloginClinet_SystemLoginCompleted); EmployeeInfoClient = new EmployeeInfoServiceClient(); EmployeeInfoClient.getEmployeeInfobyLoginCompleted += new EventHandler <getEmployeeInfobyLoginCompletedEventArgs>(EmployeeInfoClient_getEmployeeInfobyLoginCompleted);; employee = new V_EMPLOYEEDETAIL(); MainPageManeger = new MainPagePartManager(); MainPageManeger.Loginform = this; MainPageManeger.isFirstUser = this.isFirstUser; MainPageManeger.dllVersionFilePath = this.dllVersionFilePath; MainPageManeger.LoadCompleted += new EventHandler(loadMainPage_LoadCompleted); MainPageManeger.UpdateDllCompleted += new EventHandler(MainPageManeger_UpdateDllCompleted); if (Application.Current.Resources["username"] != null && Application.Current.Resources["userpwd"] != null) { Root.Visibility = Visibility.Collapsed; } }
/// <summary> /// 构造函数 /// </summary> public LoginForm() { InitializeComponent(); this.Loaded += new RoutedEventHandler(LoginForm_Loaded); this.KeyUp += new System.Windows.Input.KeyEventHandler(LoginForm_KeyUp); sysloginClinet = new MainUIServicesClient(); sysloginClinet.SystemLoginCompleted += new EventHandler<SystemLoginCompletedEventArgs>(sysloginClinet_SystemLoginCompleted); EmployeeInfoClient = new EmployeeInfoServiceClient(); EmployeeInfoClient.getEmployeeInfobyLoginCompleted += new EventHandler<getEmployeeInfobyLoginCompletedEventArgs>(EmployeeInfoClient_getEmployeeInfobyLoginCompleted); ; employee = new V_EMPLOYEEDETAIL(); MainPageManeger = new MainPagePartManager(); MainPageManeger.Loginform = this; MainPageManeger.isFirstUser = this.isFirstUser; MainPageManeger.dllVersionFilePath = this.dllVersionFilePath; MainPageManeger.LoadCompleted += new EventHandler(loadMainPage_LoadCompleted); MainPageManeger.UpdateDllCompleted += new EventHandler(MainPageManeger_UpdateDllCompleted); }
/// <summary> /// 注册服务 /// </summary> private void RegisterServices() { HtmlPage.RegisterScriptableObject("MvcToSl", this); spAddSpace.Visibility = System.Windows.Visibility.Collapsed; sysloginClinet = new MainUIServicesClient(); sysloginClinet.GetUserInfobyIDCompleted += new EventHandler <GetUserInfobyIDCompletedEventArgs>(sysloginClinet_GetUserInfobyIDCompleted); employeeInfoClient = new EmployeeInfoServiceClient(); employeeInfoClient.getEmployeeInfobyLoginCompleted += new EventHandler <getEmployeeInfobyLoginCompletedEventArgs>(EmployeeInfoClient_getEmployeeInfobyLoginCompleted);; webcDllVersion = new WebClient(); webcDllVersion.OpenReadCompleted += new OpenReadCompletedEventHandler(webcDllVersion_OpenReadCompleted); wDownloadDllClinet = new WebClient(); wDownloadDllClinet.OpenReadCompleted += new OpenReadCompletedEventHandler(webcDownloadDll_OpenReadCompleted); wDownloadDllClinet.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadDllClinet_DownloadProgressChanged); dllVersionFilePath = strApplicationPath + @"/" + "DllVersion.xml"; employee = new V_EMPLOYEEDETAIL(); }
public V_EMPLOYEEDETAIL getEmployeeInfobyLogin(string employeeid) { try { using (EmployeeBLL bll = new EmployeeBLL()) { V_EMPLOYEEDETAIL employee = bll.GetEmployeeDetailView(employeeid); if (employee == null) { Tracer.Debug("通过员工id获取到员工详细信息为空,员工id:" + employeeid); return(null); } return(employee); } } catch (Exception ex) { Tracer.Debug("通过员工id获取到员工详细信息出错,员工id:" + employeeid + ex.ToString()); throw ex; } }
/// <summary> /// 获取员工信息事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void EmployeeInfoClient_getEmployeeInfobyLoginCompleted(object sender, getEmployeeInfobyLoginCompletedEventArgs e) { dtend = DateTime.Now; string strmsg = "登录系统完成耗时: " + (dtend - dtstart).Milliseconds.ToString() + " 毫秒"; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg); if (e.Error != null && e.Error.Message != "") { NotifyUserMessage("获取员工信息错误,请联系管理员"); SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(e.Error.Message); MessageBox.Show(e.Error.ToString()); SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText(); } else { if (e.Result != null) { employee = e.Result; employee.sysuser = sysUser; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("已获取到employee信息"); NotifyUserMessage("获取员工信息成功,正在初始化系统,请稍等......"); bool isAdmin = employee.sysuser.ISMANAGER == "1" ? true : false; var postlist = from ent in employee.EMPLOYEEPOSTS orderby ent.ISAGENCY select new SMT.SaaS.LocalData.V_EMPLOYEEPOSTBRIEF { EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID, POSTID = ent.POSTID, PostName = ent.PostName, DepartmentID = ent.DepartmentID, DepartmentName = ent.DepartmentName, CompanyID = ent.CompanyID, CompanyName = ent.CompanyName, ISAGENCY = ent.ISAGENCY, POSTLEVEL = ent.POSTLEVEL }; SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo = SMT.SAAS.Main.CurrentContext.Common.GetLoginUserInfo( employee.EMPLOYEEID, employee.EMPLOYEENAME, employee.EMPLOYEECODE, employee.EMPLOYEESTATE, employee.sysuser.SYSUSERID,employee.MOBILE,employee.OFFICEPHONE, employee.SEX, postlist.ToList(), employee.WORKAGE, employee.PHOTO, isAdmin); SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.PermissionInfoUI = new List<V_UserPermissionUI>(); //SMT.SAAS.Main.CurrentContext.LoginUserInfo.LoginRecordID = _LoginRecord; SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserName = txbUserName.Text; if (isFirstUser == true) { NotifyUserMessage("登录成功,开始获取系统更新,请稍等......"); isUserloginComplete = true; MainPageManeger.dllVersionUpdataCheck(); } else { //MainPage = asmMain.CreateInstance("SMT.SAAS.Platform.Xamls.MainPage") as UIElement; MainPageManeger.RunWorkerLoadAssemblyPart(); } } else { txtLoadingMessage.Text = "获取员工信息出错,请联系管理员"; btnLogin.IsEnabled = true; return; } } }
/// <summary> /// 获取员工信息事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void EmployeeInfoClient_getEmployeeInfobyLoginCompleted(object sender, getEmployeeInfobyLoginCompletedEventArgs e) { dtend = DateTime.Now; string strmsg = "登录系统完成耗时: " + (dtend - dtstart).Milliseconds.ToString() + " 毫秒"; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg); if (e.Error != null && !string.IsNullOrWhiteSpace(e.Error.Message)) { txtUserMsg.Text = "获取员工信息错误,请联系管理员"; HtmlPage.Window.Invoke("loadCompletedSL", new string[] { "false",txtUserMsg.Text }); SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(e.Error.Message); MessageBox.Show(e.Error.ToString()); SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText(); } else { if (e.Result != null) { employee = e.Result; employee.sysuser = sysUser; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("已获取到employee信息"); txtUserMsg.Text = "获取员工信息成功,开始获取系统更新,请稍等......"; bool isAdmin = employee.sysuser.ISMANAGER == "1" ? true : false; var postlist = from ent in employee.EMPLOYEEPOSTS orderby ent.ISAGENCY select new SMT.SaaS.LocalData.V_EMPLOYEEPOSTBRIEF { EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID, POSTID = ent.POSTID, PostName = ent.PostName, DepartmentID = ent.DepartmentID, DepartmentName = ent.DepartmentName, CompanyID = ent.CompanyID, CompanyName = ent.CompanyName, ISAGENCY = ent.ISAGENCY, POSTLEVEL = ent.POSTLEVEL }; SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo = SMT.SAAS.Main.CurrentContext.Common.GetLoginUserInfo( employee.EMPLOYEEID, employee.EMPLOYEENAME, employee.EMPLOYEECODE, employee.EMPLOYEESTATE, employee.sysuser.SYSUSERID, employee.MOBILE, employee.OFFICEPHONE, employee.SEX, postlist.ToList(), employee.WORKAGE, employee.PHOTO, isAdmin); SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.PermissionInfoUI = new List<V_UserPermissionUI>(); SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserName = Application.Current.Resources["username"].ToString(); if (isFirstUser == true) { txtUserMsg.Text = "员工信息验证通过,开始获取系统更新,请稍等......"; dllVersionUpdataCheck(); } else { uMainPage = asmMain.CreateInstance("SMT.SAAS.Platform.Xamls.MVCMainPage") as UIElement; AppContext.AppHost.SetRootVisual(uMainPage); } } else { txtUserMsg.Text = "获取员工信息出错,请联系管理员"; return; } } }
/// <summary> /// 注册服务 /// </summary> private void RegisterServices() { HtmlPage.RegisterScriptableObject("MvcToSl", this); spAddSpace.Visibility = System.Windows.Visibility.Collapsed; sysloginClinet = new MainUIServicesClient(); sysloginClinet.GetUserInfobyIDCompleted += new EventHandler<GetUserInfobyIDCompletedEventArgs>(sysloginClinet_GetUserInfobyIDCompleted); employeeInfoClient = new EmployeeInfoServiceClient(); employeeInfoClient.getEmployeeInfobyLoginCompleted += new EventHandler<getEmployeeInfobyLoginCompletedEventArgs>(EmployeeInfoClient_getEmployeeInfobyLoginCompleted); ; webcDllVersion = new WebClient(); webcDllVersion.OpenReadCompleted += new OpenReadCompletedEventHandler(webcDllVersion_OpenReadCompleted); wDownloadDllClinet = new WebClient(); wDownloadDllClinet.OpenReadCompleted += new OpenReadCompletedEventHandler(webcDownloadDll_OpenReadCompleted); wDownloadDllClinet.DownloadProgressChanged += new DownloadProgressChangedEventHandler(DownloadDllClinet_DownloadProgressChanged); dllVersionFilePath = strApplicationPath + @"/" + "DllVersion.xml"; employee = new V_EMPLOYEEDETAIL(); }
void personclient_GetEmployeePostBriefByEmployeeIDCompleted(object sender, GetEmployeePostBriefByEmployeeIDCompletedEventArgs e) { try { if (e.Error == null) { string StrName = ""; if (e.Result != null) { //postLevel = e.Result.EMPLOYEEPOSTS[0].POSTLEVEL.ToString(); V_EMPLOYEEDETAIL employeepost = new V_EMPLOYEEDETAIL(); employeepost = e.Result; //string PostName = ""; //string DepartmentName = ""; //string CompanyName = ""; if (Application.Current.Resources["SYS_PostInfo"] != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>) != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID) != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault() != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().T_HR_POSTDICTIONARY != null) { StrPostName = (Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().T_HR_POSTDICTIONARY.POSTNAME; } } } } } //ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrPostName,Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); if (Application.Current.Resources["SYS_DepartmentInfo"] != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>) != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID) != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID).FirstOrDefault() != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID).FirstOrDefault().T_HR_DEPARTMENTDICTIONARY != null) { StrDepartmentName = (Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID).FirstOrDefault().T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME; } } } } } if (Application.Current.Resources["SYS_CompanyInfo"] != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>) != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == approvalInfo.OWNERCOMPANYID) != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == approvalInfo.OWNERCOMPANYID).FirstOrDefault() != null) { StrCompanyName = (Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == approvalInfo.OWNERCOMPANYID).FirstOrDefault().CNAME; } } } } if (employeepost.EMPLOYEEPOSTS != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID) != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault() != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().POSTLEVEL != null) { postLevel = employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().POSTLEVEL.ToString();//获取申请人的岗位级别 } } } } //CompanyName = e.Result.EMPLOYEEPOSTS[0].T_HR_POST.T_HR_DEPARTMENT.T_HR_COMPANY.CNAME; StrName = e.Result.EMPLOYEENAME + "-" + StrPostName + "-" + StrDepartmentName + "-" + StrCompanyName; } else { if (approvalInfo != null) { StrName = approvalInfo.OWNERNAME; } } if (!string.IsNullOrEmpty(StrName)) { txtOwnerName.Text = StrName; ToolTipService.SetToolTip(txtOwnerName, StrName); } RefreshUI(RefreshedTypes.AuditInfo); } } catch (Exception ex) { Logger.Current.Log("事项审批中获取员工详细信息" + ex.Message, Category.Debug, Priority.Low); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "获取员工信息失败", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); return; } }
void personClient_GetEmployeePostBriefByEmployeeIDCompleted(object sender, GetEmployeePostBriefByEmployeeIDCompletedEventArgs e) { if (e.Error == null) { if (e.Result != null) { string PostName = ""; string DepartmentName = ""; string CompanyName = ""; string StrName = ""; string StrOwnerName = ""; V_EMPLOYEEDETAIL employeepost = new V_EMPLOYEEDETAIL(); employeepost = e.Result; if (Application.Current.Resources["SYS_PostInfo"] != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>) != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == BorrowMasterEntity.OWNERPOSTID) != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == BorrowMasterEntity.OWNERPOSTID).FirstOrDefault() != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == BorrowMasterEntity.OWNERPOSTID).FirstOrDefault().T_HR_POSTDICTIONARY != null) { PostName = (Application.Current.Resources["SYS_PostInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == BorrowMasterEntity.OWNERPOSTID).FirstOrDefault().T_HR_POSTDICTIONARY.POSTNAME; } } } } } //ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrPostName,Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); if (Application.Current.Resources["SYS_DepartmentInfo"] != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>) != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == BorrowMasterEntity.OWNERDEPARTMENTID) != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == BorrowMasterEntity.OWNERDEPARTMENTID).FirstOrDefault() != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == BorrowMasterEntity.OWNERDEPARTMENTID).FirstOrDefault().T_HR_DEPARTMENTDICTIONARY != null) { DepartmentName = (Application.Current.Resources["SYS_DepartmentInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == BorrowMasterEntity.OWNERDEPARTMENTID).FirstOrDefault().T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME; } } } } } if (Application.Current.Resources["SYS_CompanyInfo"] != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>) != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == BorrowMasterEntity.OWNERCOMPANYID) != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == BorrowMasterEntity.OWNERCOMPANYID).FirstOrDefault() != null) { CompanyName = (Application.Current.Resources["SYS_CompanyInfo"] as List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == BorrowMasterEntity.OWNERCOMPANYID).FirstOrDefault().CNAME; } } } } StrOwnerName = e.Result.EMPLOYEENAME; if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == BorrowMasterEntity.OWNERPOSTID) != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == BorrowMasterEntity.OWNERPOSTID).FirstOrDefault() != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == BorrowMasterEntity.OWNERPOSTID).FirstOrDefault().POSTLEVEL != null) { txPostLevel = employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == BorrowMasterEntity.OWNERPOSTID).FirstOrDefault().POSTLEVEL.ToString();//获取出差人的岗位级别 } } } StrName = e.Result.EMPLOYEENAME + "-" + PostName + "-" + DepartmentName + "-" + CompanyName; txtOwnerName.Text = StrName; ToolTipService.SetToolTip(txtOwnerName, StrName); if (types != FormTypes.Resubmit) { RefreshUI(RefreshedTypes.All); } RefreshUI(RefreshedTypes.AuditInfo); } } }
void personclient_GetEmployeePostBriefByEmployeeIDCompleted(object sender, GetEmployeePostBriefByEmployeeIDCompletedEventArgs e) { try { if (e.Error == null) { string StrName = ""; if (e.Result != null) { //postLevel = e.Result.EMPLOYEEPOSTS[0].POSTLEVEL.ToString(); V_EMPLOYEEDETAIL employeepost = new V_EMPLOYEEDETAIL(); employeepost = e.Result; //string PostName = ""; //string DepartmentName = ""; //string CompanyName = ""; if (Application.Current.Resources["SYS_PostInfo"] != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>) != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID) != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault() != null) { if ((Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().T_HR_POSTDICTIONARY != null) { StrPostName = (Application.Current.Resources["SYS_PostInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_POST>).Where(c => c.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().T_HR_POSTDICTIONARY.POSTNAME; } } } } } //ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), StrPostName,Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); if (Application.Current.Resources["SYS_DepartmentInfo"] != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>) != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID) != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID).FirstOrDefault() != null) { if ((Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID).FirstOrDefault().T_HR_DEPARTMENTDICTIONARY != null) { StrDepartmentName = (Application.Current.Resources["SYS_DepartmentInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_DEPARTMENT>).Where(c => c.DEPARTMENTID == approvalInfo.OWNERDEPARTMENTID).FirstOrDefault().T_HR_DEPARTMENTDICTIONARY.DEPARTMENTNAME; } } } } } if (Application.Current.Resources["SYS_CompanyInfo"] != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>) != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == approvalInfo.OWNERCOMPANYID) != null) { if ((Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == approvalInfo.OWNERCOMPANYID).FirstOrDefault() != null) { StrCompanyName = (Application.Current.Resources["SYS_CompanyInfo"] as List <SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>).Where(c => c.COMPANYID == approvalInfo.OWNERCOMPANYID).FirstOrDefault().CNAME; } } } } if (employeepost.EMPLOYEEPOSTS != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID) != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault() != null) { if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().POSTLEVEL != null) { postLevel = employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == approvalInfo.OWNERPOSTID).FirstOrDefault().POSTLEVEL.ToString();//获取申请人的岗位级别 } } } } StrName = e.Result.EMPLOYEENAME + "-" + StrPostName + "-" + StrDepartmentName + "-" + StrCompanyName; } else { if (approvalInfo != null) { StrName = approvalInfo.OWNERNAME; } } if (!string.IsNullOrEmpty(StrName)) { txtOwnerName.Text = StrName; ToolTipService.SetToolTip(txtOwnerName, StrName); } RefreshUI(RefreshedTypes.AuditInfo); } } catch (Exception ex) { Logger.Current.Log("事项审批中获取员工详细信息" + ex.Message, Category.Debug, Priority.Low); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), "获取员工信息失败", Utility.GetResourceStr("CONFIRM"), MessageIcon.Exclamation); return; } }
/// <summary> /// 获取员工信息事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void EmployeeInfoClient_getEmployeeInfobyLoginCompleted(object sender, getEmployeeInfobyLoginCompletedEventArgs e) { dtend = DateTime.Now; string strmsg = "登录系统完成耗时: " + (dtend - dtstart).Milliseconds.ToString() + " 毫秒"; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg); if (e.Error != null && !string.IsNullOrWhiteSpace(e.Error.Message)) { txtUserMsg.Text = "获取员工信息错误,请联系管理员"; HtmlPage.Window.Invoke("loadCompletedSL", new string[] { "false", txtUserMsg.Text }); SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(e.Error.Message); MessageBox.Show(e.Error.ToString()); SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText(); } else { if (e.Result != null) { employee = e.Result; employee.sysuser = sysUser; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("已获取到employee信息"); //txtUserMsg.Text = "获取员工信息成功,开始获取系统更新,请稍等......"; bool isAdmin = employee.sysuser.ISMANAGER == "1" ? true : false; var postlist = from ent in employee.EMPLOYEEPOSTS orderby ent.ISAGENCY select new SMT.SaaS.LocalData.V_EMPLOYEEPOSTBRIEF { EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID, POSTID = ent.POSTID, PostName = ent.PostName, DepartmentID = ent.DepartmentID, DepartmentName = ent.DepartmentName, CompanyID = ent.CompanyID, CompanyName = ent.CompanyName, ISAGENCY = ent.ISAGENCY, POSTLEVEL = ent.POSTLEVEL }; SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo = SMT.SAAS.Main.CurrentContext.Common.GetLoginUserInfo( employee.EMPLOYEEID, employee.EMPLOYEENAME, employee.EMPLOYEECODE, employee.EMPLOYEESTATE, employee.sysuser.SYSUSERID, employee.MOBILE, employee.OFFICEPHONE, employee.SEX, postlist.ToList(), employee.WORKAGE, employee.PHOTO, isAdmin); SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.PermissionInfoUI = new List <V_UserPermissionUI>(); SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserName = Application.Current.Resources["username"].ToString(); if (isFirstUser == true) { //txtUserMsg.Text = "员工信息验证通过,开始获取系统更新,请稍等......"; dllVersionUpdataCheck(); } else { uMainPage = asmMain.CreateInstance("SMT.SAAS.Platform.Xamls.MVCMainPage") as UIElement; AppContext.AppHost.SetRootVisual(uMainPage); } } else { txtUserMsg.Text = "获取员工信息出错,请联系管理员"; return; } } }
/// <summary> /// 获取员工信息事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void EmployeeInfoClient_getEmployeeInfobyLoginCompleted(object sender, getEmployeeInfobyLoginCompletedEventArgs e) { dtend = DateTime.Now; string strmsg = "登录系统完成耗时: " + (dtend - dtstart).Milliseconds.ToString() + " 毫秒"; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(strmsg); if (e.Error != null && e.Error.Message != "") { NotifyUserMessage("获取员工信息错误,请联系管理员"); SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage(e.Error.Message); MessageBox.Show(e.Error.ToString()); SMT.SAAS.Main.CurrentContext.AppContext.ShowSystemMessageText(); } else { if (e.Result != null) { employee = e.Result; employee.sysuser = sysUser; SMT.SAAS.Main.CurrentContext.AppContext.SystemMessage("已获取到employee信息"); NotifyUserMessage("获取员工信息成功,正在初始化系统,请稍等......"); bool isAdmin = employee.sysuser.ISMANAGER == "1" ? true : false; var postlist = from ent in employee.EMPLOYEEPOSTS orderby ent.ISAGENCY select new SMT.SaaS.LocalData.V_EMPLOYEEPOSTBRIEF { EMPLOYEEPOSTID = ent.EMPLOYEEPOSTID, POSTID = ent.POSTID, PostName = ent.PostName, DepartmentID = ent.DepartmentID, DepartmentName = ent.DepartmentName, CompanyID = ent.CompanyID, CompanyName = ent.CompanyName, ISAGENCY = ent.ISAGENCY, POSTLEVEL = ent.POSTLEVEL }; SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo = SMT.SAAS.Main.CurrentContext.Common.GetLoginUserInfo( employee.EMPLOYEEID, employee.EMPLOYEENAME, employee.EMPLOYEECODE, employee.EMPLOYEESTATE, employee.sysuser.SYSUSERID, employee.MOBILE, employee.OFFICEPHONE, employee.SEX, postlist.ToList(), employee.WORKAGE, employee.PHOTO, isAdmin); SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.PermissionInfoUI = new List <V_UserPermissionUI>(); //SMT.SAAS.Main.CurrentContext.LoginUserInfo.LoginRecordID = _LoginRecord; SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.UserName = txbUserName.Text; if (isFirstUser == true) { NotifyUserMessage("登录成功,开始获取系统更新,请稍等......"); isUserloginComplete = true; MainPageManeger.dllVersionUpdataCheck(); } else { //MainPage = asmMain.CreateInstance("SMT.SAAS.Platform.Xamls.MainPage") as UIElement; MainPageManeger.RunWorkerLoadAssemblyPart(); } } else { txtLoadingMessage.Text = "获取员工信息出错,请联系管理员"; btnLogin.IsEnabled = true; return; } } }
void personelClient_GetEmployeeDetailViewByIDCompleted(object sender, GetEmployeeDetailViewByIDCompletedEventArgs e) { if (e.Error == null) { if (e.Result != null) { V_EMPLOYEEDETAIL result = e.Result; bool isAdmin = _IsAdmin == "1" ? true : false; if (result.EMPLOYEEPOSTS == null) { result.EMPLOYEEPOSTS = new System.Collections.ObjectModel.ObservableCollection <V_EMPLOYEEPOSTBRIEF>(); } //Common.CurrentLoginUserInfo = Common.GetLoginUserInfo( // _UserEmployeeID, result.EMPLOYEENAME, // result.EMPLOYEECODE, result.EMPLOYEESTATE, // _SysUserID, result.OFFICEPHONE, // result.SEX, result.EMPLOYEEPOSTS.ToList(), result.WORKAGE, result.PHOTO, isAdmin); //Common.CurrentLoginUserInfo.LoginRecordID = _LoginRecord; //Common.CurrentLoginUserInfo.UserName = Utility.UserLogin.UserName; //Common.CurrentLoginUserInfo.UserPwd = Utility.UserLogin.UserPassword; //AppConfig._CurrentStyleCode = 1; //if (Application.Current.Resources["CurrentUserID"] == null) //{ // if (Application.Current.Resources.Contains("CurrentUserID")) // Application.Current.Resources.Remove("CurrentUserID"); // Application.Current.Resources.Add("CurrentUserID", _UserEmployeeID); //} if (this.OnInitCompleted != null) { this.OnInitCompleted(this, e); } // //结束系统初始化过程 // if (_Actived) // { // if (InitSystemCompleted.IsNotNull()) // { // //触发系统初始化完成事件 // InitSystemCompleted(this, EventArgs.Empty); // if (!CurrentContext.SysInit) // CurrentContext.SysInit = true; // txbLodingInfo.Text = "系统初始化完毕!"; // } // //关闭系统初始化开关 // _Actived = false; // } } } else { if (this.OnInitFailed != null) { this.OnInitFailed(this, e); } //errorPanel.Visibility = Visibility.Visible; //loadingfoPanel.Visibility = Visibility.Collapsed; //ExceptionManager.SendException(Resource.MSG_100014_WCF_ERROR, "PF", "LoadPostInfo", "1000014", e.Error); } }