Exemplo n.º 1
0
        static public void SQLiteOutputTransactionsInCSV(List <MSTransaction> trList)
        {
            //MSTransaction to CSV file
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.AppendLine("MSTransactionId, MSIO, MSValue, MSCurrencyCode, MSAccountId, MSCategoryId, MSNote, MSDateTime, MSMulticurrency");
            foreach (var tr in trList)
            {
                sb.AppendLine($"{tr.MSTransactionId}," +
                              $"{tr.MSIO}," +
                              $"{tr.MSValue}," +
                              $"{tr.MSCurrencyCode}," +
                              $"{MSAccount.GetName(tr.MSAccountId)}," +
                              $"{MSCategory.GetName(tr.MSCategoryId)}," +
                              $"{tr.MSNote}," +
                              $"{tr.MSDateTime}," +
                              $"{tr.MSMulticurrency}");
            }

            //Console.WriteLine(sb.ToString());

            System.IO.File.WriteAllText(
                System.IO.Path.Combine(
                    AppDomain.CurrentDomain.BaseDirectory, "Transaction.csv"),
                sb.ToString());
        }
Exemplo n.º 2
0
        static public void ShowAllTransaction(List <MSTransaction> trList)
        {
            int maxWidth = 80;

            Console.SetWindowSize(maxWidth, 25);
            foreach (var tr in trList)
            {
                Console.WriteLine($"{tr.MSTransactionId}," +
                                  $"{tr.MSIO}," +
                                  $"{tr.MSValue}," +
                                  $"{tr.MSCurrencyCode}," +
                                  $"{MSAccount.GetName(tr.MSAccountId)}," +
                                  $"{MSCategory.GetName(tr.MSCategoryId)}," +
                                  $"{tr.MSNote}," +
                                  $"{tr.MSDateTime}," +
                                  $"{tr.MSMulticurrency}\n");
            }
        }