//跳过一下步骤 #region 3获出差人岗位级别 void client_GetEmployeePostBriefByEmployeeIDCompleted(object sender, GetEmployeePostBriefByEmployeeIDCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { if (e.UserState != null) { Button btn = e.UserState as Button; btn.IsEnabled = true; } ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information); return; } if (e.Result != null) { employeepost = e.Result; if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == businesstripInfo.OWNERPOSTID).FirstOrDefault() != null) { postLevel = employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == businesstripInfo.OWNERPOSTID).FirstOrDefault().POSTLEVEL.ToString();//获取出差人的岗位级别 } else { var ent = employeepost.EMPLOYEEPOSTS.Where(s => s.ISAGENCY == "0").FirstOrDefault(); postLevel = ent != null?ent.POSTLEVEL.ToString() : "0 "; } //if (ReportSwitch == true) //{ // Travelmanagement.GetTravelSolutionByCompanyIDAsync(businesstripInfo.OWNERCOMPANYID, null, null);//出差方案 //} if (ReimbursementSwitch == true) { Travelmanagement.GetTravelSolutionByCompanyIDAsync(businesstripInfo.OWNERCOMPANYID, null, null, e.UserState);//出差方案 } } else { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("对不起,该员工已离职,不能进行该操作")); if (e.UserState != null) { Button btn = e.UserState as Button; btn.IsEnabled = true; } } }
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; } }
//跳过一下步骤 #region 3获出差人岗位级别 void client_GetEmployeePostBriefByEmployeeIDCompleted(object sender, GetEmployeePostBriefByEmployeeIDCompletedEventArgs e) { if (e.Error != null && e.Error.Message != "") { if (e.UserState != null) { Button btn = e.UserState as Button; btn.IsEnabled = true; } ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("TIPS"), Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Information); return; } if (e.Result != null) { employeepost = e.Result; if (employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == businesstripInfo.OWNERPOSTID).FirstOrDefault() != null) { postLevel = employeepost.EMPLOYEEPOSTS.Where(s => s.POSTID == businesstripInfo.OWNERPOSTID).FirstOrDefault().POSTLEVEL.ToString();//获取出差人的岗位级别 } else { var ent = employeepost.EMPLOYEEPOSTS.Where(s => s.ISAGENCY == "0").FirstOrDefault(); postLevel = ent != null ? ent.POSTLEVEL.ToString() : "0 "; } //if (ReportSwitch == true) //{ // Travelmanagement.GetTravelSolutionByCompanyIDAsync(businesstripInfo.OWNERCOMPANYID, null, null);//出差方案 //} if (ReimbursementSwitch == true) { Travelmanagement.GetTravelSolutionByCompanyIDAsync(businesstripInfo.OWNERCOMPANYID, null, null, e.UserState);//出差方案 } } else { Utility.ShowCustomMessage(MessageTypes.Caution, Utility.GetResourceStr("CAUTION"), Utility.GetResourceStr("对不起,该员工已离职,不能进行该操作")); if (e.UserState != null) { Button btn = e.UserState as Button; btn.IsEnabled = true; } } }
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; } }