Ejemplo n.º 1
0
        //------------------------------------------------------------------------------------
        public CFiltreDataAvance GetFiltreForRechercheRessourcesSurAttributs()
        {
            //Crée le filtre sur les types de ressource qui lèvent le type de contrainte
            CFiltreDataAvance filtreFinal = new CFiltreDataAvance(
                CRessourceMaterielle.c_nomTable,
                CTypeRessource.c_nomTable + "." +
                CRelationTypeContrainte_TypeRessource.c_nomTable + "." +
                CTypeContrainte.c_champId + "=@1",
                TypeContrainte.Id);

            CFiltreData filtreAttributs = GetFiltreSurAttributsRessource();

            if (filtreAttributs != null && !(filtreAttributs is CFiltreDataAvance))
            {
                filtreAttributs = CFiltreDataAvance.ConvertFiltreToFiltreAvance(CAttributRessource.c_nomTable, filtreAttributs);
            }
            if (filtreAttributs != null)
            {
                CFiltreDataAvance filtreAv = (CFiltreDataAvance)filtreAttributs;
                filtreAv.ChangeTableDeBase(CRessourceMaterielle.c_nomTable, CAttributRessource.c_nomTable);
            }

            filtreFinal = (CFiltreDataAvance)CFiltreData.GetAndFiltre(filtreAttributs, filtreFinal);

            return(filtreFinal);
        }
Ejemplo n.º 2
0
        //----------------------------------------------------------------------------
        private void InitListesPlannifieurs(bool bMajChamps)
        {
            CFiltreData filtrePlanifieurs = new CFiltreDataAvance(CActeur.c_nomTable,
                                                                  "HAS(" + CDonneesActeurUtilisateur.c_nomTable + "." +
                                                                  CDonneesActeurUtilisateur.c_champId + ")");

            CFiltreData filtrePrePlanifieurs = filtrePlanifieurs.GetClone();

            bool bAppliquerProfils = true;

            if (bAppliquerProfils)
            {
                CTypeIntervention typeIntervention = (CTypeIntervention)m_cmbTypeIntervention.ElementSelectionne;
                if (typeIntervention != null && typeIntervention.ProfilPlanifieur != null)
                {
                    CListeObjetsDonnees lstTmp    = typeIntervention.ProfilPlanifieur.GetElementsForSource(Intervention, null);
                    CFiltreDataAvance   filtreTmp = CFiltreDataAvance.ConvertFiltreToFiltreAvance(CDonneesActeurUtilisateur.c_nomTable, lstTmp.FiltrePrincipal);
                    filtreTmp.ChangeTableDeBase(CActeur.c_nomTable, CDonneesActeurUtilisateur.c_nomTable);
                    filtrePlanifieurs = CFiltreData.GetAndFiltre(filtrePlanifieurs, filtreTmp);
                }
                if (typeIntervention != null && typeIntervention.ProfilPreplanifieur != null)
                {
                    CListeObjetsDonnees lstTmp    = typeIntervention.ProfilPreplanifieur.GetElementsForSource(Intervention, null);
                    CFiltreDataAvance   filtreTmp = CFiltreDataAvance.ConvertFiltreToFiltreAvance(CDonneesActeurUtilisateur.c_nomTable, lstTmp.FiltrePrincipal);
                    filtreTmp.ChangeTableDeBase(CActeur.c_nomTable, CDonneesActeurUtilisateur.c_nomTable);
                    filtrePrePlanifieurs = CFiltreData.GetAndFiltre(filtrePrePlanifieurs, filtreTmp);
                }
            }

            m_txtSelectPreplanificateur.InitAvecFiltreDeBase <CActeur>(
                "IdentiteComplete",
                filtrePrePlanifieurs,
                true);
            m_txtSelectPlanificateur.InitAvecFiltreDeBase <CActeur>(
                "IdentiteComplete",
                filtrePlanifieurs,
                true);
        }