Beispiel #1
0
            public IAbstractHeader <AirQualitySubmissionType> Materialize(IAbstractHeader <AirQualitySubmissionType> concrete)
            {
                var materializedFormat = new AqsRawResults(_baseDao, _format);//_action,

                foreach (string destinationColumn in Keys)
                {
                    if (concrete.ContainsKey(destinationColumn))
                    {
                        materializedFormat.Add(destinationColumn,
                                               (p, c) => base[destinationColumn](p, concrete[destinationColumn](p, c))
                                               );
                    }
                    else
                    {
                        materializedFormat.Add(destinationColumn, base[destinationColumn]);
                    }
                }
                return(materializedFormat);
            }
Beispiel #2
0
        public AirQualitySubmissionType GetAirQualityData(string imputPath, AqsFileType fileType, string format, IAppendAuditLogEvent appendAuditLogProvider)
        {
            try
            {
                IAbstractHeader <AirQualitySubmissionType> mappedParser = GetAqsHeader(fileType, format)
                                                                          .Materialize(GetValueMappings(format))
                                                                          .Materialize(GetColumnMappings(format));


                Windsor.Commons.Core.CommaSeparatedFileParser parser = new Windsor.Commons.Core.CommaSeparatedFileParser(imputPath);
                while (parser.NextLine())
                {
                    mappedParser.ConsumeRow(parser);
                }

                return(mappedParser.Resolve());
            }
            catch (Exception x)
            {
                appendAuditLogProvider.AppendAuditLogEvent(x.Message);
                throw;
            }
        }