Ed.BudgetVisualizer.Logic/Parsers/SebParser.cs
/// <summary>
/// Maps data fields to a transaction.
/// </summary>
/// <param name="fields">Data fields to map.</param>
Maps data fields to a transaction.
Maps data fields to a transaction .
public Transaction MapTransaction(string[] fields) 
        {
            var transaction = new Transaction
            {
                Date = DateTime.Parse(fields[1]),
                Origin = fields[4],
                Description = fields[9],
                IsDebit = fields[14] == "D",
                IsCredit = fields[14] == "C",
                Sum = decimal.Parse(fields[15]),
                Currency = fields[17],
            };
            transaction.Category = transaction.IsCredit ? "Other Income" : "Other Expense";
            return transaction;
        }
public Transaction MapTransaction ( string [ ] fields ) { var transaction = new Transaction { Date = DateTime . Parse ( fields [ 1 ] ) , Origin = fields [ 4 ] , Description = fields [ 9 ] , IsDebit = fields [ 14 ] == " " , IsCredit = fields [ 14 ] == " " , Sum = decimal . Parse ( fields [ 15 ] ) , Currency = fields [ 17 ] , } ; transaction . Category = transaction . IsCredit ? " " : " " ; return transaction ; }
Maps data fields to a transaction.
Maps data fields to a transaction .
fields
string[]
Data fields to map.
Data fields to map .