コード例 #1
0
        //-------------------------------------------------------------------------------
        public bool CanBeUseFor(IProfilElement profil, IEntreePlanning entree)
        {
            CProfilElement[] profils = profil.TousLesProfilsARemplir;
            if (profils.Length == 0)
            {
                return(true);
            }
            if (profils[0].TypeElements != typeof(CRessourceMaterielle))
            {
                return(false);
            }
            CContrainte contrainte = null;

            if (profil is CContrainte && entree is CIntervention)
            {
                contrainte = (CContrainte)profil;
                profil     = ((CIntervention)entree).TypeIntervention.ProfilRessourceDefaut;
            }

            CListeObjetsDonnees liste = CProfilElement.GetElementsForSource(profil, (IObjetDonneeAIdNumerique)entree, contrainte, null);

            if (liste != null)
            {
                foreach (CObjetDonneeAIdNumerique objet in liste)
                {
                    if (objet.Id == Id)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
コード例 #2
0
ファイル: CUtilEntreePlanning.cs プロジェクト: ykebaili/Timos
 public static bool Intersect(IEntreePlanning elt, DateTime dtDebut, DateTime dtFin)
 {
     foreach (ITranchePlanning tranche in elt.Tranches)
     {
         if (Intersect(tranche, dtDebut, dtFin))
         {
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
ファイル: CPanelPlanification.cs プロジェクト: ykebaili/Timos
        private void m_controlePlanning_OnEditerIntervention(object sender, EventArgs e)
        {
            IEntreePlanning entree = m_controlePlanning.EntreePlanningSelectionnee;

            if (entree is CIntervention)
            {
                CFormEditionIntervention form = new CFormEditionIntervention((CIntervention)entree);
                if (m_gestionnaireModeEdition.ModeEdition)
                {
                    CFormNavigateurPopup.Show(form, FormWindowState.Maximized);
                    m_controlePlanning.Refresh();
                }
                else
                {
                    CTimosApp.Navigateur.AffichePage(form);
                }
            }
        }