Example #1
0
        public static void ModificationDegeler(CGel gel, EventHandler onDegelerEventHandler)
        {
            CFormGelerIntervention form = new CFormGelerIntervention();

            form.m_handlerOnGeler = onDegelerEventHandler;
            form.m_gel            = gel;
            form.m_bModeGeler     = false;
            form.m_bModif         = true;
            form.Show();
        }
Example #2
0
        //-------------------------------------------------------------------
        public override CResultAErreur TraitementAvantSauvegarde(CContexteDonnee contexte)
        {
            CResultAErreur result = base.TraitementAvantSauvegarde(contexte);

            if (!result)
            {
                return(result);
            }
            DataTable table = contexte.Tables[GetNomTable()];

            if (table == null)
            {
                return(result);
            }
            ArrayList lst = new ArrayList(table.Rows);
            Hashtable tableInterventionsAVerifier = new Hashtable();
            Hashtable tablePhasesAVerifier        = new Hashtable();

            foreach (DataRow row in table.Rows)
            {
                if (row.RowState == DataRowState.Modified || row.RowState == DataRowState.Added || row.RowState == DataRowState.Deleted)
                {
                    CGel gel = new CGel(row);
                    if (row.RowState == DataRowState.Deleted)
                    {
                        gel.VersionToReturn = DataRowVersion.Original;
                    }
                    if (gel.Intervention != null && gel.Intervention.IsValide())
                    {
                        tableInterventionsAVerifier[gel.Intervention] = true;
                    }
                    if (gel.PhaseTicket != null && gel.PhaseTicket.IsValide())
                    {
                        tablePhasesAVerifier[gel.PhaseTicket] = true;
                    }
                    if (row.RowState == DataRowState.Deleted)
                    {
                        gel.VersionToReturn = DataRowVersion.Current;
                    }
                }
            }

            foreach (CIntervention inter in tableInterventionsAVerifier.Keys)
            {
                //if ( tache.PhaseTicket != null && tablePhasesAVerifier.Contains ( tache.PhaseTicket ) )
                //    tablePhasesAVerifier.Remove ( tache.PhaseTicket );
                inter.RecalculeEtatGel();
            }
            foreach (CPhaseTicket phase in tablePhasesAVerifier.Keys)
            {
                phase.RecalculeEtatGel();
            }
            return(result);
        }
Example #3
0
        //-------------------------------------------------------------------
        public override CResultAErreur VerifieDonnees(CObjetDonnee objet)
        {
            CResultAErreur result = CResultAErreur.True;

            try
            {
                CGel gel = (CGel)objet;
            }
            catch (Exception e)
            {
                result.EmpileErreur(new CErreurException(e));
            }
            return(result);
        }
Example #4
0
        //-------------------------------------------------------------------------
        private void AfficheInfosGels()
        {
            if (m_wndListeGels.SelectedItems.Count != 1)
            {
                m_panelInfoGel.Visible = false;
                return;
            }
            CGel gel = (CGel)m_wndListeGels.SelectedItems[0];

            m_panelInfoGel.Visible = true;
            m_lnkStart.Text        = gel.DateDebut.ToString("g");
            int nXLblDate = m_lnkStart.Location.X + m_lnkStart.Width;

            m_lblDatesGel.Location = new Point(nXLblDate, m_lblDatesGel.Location.Y);
            if (gel.DateFin == null)
            {
                m_lblDatesGel.Text   = "... " + I.T("ongoing|61");
                m_lnkEndDate.Visible = false;
            }
            else
            {
                m_lnkEndDate.Visible = true;
                m_lblDatesGel.Text   = I.T("to|62");
                int nXEndDate = m_lblDatesGel.Location.X + m_lblDatesGel.Width;
                m_lnkEndDate.Location = new Point(nXEndDate, m_lnkEndDate.Location.Y);
                m_lnkEndDate.Text     = ((DateTime)gel.DateFin).ToString("g");
            }
            m_lblInfoDebutGel.Text = gel.InfosDebutGel;
            m_tooltip.SetToolTip(m_lblInfoDebutGel, gel.InfosDebutGel);
            m_lblInfoFinGel.Text = gel.InfosFinGel;
            m_tooltip.SetToolTip(m_lblInfoFinGel, gel.InfosFinGel);
            if (gel.CauseGel != null)
            {
                m_lblFrezingCause.Text = gel.CauseGel.Libelle;
            }
        }