Exemple #1
0
 static void Main(string[] args)
 {
     if (args.Length > 0)
     {
         try
         {
             var toEntity   = new input.fromCsv.ToEntityConverter();
             var fromEntity = new gateway.FromEntityConverter();
             var gateway    = new gateway.Gateway();
             args.ToList().ForEach(path =>
                                   new input.fromCsv.CsvReader().read(path)
                                   .SelectMany(it => toEntity.ToRequest(it))
                                   .Select(it => fromEntity.FromRequest(it))
                                   .ToList()
                                   .ForEach(it => gateway.Apply(it))
                                   );
         }
         catch (Exception e)
         {
             Console.WriteLine("Error: " + e.StackTrace);
         }
         return;
     }
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
 }
Exemple #2
0
        private void ReadCsv_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog();

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            new input.fromCsv.CsvReader().read(dialog.FileName)
            .SelectMany(it => toEntity.ToRequest(it))
            .Select(it => fromEntity.FromRequest(it))
            .ToList()
            .ForEach(it => gateway.Apply(it));
        }