Exemplo n.º 1
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("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;
    }
Exemplo n.º 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;
        }