Exemplo n.º 1
0
        public void import()
        {
            fillsourceData();
            destinationData.loadData();

            AccountTypeMerger accountTypeMerger = new AccountTypeMerger(sourceData.AccountType, destinationData.AccountTypes);

            accountTypeMerger.merge();

            EnvelopeGroupMerger envelopeGroupMerger = new EnvelopeGroupMerger(sourceData.EnvelopeGroup, destinationData.EnvelopeGroups);

            envelopeGroupMerger.merge();

            TransactionTypeMerger transactionType = new TransactionTypeMerger(sourceData.LineType, destinationData.TransactionTypes);

            transactionType.merge();

            AccountAppender accountAppender = new AccountAppender(sourceData.Account, accountTypeMerger);

            accountAppender.appendAccounts();

            EnvelopeAppender envelopeAppender = new EnvelopeAppender(sourceData.Envelope, envelopeGroupMerger);

            envelopeAppender.appendEnvelopes();

            TransactionAppender transactionAppender = new TransactionAppender(transactionType, accountAppender, envelopeAppender);

            transactionAppender.appendLines(sourceData.LineItem);

            destinationData.saveData();
        }
        public TransactionAppender(TransactionTypeMerger transactionTypeMerger,
                                   AccountAppender accountAppender,
                                   EnvelopeAppender envelopeAppender)
        {
            transactionDictionary = new Dictionary <int, TransactionDRM>();

            this.transactionTypeMerger = transactionTypeMerger;
            this.accountAppender       = accountAppender;
            this.envelopeAppender      = envelopeAppender;
        }