Exemplo n.º 1
0
        public string CreateOutput(ParseResult parsedData, FormatType.FormatTypeEnum formatType)
        {
            var strb = new StringBuilder();
            strb.AppendLine(GetQifHeader(formatType));

            foreach (var transaction in parsedData.Transactions)
            {
                var qifText = new QifTransaction(transaction).ToString();
                strb.AppendLine(qifText);
            }

            return strb.ToString();
        }
Exemplo n.º 2
0
        public ParseResult ParseLines(List<string> inputLines)
        {
            var result = new ParseResult();

            foreach (var line in inputLines)
            {
                if(string.IsNullOrEmpty(line))
                    continue;

                var transaction = GetTransactionDetails(line);
                if(transaction == null)
                    throw new Exception("Failed to parse Peugeot transaction.");
                result.Transactions.Add(transaction);
            }

            return result;
        }