void Personne_GetEmployeesByPostLevelIntervalCompleted(object sender, GetEmployeesByPostLevelIntervalCompletedEventArgs e)//根据岗位级别获取员工 { if (e.Result != null) { ObservableCollection <V_EMPOYEEPOSTLEVEL> Employee = e.Result; List <T_OA_WELFAREDISTRIBUTEDETAIL> details = new List <T_OA_WELFAREDISTRIBUTEDETAIL>(); foreach (var listitme in ListWelfare) { List <T_OA_WELFAREDISTRIBUTEDETAIL> detail = new List <T_OA_WELFAREDISTRIBUTEDETAIL>(); detail = (from employeeInfo in Employee where employeeInfo.POSTLEVEL >= Convert.ToInt32(listitme.POSTLEVELA) && employeeInfo.POSTLEVEL <= Convert.ToInt32(listitme.POSTLEVELB) select new T_OA_WELFAREDISTRIBUTEDETAIL { USERID = employeeInfo.T_HR_EMPLOYEE.EMPLOYEEID, OWNERNAME = employeeInfo.T_HR_EMPLOYEE.EMPLOYEECNAME, STANDARD = Convert.ToDecimal(listitme.STANDARD), REMARK = listitme.REMARK, OWNERPOSTID = listitme.POSTID, OWNERCOMPANYID = welfare.COMPANYID }).ToList(); details.AddRange(detail); } PagedCollectionView pcv = null;//分页 if (e.Result != null) { var q = from ent in details select ent; pcv = new PagedCollectionView(q); pcv.PageSize = 5; } dpGrids.DataContext = pcv; detailTemps = details; DaGrs.ItemsSource = pcv; } }
void Personne_GetEmployeesByPostLevelIntervalCompleted(object sender, GetEmployeesByPostLevelIntervalCompletedEventArgs e)//根据岗位级别获取员工 { if (e.Result != null) { ObservableCollection<V_EMPOYEEPOSTLEVEL> Employee = e.Result; List<T_OA_WELFAREDISTRIBUTEDETAIL> details = new List<T_OA_WELFAREDISTRIBUTEDETAIL>(); foreach (var listitme in ListWelfare) { List<T_OA_WELFAREDISTRIBUTEDETAIL> detail = new List<T_OA_WELFAREDISTRIBUTEDETAIL>(); detail = (from employeeInfo in Employee where employeeInfo.POSTLEVEL >= Convert.ToInt32(listitme.POSTLEVELA) && employeeInfo.POSTLEVEL <= Convert.ToInt32(listitme.POSTLEVELB) select new T_OA_WELFAREDISTRIBUTEDETAIL { USERID = employeeInfo.T_HR_EMPLOYEE.EMPLOYEEID, OWNERNAME = employeeInfo.T_HR_EMPLOYEE.EMPLOYEECNAME, STANDARD = Convert.ToDecimal(listitme.STANDARD), REMARK = listitme.REMARK, OWNERPOSTID = listitme.POSTID, OWNERCOMPANYID = welfare.COMPANYID }).ToList(); details.AddRange(detail); } PagedCollectionView pcv = null;//分页 if (e.Result != null) { var q = from ent in details select ent; pcv = new PagedCollectionView(q); pcv.PageSize = 5; } dpGrids.DataContext = pcv; detailTemps = details; DaGrs.ItemsSource = pcv; } }