Exemple #1
0
        public void Execute()
        {
            _validationLogic.ValidateInput();
            var rateCsvLogic = new RateCsvLogic <Rate>();
            var rateList     = rateCsvLogic.CreateRateList(new [] {
                _fiatRatesPath,
                _ratesPath
            }).OrderBy(r => r.DestinationCurrency).ThenBy(r => r.OriginCurrency).ThenByDescending(r => r.Date).ToList();
            var transactionCsvLogic = new TransactionCsvLogic <Transaction>(_transactionsPath, rateList);
            var transactionList     = transactionCsvLogic.CreateTransactionList();
            var transactionLogic    = new TransactionLogic <Transaction, DetailedTransaction, K4TransactionModel>(rateList);

            transactionLogic.ParseTransactions(transactionList);
            var detailedTransactionCsvLogic = new DetailedTransactionCsvLogic <DetailedTransaction>(_outputPath + @"\Detailed transactions.csv");

            detailedTransactionCsvLogic.CreateDetailedTransactionsCsv(transactionLogic.DetailedTransactions);

            var reportLogic           = new ReportLogic <ReportYearlySummary>(transactionLogic.DetailedTransactions);
            var reportYearlySummaries = reportLogic.CreateReportYearlySummaryList();
            var reportCsvLogic        = new ReportCsvLogic <ReportYearlySummary>(_outputPath + @"\Yearly reports.csv");

            reportCsvLogic.CreateReportCsv(reportYearlySummaries);

            var k4FormModel = new K4FormModel
            {
                FullName = _fullName,
                PersonalIdentificatonNumber = _personalIdentificationNumber,
                Years = _years,
                CryptoTransactions = transactionLogic.K4CryptoCurrencyTransactions,
                FiatTransactions   = transactionLogic.K4FiatCurrencyTransactions
            };
            var k4FormLogic  = new K4FormLogic <K4FillModel, K4TabIndexModel>(k4FormModel);
            var k4FillModels = k4FormLogic.GetK4FillModelList();
            var pdfLogic     = new PdfLogic(_outputPath, _processName);

            k4FillModels.ForEach(k4FillModel =>
            {
                var k4FillLogic = new K4FillLogic(pdfLogic, k4FillModel);
                k4FillLogic.FillAndSaveForms();
            });
        }