Exemple #1
0
        //------------------------------------------------------------------
        public static CResultAErreur Degeler(IElementGelable elt, DateTime dateTime, string strInfo)
        {
            CResultAErreur result      = CResultAErreur.True;
            CGel           gelADegeler = null;

            foreach (CGel gel in elt.Gels)
            {
                if (gel.DateFin == null)
                {
                    gelADegeler = gel;
                    break;
                }
            }
            if (gelADegeler == null)
            {
                result.EmpileErreur(I.T("Unfreezing impossible for an element not freezed|551"));
                return(result);
            }

            gelADegeler.BeginEdit();
            gelADegeler.InfosFinGel = strInfo;
            gelADegeler.DateFin     = dateTime;
            result = gelADegeler.CommitEdit();
            return(result);
        }
Exemple #2
0
        //------------------------------------------------------------------
        public static CResultAErreur ModifDegeler(CGel elt, DateTime dateTime, string strInfo)
        {
            CResultAErreur result = CResultAErreur.True;

            elt.BeginEdit();
            elt.InfosFinGel = strInfo;
            elt.DateFin     = dateTime;
            return(elt.CommitEdit());
        }
Exemple #3
0
        //------------------------------------------------------------------
        public static CResultAErreur ModifGeler(CGel elt, DateTime dateTime, CCauseGel cCauseGel, string strInfo)
        {
            CResultAErreur result = CResultAErreur.True;

            elt.BeginEdit();
            elt.CauseGel      = cCauseGel;
            elt.InfosDebutGel = strInfo;
            elt.DateDebut     = dateTime;
            return(elt.CommitEdit());
        }
Exemple #4
0
        //------------------------------------------------------------------
        public static CResultAErreur Geler(IElementGelable elt, DateTime dateTime, CCauseGel cCauseGel, string strInfo)
        {
            CResultAErreur result = CResultAErreur.True;

            //Vérifie qu'il n'y a pas déjà un gel ouvert
            if (elt.EstGelee)
            {
                result.EmpileErreur(I.T("Freezing impossible for an element already freezed|546"));
                return(result);
            }
            CGel gel = new CGel(elt.ContexteDonnee);

            gel.CreateNew();
            gel.DateDebut      = dateTime;
            gel.CauseGel       = cCauseGel;
            gel.InfosDebutGel  = strInfo;
            gel.ElementGelable = elt;
            result             = gel.CommitEdit();
            return(result);
        }