Example #1
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);
            }
            bool bIsAdmin = CUtilSession.GetDonneeDroitForSession(contexte.IdSession, CDroitDeBaseSC2I.c_droitAdministration) != null;

            ArrayList listRows = new ArrayList(table.Rows);

            foreach (DataRow row in listRows)
            {
                if (row.RowState == DataRowState.Modified)
                {
                    if (!bIsAdmin && IsUsed(new int[] { (int)row[CSystemeCoordonnees.c_champId] }))
                    {
                        result.EmpileErreur(I.T("Impossible to modify the Coordinate System because it is currently used(administrator can do this modification)|244"));
                        return(result);
                    }
                }
            }
            return(result);
        }
Example #2
0
        public override CResultAErreur VerifieDonnees(bool bAuMomentDeLaSauvegarde)
        {
            CResultAErreur result = CResultAErreur.True;

            if (CUtilSession.GetDonneeDroitForSession(ContexteDonnee.IdSession, CDroitDeBaseSC2I.c_droitAdministration) != null && IsUsed())
            {
                result.EmpileErreur(new CErreurValidation(I.T("Warning, this system is in use. Be sure that your modification are compatible with existing coordinates|20126"), true));
            }
            if (!result)
            {
                return(result);
            }

            return(base.VerifieDonnees(bAuMomentDeLaSauvegarde));
        }