예제 #1
0
파일: ParseCcStmt.cs 프로젝트: gpoul/ledger
    public static int Main(string[] args)
    {
      StreamReader reader = new StreamReader(args[0]);
      string firstLine = reader.ReadLine();

      string CardAccount = args[1];
      string BankAccount = args[2];

      IStatementConverter converter;

      if (firstLine.StartsWith("POSTING DATE")) {
	converter = new ConvertGoldMasterCardStatement();
      } else {
	converter = new ConvertMastercardStatement();
      }

      reader = new StreamReader(args[0]);
      List<Posting> posts = converter.ConvertRecords(reader.BaseStream);

      PrintPostings printer = new PrintPostings();
      printer.Print(CardAccount, BankAccount, posts);

      return 0;
    }
예제 #2
0
        public static int Main(string[] args)
        {
            StreamReader reader = new StreamReader(args[0]);
              string firstLine = reader.ReadLine();

              string CardAccount = args[1];
              string BankAccount = args[2];

              IStatementConverter converter;

              if (firstLine.StartsWith("TRANSACTION DATE")) {
            converter = new ConvertGoldMasterCardStatement();
              } else {
            converter = new ConvertMastercardStatement();
              }

              reader = new StreamReader(args[0]);
              List<Transaction> xacts = converter.ConvertRecords(reader.BaseStream);

              PrintTransactions printer = new PrintTransactions();
              printer.Print(CardAccount, BankAccount, xacts);

              return 0;
        }