Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the ExtractParser class.
 /// </summary>
 /// <param name="log">
 /// The CommerceLog object through which log entries can be made.
 /// </param>
 public ExtractParser(CommerceLog log)
 {
     Log = log;
     ExtractHeaderParser           = new ExtractHeaderParser(log);
     RedemptionDetailParser        = new RedemptionDetailParser(log);
     SettlementDetailParser        = new SettlementDetailParser(log);
     TransactionNotificationParser = new TransactionNotificationParser(log);
     ExtractFooterParser           = new ExtractFooterParser(log);
 }
Beispiel #2
0
        /// <summary>
        /// Parses a header record.
        /// </summary>
        /// <remarks>
        /// A null item may be added.
        /// </remarks>
        private void ParseHeaderRecord()
        {
            if (NumberOfHeaderRecords == 0)
            {
                if (LineNumber > 1)
                {
                    Log.Warning("Error parsing record in line #{0} from file \"{1}\". One or more records found  " +
                                "before header record parsed.", (int)ResultCode.RecordOutOfPlace, LineNumber, FileName);
                }

                Extract.Header        = ExtractHeaderParser.Parse(Line);
                NumberOfHeaderRecords = 1;
            }
            else
            {
                Log.Warning("Error parsing record in line #{0} from file \"{1}\". More than one header record found. All " +
                            "header records after the first one encountered will be ignored.",
                            (int)ResultCode.UnexpectedDuplicateRecordTypeFound, LineNumber, FileName);
            }
        }