protected virtual CodaLine ParseTransactionPart1(string line) { int sequenceNumber = int.Parse(line.Substring(2, 4).Trim()); int detailNumber = int.Parse(line.Substring(6, 4).Trim()); string reference = line.Substring(10, 21).Trim(); CodaTransactionType type = (CodaTransactionType)int.Parse(line[31].ToString()); decimal amount = decimal.Parse(line.Substring(32, 15).Trim()) / 1000; if (type == CodaTransactionType.Debit) { amount *= -1; } string codaDate = line.Substring(47, 6).Trim(); DateTime?effectiveDate = null; if (codaDate != "000000") { effectiveDate = CodaDate.Parse(codaDate); } string code = line.Substring(53, 8).Trim(); string family = code.Substring(1, 2).Trim(); string operation = code.Substring(3, 2).Trim(); string category = code.Substring(5, 3).Trim(); CodaCommunication communication = CodaCommunication.Parse(line.Substring(61, 54).Trim(), family == "05"); DateTime entryDate = CodaDate.Parse(line.Substring(115, 6).Trim()); int statementSequenceNumber = int.Parse(line.Substring(121, 3).Trim()); int globalizationCode = int.Parse(line.Substring(124, 1).Trim()); return(new CodaTransactionPart1Line(sequenceNumber, statementSequenceNumber, detailNumber, reference, effectiveDate, entryDate, type, code, family, operation, category, communication, amount, globalizationCode)); }
protected virtual CodaLine ParseInformationPart1(string line) { int sequenceNumber = int.Parse(line.Substring(2, 4).Trim()); int detailNumber = int.Parse(line.Substring(6, 4).Trim()); string reference = line.Substring(10, 31).Trim(); string transactionCode = line.Substring(31, 8).Trim(); CodaCommunication communication = CodaCommunication.Parse(line.Substring(39, 74).Trim(), false); return(new CodaInformationPart1Line(sequenceNumber, detailNumber, reference, transactionCode, communication)); }