예제 #1
0
        private void UpdateLibelleElement(IElementAIntervention element)
        {
            string strVal = DescriptionFieldAttribute.GetDescription(element);

            if (strVal == null || strVal == "")
            {
                strVal = element.DescriptionElement;
            }
            m_lnkElementAIntervention.Text = strVal;
        }
예제 #2
0
        public CFormPlanifierInterventions(IElementAIntervention element)
        {
            InitializeComponent();
            m_contexteDonnee = element.ContexteDonnee;
            m_panelTop.SetContexteDonnee(m_contexteDonnee);
            m_panelTop.ShowElementAIntervention(element);
            DateTime date = DateTime.Now.Date.AddDays(-3);

            m_panelTop.SetDates(date, date.AddDays(6));
        }
예제 #3
0
 //----------------------------------------------------------
 public void AddElementAIntervention(IElementAIntervention elt)
 {
     if (elt is CObjetDonnee)
     {
         elt = ((CObjetDonnee)elt).GetObjetInContexte(m_contexteDonnee) as IElementAIntervention;
     }
     if (!m_listeElementsAInterventions.Contains(elt))
     {
         m_listeElementsAInterventions.Add(elt);
     }
 }
예제 #4
0
 //------------------------------------------------------------
 private void m_txtSelectElementAInterventions_OnSelectedObjectChanged(object sender, EventArgs e)
 {
     m_elementAIntervention = (IElementAIntervention)m_txtSelectElementAInterventions.ElementSelectionne;
     if (m_elementAIntervention != null)
     {
         CSite site = new CSite(m_contexteDonnee);
         site.ReadIfExists(m_elementAIntervention.Id);
         m_elementAIntervention = site;
     }
     m_fournisseurEntreesPlanning.ClearElementsAIntervention();
     m_fournisseurEntreesPlanning.AddElementAIntervention(m_elementAIntervention);
     m_controlPlanning.Refresh();
 }
예제 #5
0
 //----------------------------------------------------------
 public void RemoveElementAIntervention(IElementAIntervention elt)
 {
     m_listeElementsAInterventions.Remove(elt);
 }
예제 #6
0
 //---------------------------------------------------
 private void AfficheInfosElement(IElementAIntervention element)
 {
     FillListeIntersAvecDelai();
 }
예제 #7
0
        //---------------------------------------------
        private void FillListeInterventionsAPlanifier()
        {
            m_timerRefreshInterventionsPlanifiees.Stop();
            IElementAIntervention element = m_controlePlanning.ElementAInterventionSelectionne;

            if (element == null)
            {
                m_chkIntersSurSiteSelectionné.Visible = false;
            }
            else
            {
                m_chkIntersSurSiteSelectionné.Text = I.T("Filter on @1|20658", element.DescriptionElement);
            }
            m_panelTachesPrePlanifiees.Visible = true;

            DateTime dateDebut = m_controlePlanning.DateDebut.Date;

            DateTime dateFin = m_controlePlanning.DateFin.Date.AddDays(1);

            m_lblDatesListe.Text = I.T("from @1 to @2|20652", dateDebut.ToShortDateString(),
                                       dateFin.ToShortDateString());

            if (m_listeEntitesSelectionnee != null)
            {
                m_chkIntersSurListe.Text = m_listeEntitesSelectionnee.Libelle;
            }
            if (m_filtreDynamicSelectionnee != null)
            {
                m_chkIntersFiltre.Text = m_filtreDynamicSelectionnee.Libelle;
            }


            CListeObjetsDonnees listeInters = new CListeObjetsDonnees(m_contexteDonnee, typeof(CIntervention));

            listeInters.PreserveChanges = true;

            CFiltreData filtre = new CFiltreDataAvance(CIntervention.c_nomTable,
                                                       "(" + CIntervention.c_champDateDebutPreplanifiee + "<@1 and " +
                                                       CIntervention.c_champDateFinPrePlanifiee + ">@2) or (" +
                                                       CFractionIntervention.c_nomTable + "." +
                                                       CFractionIntervention.c_champDateDebutPlanifie + "<@1 and " +
                                                       CFractionIntervention.c_nomTable + "." +
                                                       CFractionIntervention.c_champDateFinPlanifiee + ">@2)",
                                                       dateFin,
                                                       dateDebut);

            if (m_chkIntersSurSiteSelectionné.Checked && element is CSite)
            {
                filtre = CFiltreData.GetAndFiltre(filtre,
                                                  new CFiltreData(CIntervention.c_champIdElementLie + "=@1",
                                                                  element.Id));
            }
            if (m_chkIntersNonPlanifiées.Checked)
            {
                filtre = CFiltreData.GetAndFiltre(filtre,
                                                  new CFiltreDataAvance(CIntervention.c_nomTable,
                                                                        "HasNo(" + CFractionIntervention.c_nomTable + "." +
                                                                        CFractionIntervention.c_champId + ")"));
            }
            if (m_chkIntersNonAffectées.Checked)
            {
                filtre = CFiltreData.GetAndFiltre(filtre,
                                                  new CFiltreDataAvance(CIntervention.c_nomTable,
                                                                        "Hasno(" + CIntervention_Intervenant.c_nomTable + "." +
                                                                        CIntervention_Intervenant.c_champId + ")"));
            }
            listeInters.Filtre = filtre;

            if (m_setIdsInterventionsVisiblesCalculéDefiltreEtListe == null)
            {
                CalculeSetIdsInterventionsVisibles();
            }


            List <CIntervention> lstFiltree = listeInters.ToList <CIntervention>();

            foreach (CIntervention inter in listeInters.ToArrayList())
            {
                if (m_chkIntersNonPlanifiées.Checked && inter.Fractions.Count > 0)
                {
                    lstFiltree.Remove(inter);
                }
                if (m_chkIntersNonAffectées.Checked && inter.RelationsIntervenants.Count > 0)
                {
                    lstFiltree.Remove(inter);
                }
                if (inter.Id >= 0 && m_setIdsInterventionsVisiblesCalculéDefiltreEtListe != null &&
                    !m_setIdsInterventionsVisiblesCalculéDefiltreEtListe.Contains(inter.Id))
                {
                    lstFiltree.Remove(inter);
                }
            }
            m_wndListeInterAPlanifier.ListeSource = lstFiltree;
            m_wndListeInterAPlanifier.Refresh();
        }
예제 #8
0
 public void ShowElementAIntervention(IElementAIntervention element)
 {
     m_basePlanning.AddElementAIntervention(element);
     m_controlePlanning.Refresh();
     m_controlePlanning.ElementAInterventionSelectionne = element;
 }