public static IEnumerable LicenseTypeFilterDelegate <ServiceDetType>( PXGraph graph, PXSelectBase <ServiceDetType> servicesView, PXFilter <StaffSelectionFilter> filter, PXSelectBase <LicenseTypeGridFilter> licenseTypeView) where ServiceDetType : class, IBqlTable, IFSSODetBase, new() { List <int?> serviceIDList = new List <int?>(); IEnumerable <LicenseTypeGridFilter> licenseTypeRecords = licenseTypeView.Cache.Cached.Cast <LicenseTypeGridFilter>(); bool initLicenseTypeFilter = licenseTypeRecords.Count() == 0; if (initLicenseTypeFilter) { serviceIDList = ServiceSelectionHelper.GetServicesInServiceTab <ServiceDetType>(servicesView, filter.Current.ServiceLineRef); } foreach (LicenseTypeGridFilter licenseTypeRow in PXSelect <LicenseTypeGridFilter> .Select(graph)) { if (initLicenseTypeFilter) { licenseTypeRow.Mem_FromService = LicenseTypeGridFilter.IsThisLicenseTypeRequiredByAnyService(graph, licenseTypeRow.LicenseTypeID, serviceIDList); licenseTypeRow.Mem_Selected = licenseTypeRow.Mem_FromService == true; } licenseTypeView.Cache.SetStatus(licenseTypeRow, PXEntryStatus.Held); licenseTypeView.Cache.IsDirty = false; yield return(licenseTypeRow); } }
public static IEnumerable SkillFilterDelegate <ServiceDetType>( PXGraph graph, PXSelectBase <ServiceDetType> servicesView, PXFilter <StaffSelectionFilter> filter, PXSelectBase <SkillGridFilter> skillView) where ServiceDetType : class, IBqlTable, IFSSODetBase, new() { List <int?> serviceIDList = new List <int?>(); List <int?> serviceIDCheckList = new List <int?>(); IEnumerable <SkillGridFilter> skillRecords = skillView.Cache.Cached.Cast <SkillGridFilter>(); bool initSkillFilter = skillRecords.Count() == 0; if (initSkillFilter) { serviceIDList = ServiceSelectionHelper.GetServicesInServiceTab <ServiceDetType>(servicesView, null); serviceIDCheckList = ServiceSelectionHelper.GetServicesInServiceTab <ServiceDetType>(servicesView, filter.Current.ServiceLineRef); } foreach (SkillGridFilter skillRow in PXSelect <SkillGridFilter> .Select(graph)) { if (initSkillFilter) { skillRow.Mem_ServicesList = SkillGridFilter.GetServiceListField(graph, serviceIDList, skillRow.SkillID); string serviceList = SkillGridFilter.GetServiceListField(graph, serviceIDCheckList, skillRow.SkillID); skillRow.Mem_Selected = string.IsNullOrEmpty(serviceList) == false; } skillView.Cache.SetStatus(skillRow, PXEntryStatus.Held); skillView.Cache.IsDirty = false; yield return(skillRow); } }