Exemple #1
0
        private static IDecoder GetDecoder(IFieldDecoder decoder)
        {
            BasePlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory(
                CodeTablePlugInFactory.REG_NAME);
            CodeTable ct = factory.CreateInstance <CodeTable>(decoder.RegName);

            return(ct);
        }
Exemple #2
0
 private static IDecoder GetDecoder(IFieldDecoder decoder)
 {
     if (decoder.Type == DecoderType.CodeTable)
     {
         BasePlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory(
             CodeTablePlugInFactory.REG_NAME);
         CodeTable ct = factory.CreateInstance <CodeTable>(decoder.RegName);
         return(ct);
     }
     else if (decoder.Type == DecoderType.EasySearch)
     {
         BasePlugInFactory factory = BaseGlobalVariable.Current.FactoryManager.GetCodeFactory(
             EasySearchPlugInFactory.REG_NAME);
         EasySearch ct = factory.CreateInstance <EasySearch>(decoder.RegName);
         return(ct);
     }
     return(null);
 }
Exemple #3
0
        private static void DecodeField(string fieldName, string description, Field field, IFieldDecoder fieldDecoder)
        {
            DataProcessorGlobal.Debug($"Decoding Field: {fieldName}, Raw Value: '{field.Raw}'");
            fieldDecoder.Decode(field);

            if (field.ValidationResult == ValidationResultType.Valid)
            {
                return;
            }

            field.Row.ValidationResult = ParsedDataProcessorHelper.GetMaxValidationResult(field.Row.ValidationResult, field.ValidationResult);
            var message = $"Invalid {description} '{field.Raw}'";

            if (field.ValidationResult == ValidationResultType.Warning)
            {
                field.Row.Warnings.Add(message);
            }
            else
            {
                field.Row.Errors.Add(message);
            }
        }