Exemple #1
0
        public static void LoadNewFile(string commandString)
        {
            string filePath = commandString.Substring(7);

            if (!File.Exists(filePath))
            {
                Console.WriteLine("Cannot find file");
                return;
            }
            string fileExstension = commandString.Substring(commandString.Length - 4).ToLower();

            if (fileExstension == "json")
            {
                var rawTransactions = FileManager.GetRawTransactionsFromJson(filePath);
                Part1.GenerateTransactionsFromRaw(rawTransactions);
                Part1.getAndFollowCommand();
            }
            else if (fileExstension == ".csv")
            {
                Part1.Run(filePath);
            }
            else
            {
                Console.WriteLine("invalid filetype");
                return;
            }
        }
Exemple #2
0
 public static void Run()
 {
     Part1.Run("Transactions2015.csv");
 }
Exemple #3
0
 static void Main(string[] args)
 {
     Part1.Run();
 }