Example #1
0
        public static Dictionary <string, ValidationModel> Create()
        {
            Dictionary <string, ValidationModel> result = new Dictionary <string, ValidationModel>();

            foreach (DataRow dataModel in chocoReader.LoadDatasetFromXml(fileName).Tables[tableName].Rows)
            {
                ValidationModel validationModel = new ValidationModel();
                validationModel.EmailRegex   = new Regex(dataModel[regexp].ToString());
                validationModel.ErrorMessage = dataModel[errorMessage].ToString();

                result.Add(dataModel[fieldId].ToString(), validationModel);
            }

            return(result);
        }
Example #2
0
        public static Dictionary<string, ValidationModel> Create()
        {
            Dictionary<string, ValidationModel> result = new Dictionary<string, ValidationModel>();

            foreach (DataRow dataModel in chocoReader.LoadDatasetFromXml(fileName).Tables[tableName].Rows)
            {
                ValidationModel validationModel = new ValidationModel();
                validationModel.EmailRegex = new Regex(dataModel[regexp].ToString());
                validationModel.ErrorMessage = dataModel[errorMessage].ToString();

                result.Add(dataModel[fieldId].ToString(), validationModel);
            }

            return result;
        }