Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the ClearingParser class.
 /// </summary>
 /// <param name="log">
 /// The CommerceLog object through which log entries can be made.
 /// </param>
 public ClearingParser(CommerceLog log)
 {
     Log = log;
     ClearingHeaderParser  = new ClearingHeaderParser(log);
     ClearingDataParser    = new ClearingDataParser(log);
     ClearingTrailerParser = new ClearingTrailerParser(log);
 }
Esempio n. 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);
                }

                Clearing.Header = ClearingHeaderParser.Parse(Line);
            }
            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);
            }

            NumberOfHeaderRecords++;
        }