void organClient_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e) { if (e.Error == null) { if (e.Result != null) { List <V_COMPANY> entTemps = e.Result.ToList(); allCompanys = new List <T_HR_COMPANY>(); var ents = entTemps.OrderBy(c => c.FATHERID); foreach (var ent in ents) { T_HR_COMPANY company = new T_HR_COMPANY(); company.COMPANYID = ent.COMPANYID; company.CNAME = ent.CNAME; company.ENAME = ent.ENAME; if (!string.IsNullOrEmpty(ent.BRIEFNAME)) { company.BRIEFNAME = ent.BRIEFNAME; } else { company.BRIEFNAME = ent.CNAME; } company.COMPANRYCODE = ent.COMPANRYCODE; company.SORTINDEX = ent.SORTINDEX; if (!string.IsNullOrEmpty(ent.FATHERCOMPANYID)) { company.T_HR_COMPANY2 = new T_HR_COMPANY(); company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID; company.T_HR_COMPANY2.CNAME = entTemps.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault().CNAME; } company.FATHERID = ent.FATHERID; company.FATHERTYPE = ent.FATHERTYPE; company.CHECKSTATE = ent.CHECKSTATE; company.EDITSTATE = ent.EDITSTATE; allCompanys.Add(company); } if (App.Current.Resources["SYS_CompanyInfo"] != null) { App.Current.Resources.Remove("SYS_CompanyInfo"); App.Current.Resources.Add("SYS_CompanyInfo", allCompanys); } else { App.Current.Resources.Add("SYS_CompanyInfo", allCompanys); } organClient.GetAllDepartmentViewAsync(""); } } }
/// <summary> /// 获取正常的公司 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void client_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e) { if (e.Error == null) { if (e.Result == null) { return; } ObservableCollection<V_COMPANY> entTemps = e.Result; allCompanys = new List<T_HR_COMPANY>(); allCompanys.Clear(); var ents = entTemps.OrderBy(c => c.FATHERID); foreach (var ent in ents) { T_HR_COMPANY company = new T_HR_COMPANY(); company.COMPANYID = ent.COMPANYID; company.CNAME = ent.CNAME; company.ENAME = ent.ENAME; if (!string.IsNullOrEmpty(ent.BRIEFNAME)) { company.BRIEFNAME = ent.BRIEFNAME; } else { company.BRIEFNAME = ent.CNAME; } company.COMPANRYCODE = ent.COMPANRYCODE; company.SORTINDEX = ent.SORTINDEX; company.T_HR_COMPANY2 = new T_HR_COMPANY(); company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID; company.FATHERID = ent.FATHERID; company.FATHERTYPE = ent.FATHERTYPE; company.CHECKSTATE = ent.CHECKSTATE; company.EDITSTATE = ent.EDITSTATE; company.COMPANYTYPE = ent.COMPANYTYPE; allCompanys.Add(company); } UICache.CreateCache("ORGTREESYSCompanyInfo", allCompanys); client.GetAllDepartmentViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); } else { loadbar.Stop(); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } }
/// <summary> /// 获取正常的公司 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void client_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e) { if (e.Error == null) { if (e.Result == null) { return; } ObservableCollection <V_COMPANY> entTemps = e.Result; allCompanys = new List <T_HR_COMPANY>(); allCompanys.Clear(); var ents = entTemps.OrderBy(c => c.FATHERID); foreach (var ent in ents) { T_HR_COMPANY company = new T_HR_COMPANY(); company.COMPANYID = ent.COMPANYID; company.CNAME = ent.CNAME; company.ENAME = ent.ENAME; if (!string.IsNullOrEmpty(ent.BRIEFNAME)) { company.BRIEFNAME = ent.BRIEFNAME; } else { company.BRIEFNAME = ent.CNAME; } company.COMPANRYCODE = ent.COMPANRYCODE; company.SORTINDEX = ent.SORTINDEX; company.T_HR_COMPANY2 = new T_HR_COMPANY(); company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID; company.FATHERID = ent.FATHERID; company.FATHERTYPE = ent.FATHERTYPE; company.CHECKSTATE = ent.CHECKSTATE; company.EDITSTATE = ent.EDITSTATE; company.COMPANYTYPE = ent.COMPANYTYPE; allCompanys.Add(company); } UICache.CreateCache("ORGTREESYSCompanyInfo", allCompanys); client.GetAllDepartmentViewAsync(SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID); } else { loadbar.Stop(); ComfirmWindow.ConfirmationBoxs(Utility.GetResourceStr("ERROR"), Utility.GetResourceStr("ERRORINFO"), Utility.GetResourceStr("CONFIRM"), MessageIcon.Error); } }
void organClient_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e) { if (e.Error == null) { if (e.Result != null) { List<V_COMPANY> entTemps = e.Result.ToList(); allCompanys = new List<SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY>(); var ents = entTemps.OrderBy(c => c.FATHERID); foreach (var ent in ents) { SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY company = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY(); company.COMPANYID = ent.COMPANYID; company.CNAME = ent.CNAME; company.ENAME = ent.ENAME; if (!string.IsNullOrEmpty(ent.BRIEFNAME)) { company.BRIEFNAME = ent.BRIEFNAME; } else { company.BRIEFNAME = ent.CNAME; } company.COMPANRYCODE = ent.COMPANRYCODE; company.SORTINDEX = ent.SORTINDEX; if (!string.IsNullOrEmpty(ent.FATHERCOMPANYID)) { company.T_HR_COMPANY2 = new SMT.Saas.Tools.OrganizationWS.T_HR_COMPANY(); company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID; company.T_HR_COMPANY2.CNAME = entTemps.Where(s => s.COMPANYID == ent.FATHERCOMPANYID).FirstOrDefault().CNAME; } company.FATHERID = ent.FATHERID; company.FATHERTYPE = ent.FATHERTYPE; company.CHECKSTATE = ent.CHECKSTATE; company.EDITSTATE = ent.EDITSTATE; allCompanys.Add(company); } if (App.Current.Resources["SYS_CompanyInfo"] != null) { App.Current.Resources.Remove("SYS_CompanyInfo"); App.Current.Resources.Add("SYS_CompanyInfo", allCompanys); } else { App.Current.Resources.Add("SYS_CompanyInfo", allCompanys); } } } }
void client_GetALLCompanyViewCompleted(object sender, GetALLCompanyViewCompletedEventArgs e) { if (e.Error == null) { if (e.Result == null) { return; } ObservableCollection<V_COMPANY> entTemps = e.Result; allCompanys = new List<T_HR_COMPANY>(); allCompanys.Clear(); var ents = entTemps.OrderBy(c => c.FATHERID); foreach (var ent in ents) { T_HR_COMPANY company = new T_HR_COMPANY(); company.COMPANYID = ent.COMPANYID; company.CNAME = ent.CNAME; company.ENAME = ent.ENAME; if (!string.IsNullOrEmpty(ent.BRIEFNAME)) { company.BRIEFNAME = ent.BRIEFNAME; } else { company.BRIEFNAME = ent.CNAME; } company.COMPANRYCODE = ent.COMPANRYCODE; company.SORTINDEX = ent.SORTINDEX; company.T_HR_COMPANY2 = new T_HR_COMPANY(); company.T_HR_COMPANY2.COMPANYID = ent.FATHERCOMPANYID; company.FATHERID = ent.FATHERID; company.FATHERTYPE = ent.FATHERTYPE; company.CHECKSTATE = ent.CHECKSTATE; company.EDITSTATE = ent.EDITSTATE; allCompanys.Add(company); } UICache.CreateCache("SYS_CompanyInfo", allCompanys); client.GetAllDepartmentViewAsync(""); } else { loadbar.Stop(); } }