Ejemplo n.º 1
0
        protected ValidationDocument()
        {
            dataTitre              = new ValidationDataChaine("Titre", (string)null);
            dataTitre.DataChanged += validationRuleRunning.Run;

            dataResume              = new ValidationDataChaine("Resume", (string)null);
            dataResume.DataChanged += validationRuleRunning.Run;

            dataDateExemplaire              = new ValidationDataDate("DateExemplaire", (DateTime?)null);
            dataDateExemplaire.DataChanged += validationRuleRunning.Run;

            dataDateParution              = new ValidationDataDate("DateParution", (string)null);
            dataDateParution.DataChanged += validationRuleRunning.Run;

            dataDateEntree              = new ValidationDataDate("DateEntree", (string)null);
            dataDateEntree.DataChanged += validationRuleRunning.Run;

            dataTypeDocument              = new ValidationDataEntier("TypeDocument", (int?)null);
            dataTypeDocument.DataChanged += validationRuleRunning.Run;

            dataGenre              = new ValidationDataEntier("Genre", (int?)null);
            dataGenre.DataChanged += validationRuleRunning.Run;

            dataIdentifiant              = new ValidationDataEntier("Identifiant", 1);
            dataIdentifiant.DataChanged += validationRuleRunning.Run;

            validationRuleRunning.ValidationDatas.Add(dataTitre);
            validationRuleRunning.ValidationDatas.Add(dataResume);
            validationRuleRunning.ValidationDatas.Add(dataDateParution);
            validationRuleRunning.ValidationDatas.Add(dataDateEntree);
            validationRuleRunning.ValidationDatas.Add(dataTypeDocument);
            validationRuleRunning.ValidationDatas.Add(dataGenre);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="nextValidationRule"></param>
 /// <param name="messageValidationRule"></param>
 /// <param name="errorLevelValidationRule"></param>
 /// <param name="validationDataDate"></param>
 public ValidationRuleDateValideOuVide(
     IValidationRule nextValidationRule,
     string messageValidationRule,
     ErrorLevel errorLevelValidationRule,
     ValidationDataDate validationDataDate)
     : base(validationDataDate.Name + "DateValideOuVide", nextValidationRule, messageValidationRule, errorLevelValidationRule)
 {
     ValidationDataDate = validationDataDate;
     ValidationDataDate.Rules.Add(Name);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Renvoi un objet ValidationRule de bornes de dates
        /// Les dates de début et de fin sont obligatoires
        /// </summary>
        /// <param name="ValidationRuleRoot">ValidationRule racine de chainage</param>
        /// <param name="dateDebut">Objet Validation de la date de début</param>
        /// <param name="messageDebutValidOuVide">Messsage de contrôle du format de la date de début</param>
        /// <param name="messageDebutRequise">Messsage de contrôle de date de début requise</param>
        /// <param name="errorLevel">Niveau d'erreur de la validation</param>
        /// <param name="messageBorneDate">Message de contrôle de vlidation de la borne des dates</param>
        /// <param name="dateFin">Objet Validation de la date de fin</param>
        /// <param name="messageFintValidOuVide">Messsage de contrôle du format de la date de fin</param>
        /// <param name="messageFinRequise">Messsage de contrôle de date de fin requise</param>
        /// <returns></returns>
        public static AbstractValidationRule GetValidationRuleDatesBornees(
            string name,
            AbstractValidationRule ValidationRuleRoot,
            ValidationDataDate dateDebut,
            string messageDebutValidOuVide,
            string messageDebutRequise,
            ErrorLevel errorLevel,
            string messageBorneDate,
            ValidationDataDate dateFin,
            string messageFintValidOuVide,
            string messageFinRequise

            )
        {
            ValidationRuleDateValideOuVide dateDebutValide =
                new ValidationRuleDateValideOuVide(
                    ValidationRuleRoot,
                    messageDebutValidOuVide,
                    ErrorLevel.Critical,
                    dateDebut);

            ValidationRuleDateRequise dateDebutRequise =
                new ValidationRuleDateRequise(
                    dateDebutValide,
                    messageDebutRequise,
                    ErrorLevel.Critical,
                    dateDebut);

            //string s = dateDebutRequise

            ValidationRuleDateValideOuVide dateFinValide =
                new ValidationRuleDateValideOuVide(
                    dateDebutRequise,
                    messageFintValidOuVide,
                    ErrorLevel.Critical,
                    dateFin);

            ValidationRuleDateRequise dateFinRequise =
                new ValidationRuleDateRequise(
                    dateFinValide,
                    messageFinRequise,
                    ErrorLevel.Critical,
                    dateFin);

            ValidationRuleDatesBornees FinSuperieureEgaleDebut =
                new ValidationRuleDatesBornees(
                    name,
                    dateFinRequise,
                    messageBorneDate,
                    errorLevel,
                    dateDebut,
                    dateFin);

            return(FinSuperieureEgaleDebut);
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="nextValidationRule"></param>
 /// <param name="messageValidationRule"></param>
 /// <param name="errorLevelValidationRule"></param>
 /// <param name="validationDataDate"></param>
 public ValidationRuleDateSuperieureEgale(
     IValidationRule nextValidationRule,
     string messageValidationRule,
     ErrorLevel errorLevelValidationRule,
     ValidationDataDate validationDataDate,
     ValidationDataDate validationDataDateReference
     )
     : base(validationDataDate.Name + "DateSuperieureEgale", nextValidationRule, messageValidationRule, errorLevelValidationRule)
 {
     ValidationDataDateControle  = validationDataDate;
     ValidationDataDateReference = validationDataDateReference;
     ValidationDataDateControle.Rules.Add(Name);
 }
        public ValidationExemplaire()
        {
            dataDateEntree              = new ValidationDataDate("DateEntree", (string)null);
            dataDateEntree.DataChanged += validationRuleRunning.Run;

            dataDateParutionDocument              = new ValidationDataDate("DateParution", (string)null);
            dataDateParutionDocument.DataChanged += validationRuleRunning.Run;

            validationRuleRunning.ValidationDatas.Add(dataDateParutionDocument);
            validationRuleRunning.ValidationDatas.Add(dataDateEntree);

            validationRuleRunning.ValidationRule = GetValidationRules();
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="nextValidationRule"></param>
        /// <param name="messageValidationRule"></param>
        /// <param name="errorLevelValidationRule"></param>
        /// <param name="validationDataDateControle"></param>
        public ValidationRuleDateEntreBornes(
            IValidationRule nextValidationRule,
            string messageValidationRule,
            ErrorLevel errorLevelValidationRule,
            ValidationDataDate validationDataDateControle,
            ValidationDataDate validationDataDateDebut,
            ValidationDataDate validationDataDateFin
            )
            : base(validationDataDateControle.Name + "DateEntreBornes", nextValidationRule, messageValidationRule, errorLevelValidationRule)
        {
            ValidationDataDateControlee = validationDataDateControle;
            ValidationDataDateDebut     = validationDataDateDebut;
            ValidationDataDateFin       = validationDataDateFin;

            ValidationDataDateControlee.Rules.Add(Name);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="nextValidationRule"></param>
        /// <param name="messageValidationRule"></param>
        /// <param name="errorLevelValidationRule"></param>
        /// <param name="validationDataDateDebut"></param>
        public ValidationRuleDatesBornees(
            IValidationRule nextValidationRule,
            string messageValidationRule,
            ErrorLevel errorLevelValidationRule,
            ValidationDataDate validationDataDateDebut,
            ValidationDataDate validationDataDateFin
            )
            : base(validationDataDateFin.Name + "DatesBornees" + validationDataDateDebut.Name, nextValidationRule, messageValidationRule, errorLevelValidationRule)
        {
            ValidationDataDateDebut = validationDataDateDebut;

            ValidationDataDateFin = validationDataDateFin;

            ValidationDataDateDebut.Rules.Add(Name);
            ValidationDataDateFin.Rules.Add(Name);
        }
        public ValidationEntreeDocument()
        {
            dataDateEntree              = new ValidationDataDate("DateEntree", (string)null);
            dataDateEntree.DataChanged += validationRuleRunning.Run;

            dataDateParutionDocument              = new ValidationDataDate("DateParution", (string)null);
            dataDateParutionDocument.DataChanged += validationRuleRunning.Run;

            dataNombreExemplaire              = new ValidationDataEntier("TypeDocument", (int?)null);
            dataNombreExemplaire.DataChanged += validationRuleRunning.Run;

            dataNombreExemplaireMini              = new ValidationDataEntier("Genre", (int?)null);
            dataNombreExemplaireMini.DataChanged += validationRuleRunning.Run;

            validationRuleRunning.ValidationDatas.Add(dataDateParutionDocument);
            validationRuleRunning.ValidationDatas.Add(dataDateEntree);
            validationRuleRunning.ValidationDatas.Add(dataNombreExemplaire);
            validationRuleRunning.ValidationDatas.Add(dataNombreExemplaireMini);

            validationRuleRunning.ValidationRule = GetValidationRules();
        }
 public ValidationRuleDateRequise(string name, IValidationRule nextValidationRule, string messageValidationRule, ErrorLevel errorLevelValidationRule, ValidationDataDate validationDataDate)
     : base(name, nextValidationRule, messageValidationRule, errorLevelValidationRule)
 {
     ValidationDataDate = validationDataDate;
     ValidationDataDate.Rules.Add(Name);
 }