예제 #1
0
		public CompanyFilesMarketPlacesController(IEzbobWorkplaceContext context, DatabaseDataHelper dbHelper, CompanyFilesMetaDataRepository companyFilesMetaDataRepository) {
			this.context = context;
			this.customer = context.Customer;
			this.dbHelper = dbHelper;
			this.companyFilesMetaDataRepository = companyFilesMetaDataRepository;
			this.serviceClient = new ServiceClient();
		} // constructor
예제 #2
0
 public RetrieveDataHelper(
     DatabaseDataHelper helper,
     DatabaseMarketplaceBaseBase marketplace
     )
     : base(helper, marketplace)
 {
 }         // constructor
예제 #3
0
 public MarketPlacesController(CustomerRepository customers,
                               CustomerMarketPlaceRepository customerMarketplaces,
                               WebMarketPlacesFacade marketPlaces,
                               MP_TeraPeakOrderItemRepository teraPeakOrderItems,
                               YodleeAccountsRepository yodleeAccountsRepository,
                               YodleeSearchWordsRepository yodleeSearchWordsRepository,
                               YodleeGroupRepository yodleeGroupRepository,
                               YodleeRuleRepository yodleeRuleRepository,
                               YodleeGroupRuleMapRepository yodleeGroupRuleMapRepository,
                               ISession session,
                               CompanyFilesMetaDataRepository companyFiles,
                               IWorkplaceContext context,
                               DatabaseDataHelper helper,
                               MarketPlaceRepository mpTypes
                               )
 {
     _customerMarketplaces         = customerMarketplaces;
     _marketPlaces                 = marketPlaces;
     m_oServiceClient              = new ServiceClient();
     _customers                    = customers;
     _teraPeakOrderItems           = teraPeakOrderItems;
     _yodleeAccountsRepository     = yodleeAccountsRepository;
     _yodleeSearchWordsRepository  = yodleeSearchWordsRepository;
     _yodleeGroupRepository        = yodleeGroupRepository;
     _yodleeRuleRepository         = yodleeRuleRepository;
     _yodleeGroupRuleMapRepository = yodleeGroupRuleMapRepository;
     _session      = session;
     _companyFiles = companyFiles;
     _context      = context;
     _helper       = helper;
     _mpTypes      = mpTypes;
 }         // constructor
예제 #4
0
        public void Init()
        {
            NHibernateManager.FluentAssemblies.Add(typeof(User).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(Customer).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(eBayDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(AmazonDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(PayPalDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(EkmDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(DatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(YodleeDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(PayPointDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(FreeAgentDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(SageDatabaseMarketPlace).Assembly);
            NHibernateManager.FluentAssemblies.Add(typeof(CompanyFilesDatabaseMarketPlace).Assembly);
            Scanner.Register();
            ObjectFactory.Configure(x =>
            {
                x.For <ISession>().LifecycleIs(new ThreadLocalStorageLifecycle()).Use(ctx => NHibernateManager.SessionFactory.OpenSession());
                x.For <ISessionFactory>().Use(() => NHibernateManager.SessionFactory);
            });

            _Helper = ObjectFactory.GetInstance <IDatabaseDataHelper>() as DatabaseDataHelper;

            var oLog4NetCfg = new Log4Net().Init();

            m_oLog = new ConsoleLog(new SafeILog(this));

            m_oDB = new SqlConnection(oLog4NetCfg.Environment, m_oLog);

            ConfigManager.CurrentValues.Init(m_oDB, m_oLog);
            DbConnectionPool.ReuseCount = CurrentValues.Instance.ConnectionPoolReuseCount;
            AConnection.UpdateConnectionPoolMaxSize(CurrentValues.Instance.ConnectionPoolMaxSize);
        }
예제 #5
0
 public SageRetrieveDataHelper(
     DatabaseDataHelper helper,
     DatabaseMarketplaceBaseBase marketplace
     )
     : base(helper, marketplace)
 {
 }
예제 #6
0
        }         // CreateJsonError

        public HmrcManualAccountManager(
            bool hideRealError,
            CustomerRepository customers,
            DatabaseDataHelper helper,
            MarketPlaceRepository mpTypes,
            CGMPUniqChecker mpChecker,
            IWorkplaceContext context
            )
        {
            if (hmrcVendorInfo == null)
            {
                lock (lockVendorInfo) {
                    if (hmrcVendorInfo == null)
                    {
                        hmrcVendorInfo = Configuration.Instance.GetVendorInfo("HMRC");
                    }
                }         // lock
            }             // if

            lock (lockVendorInfo) {
                this.vendorInfo = hmrcVendorInfo;
            }             // lock

            this.hideRealError     = hideRealError;
            this.customers         = customers;
            this.databaseHelper    = helper;
            this.mpTypes           = mpTypes;
            this.uniquenessChecker = mpChecker;
            this.context           = context;

            this.serviceClient = new ServiceClient();
        }         // constructor
 public PayPointRetrieveDataHelper(
     DatabaseDataHelper helper,
     DatabaseMarketplaceBaseBase marketplace
     )
     : base(helper, marketplace)
 {
 }
 public SageMarketPlacesController(
     IEzbobWorkplaceContext context,
     DatabaseDataHelper helper,
     MarketPlaceRepository mpTypes
     )
 {
     _mpTypes         = mpTypes;
     _customer        = context.Customer;
     _helper          = helper;
     m_oServiceClient = new ServiceClient();
 }
예제 #9
0
        public eBayRetriveDataHelper(
            DatabaseDataHelper helper,
            DatabaseMarketplaceBaseBase marketplace
            ) : base(helper, marketplace)
        {
            this.log      = new SafeILog(this);
            this.settings = ObjectFactory.GetInstance <IEbayMarketplaceSettings>();

            var ebayConnectionInfo = ObjectFactory.GetInstance <IEbayMarketplaceTypeConnection>();

            this.connectionInfo = eBayServiceHelper.CreateConnection(ebayConnectionInfo);
        }         // constructor
예제 #10
0
 public CGMarketPlacesController(
     IEzbobWorkplaceContext context,
     DatabaseDataHelper helper,
     MarketPlaceRepository mpTypes,
     CGMPUniqChecker mpChecker
     )
 {
     _context         = context;
     _helper          = helper;
     _mpTypes         = mpTypes;
     _mpChecker       = mpChecker;
     m_oServiceClient = new ServiceClient();
 }         // constructor
예제 #11
0
        public FreeAgentMarketPlacesController(
            IEzbobWorkplaceContext context,
            DatabaseDataHelper helper,
            MarketPlaceRepository mpTypesRepo
            )
        {
            this.customer    = context.Customer;
            this.dbHelper    = helper;
            this.mpTypesRepo = mpTypesRepo;

            this.serviceClient = new ServiceClient();
            this.connector     = new FreeAgentConnector();
        }         // constructor
예제 #12
0
 public EkmMarketPlacesController(
     IEzbobWorkplaceContext context,
     DatabaseDataHelper helper,
     MarketPlaceRepository mpTypes,
     IMPUniqChecker mpChecker
     )
 {
     _context         = context;
     _mpTypes         = mpTypes;
     _customer        = context.Customer;
     _mpChecker       = mpChecker;
     m_oServiceClient = new ServiceClient();
     _helper          = helper;
 }
예제 #13
0
		public void AgreementsSave() {
			DatabaseDataHelper _helper = ObjectFactory.GetInstance<DatabaseDataHelper>();
			// 1
			var preContract = GetTemplateByName("" + "Pre-Contract-Agreement");
			Console.WriteLine(preContract);
			// 2
			// specific LoanAgreementTemplate for current type: 
			//var preContractTemplate = _helper.GetOrCreateLoanAgreementTemplate(preContract, false ? LoanAgreementTemplateType.EzbobAlibabaPreContract : LoanAgreementTemplateType.PreContract);
			//Console.WriteLine(preContractTemplate.TemplateType);
			// 3
			//var preContractAgreement = new LoanAgreement("precontract", new Loan(), preContractTemplate);
			//Console.WriteLine(preContractAgreement.ToString());
			//Console.WriteLine(Path.Combine(@"C:\temp\logs\", @"xxx\yyy.txt"));
		}
예제 #14
0
        public AmazonRetriveDataHelper(
            DatabaseDataHelper helper,
            DatabaseMarketplaceBaseBase marketplace
            )
            : base(helper, marketplace)
        {
            this.connectionInfo = AmazonServiceConnectionFactory.CreateConnection(ObjectFactory.GetInstance <IAmazonMarketPlaceTypeConnection>());

            this.amazonSettings = new ErrorRetryingInfo((bool)CurrentValues.Instance.AmazonEnableRetrying, CurrentValues.Instance.AmazonMinorTimeoutInSeconds, CurrentValues.Instance.AmazonUseLastTimeOut)
            {
                Info = new ErrorRetryingItemInfo[2] {
                    new ErrorRetryingItemInfo(CurrentValues.Instance.AmazonIterationSettings1Index, CurrentValues.Instance.AmazonIterationSettings1CountRequestsExpectError, CurrentValues.Instance.AmazonIterationSettings1TimeOutAfterRetryingExpiredInMinutes),
                    new ErrorRetryingItemInfo(CurrentValues.Instance.AmazonIterationSettings2Index, CurrentValues.Instance.AmazonIterationSettings2CountRequestsExpectError, CurrentValues.Instance.AmazonIterationSettings2TimeOutAfterRetryingExpiredInMinutes),
                }
            };
        }         // constructor
예제 #15
0
 public EbayMarketPlacesController(
     IEzbobWorkplaceContext context,
     DatabaseDataHelper helper,
     CustomerRepository customers,
     ISession session,
     eBayServiceHelper eBayServiceHelper,
     IMPUniqChecker mpChecker)
 {
     this.context           = context;
     this.helper            = helper;
     this.customers         = customers;
     this.session           = session;
     this.eBayServiceHelper = eBayServiceHelper;
     this.serviceClient     = new ServiceClient();
     this.mpChecker         = mpChecker;
 }
예제 #16
0
 public UploadHmrcController(
     DatabaseDataHelper helper,
     MarketPlaceRepository mpTypes,
     CGMPUniqChecker mpChecker,
     CustomerRepository customers,
     IWorkplaceContext context
     )
 {
     this.vatAccountManager = new HmrcManualAccountManager(
         false,
         customers,
         helper,
         mpTypes,
         mpChecker,
         context
         );
 }         // constructor
        public PayPointMarketPlacesController(
            IEzbobWorkplaceContext context,
            DatabaseDataHelper helper,
            MarketPlaceRepository mpTypes,
            IMPUniqChecker mpChecker)
        {
            _context         = context;
            _helper          = helper;
            _mpTypes         = mpTypes;
            _customer        = context.Customer;
            _mpChecker       = mpChecker;
            m_oServiceClient = new ServiceClient();

            var payPointServiceInfo = new PayPointServiceInfo();

            _payPointMarketTypeId = _mpTypes.GetAll().First(a => a.InternalId == payPointServiceInfo.InternalId).Id;
        }
예제 #18
0
 public CustomerModelBuilder(
     ISecurityQuestionRepository questions,
     ICustomerRepository customerRepository,
     IUsersRepository users,
     PaymentRolloverRepository paymentRolloverRepository,
     DatabaseDataHelper oDbHelper,
     WhiteLabelProviderRepository whiteLabelProviderRepository
     )
 {
     m_oQuestions          = questions;
     m_oCustomerRepository = customerRepository;
     m_oUsers = users;
     m_oPaymentRolloverRepository     = paymentRolloverRepository;
     m_oChangeLoanDetailsModelBuilder = new ChangeLoanDetailsModelBuilder();
     m_oExperianDirectors             = oDbHelper.ExperianDirectorRepository;
     _whiteLabelProviderRepository    = whiteLabelProviderRepository;
 }         // constructor
예제 #19
0
 public PaymentAccountsController(
     DatabaseDataHelper dbHelper,
     CustomerRepository customersRepository,
     IEzbobWorkplaceContext context,
     IMPUniqChecker mpChecker,
     IYodleeAccountChecker yodleeAccountChecker,
     BankAccountUniqChecker bankAccountUniqChecker,
     ISortCodeChecker sortCodeChecker)
 {
     this.dbHelper               = dbHelper;
     this.customersRepository    = customersRepository;
     this.context                = context;
     this.serviceClient          = new ServiceClient();
     this.mpChecker              = mpChecker;
     this.yodleeAccountChecker   = yodleeAccountChecker;
     this.bankAccountUniqChecker = bankAccountUniqChecker;
     this.sortCodeChecker        = sortCodeChecker;
 }
예제 #20
0
 public YodleeMarketPlacesController(
     IEzbobWorkplaceContext context,
     DatabaseDataHelper dbHelper,
     MarketPlaceRepository mpTypes,
     YodleeMpUniqChecker mpChecker,
     YodleeBanksRepository yodleeBanksRepository,
     YodleeAccountsRepository yodleeAccountsRepository,
     CompanyFilesMetaDataRepository companyFilesMetaDataRepository)
 {
     this.context                        = context;
     this.dbHelper                       = dbHelper;
     this.mpTypes                        = mpTypes;
     this.customer                       = context.Customer;
     this.mpChecker                      = mpChecker;
     this.serviceClient                  = new ServiceClient();
     this.yodleeBanksRepository          = yodleeBanksRepository;
     this.yodleeAccountsRepository       = yodleeAccountsRepository;
     this.companyFilesMetaDataRepository = companyFilesMetaDataRepository;
 }
예제 #21
0
        public HmrcController(
            IEzbobWorkplaceContext context,
            DatabaseDataHelper helper,
            MarketPlaceRepository mpTypes,
            CGMPUniqChecker mpChecker,
            CustomerRepository customers
            )
        {
            this.accountManager = new HmrcManualAccountManager(
                true,
                customers,
                helper,
                mpTypes,
                mpChecker,
                context
                );

            this.context = context;
        }         // constructor
예제 #22
0
 public AmazonMarketPlacesController(
     IEzbobWorkplaceContext context,
     DatabaseDataHelper helper,
     ISession session,
     CustomerMarketPlaceRepository customerMarketPlaceRepository,
     AskvilleRepository askvilleRepository,
     IMPUniqChecker mpChecker,
     CustomerRepository customerRepository)
 {
     _context         = context;
     _helper          = helper;
     m_oServiceClient = new ServiceClient();
     _session         = session;
     _customerMarketPlaceRepository = customerMarketPlaceRepository;
     _askvilleRepository            = askvilleRepository;
     _mpChecker       = mpChecker;
     _askvilleService = new AmazonServiceAskville(CurrentValues.Instance.AmazonAskvilleLogin,
                                                  CurrentValues.Instance.AmazonAskvillePassword);
     _customerRepository = customerRepository;
 }
예제 #23
0
 public YodleeRetriveDataHelper(DatabaseDataHelper helper,
                                DatabaseMarketplaceBaseBase marketplace)
     : base(helper, marketplace)
 {
 }
예제 #24
0
 public override IMarketplaceRetrieveDataHelper GetRetrieveDataHelper(DatabaseDataHelper helper)
 {
     return(new YodleeRetriveDataHelper(helper, this));
 }
예제 #25
0
 public override IMarketplaceRetrieveDataHelper GetRetrieveDataHelper(DatabaseDataHelper helper)
 {
     return(new CompanyFilesRetriveDataHelper(helper, this));
 }
        public YodleeModel BuildYodlee(MP_CustomerMarketPlace mp, DateTime?history)
        {
            DateTime now = history ?? DateTime.UtcNow;
            YodleeOrderDictionary yodleeData = null;
            var directors = new List <string>();

            _timeElapsed = new List <System.Tuple <string, double> >();
            Stopwatch sw = Stopwatch.StartNew();

            if (mp.Marketplace.InternalId == new YodleeServiceInfo().InternalId)
            {
                var ddh = new DatabaseDataHelper(_session);
                yodleeData = ddh.GetAllYodleeOrdersData(now, mp, false, out directors);
            }             // if
            sw.Stop();
            _timeElapsed.Add(new System.Tuple <string, double>("GetAllYodleeOrdersData", sw.Elapsed.TotalMilliseconds));
            if (yodleeData == null)
            {
                Log.Debug("Yodlee model building complete for marketplace {0}: no data.", mp.Stringify());
                return(null);
            }             // if

            var model = new YodleeModel();

            sw.Restart();
            var ruleModelBuilder = new YodleeRuleModelBuilder(_session);

            model.RuleModel = ruleModelBuilder.Build();
            sw.Stop();
            _timeElapsed.Add(new System.Tuple <string, double>("YodleeRuleModel", sw.Elapsed.TotalMilliseconds));
            model.BankStatementDataModel = new BankStatementDataModel();

            var banks   = new List <YodleeBankModel>();
            var yearAgo = new DateTime(now.Year, now.Month, 1).AddYears(-1);

            Log.Debug("Yodlee model is being built for marketplace {0}...", mp.Stringify());
            sw.Restart();
            foreach (var bank in yodleeData.Data.Keys)
            {
                Log.Debug("Yodlee model is being built for marketplace {0}, bank {1}...", mp.Stringify(), bank.customName);

                double?availableBalance    = CurrencyXchg(bank.availableBalance, bank.asOfDate.date);
                double?currentBalance      = CurrencyXchg(bank.currentBalance, bank.asOfDate.date);
                double?overdraftProtection = CurrencyXchg(bank.overdraftProtection, bank.asOfDate.date);

                var yodleeBankModel = new YodleeBankModel {
                    isDeleted           = bank.isDeleted != 0,
                    accountNumber       = bank.accountNumber,
                    accountHolder       = bank.accountHolder,
                    accountType         = bank.acctType,
                    availableBalance    = availableBalance,
                    currentBalance      = currentBalance,
                    accountName         = bank.accountName,
                    routingNumber       = bank.routingNumber,
                    asOfDate            = bank.asOfDate.date,
                    overdraftProtection = overdraftProtection,
                };

                var transactions = new List <YodleeTransactionModel>();

                Log.Debug("Yodlee model is being built for marketplace {0}, bank {1}, going over transactions...", mp.Stringify(), bank.customName);

                foreach (var transaction in yodleeData.Data[bank])
                {
                    DateTime?oDate = transaction.postDate.date ?? transaction.transactionDate.date;
                    if (!oDate.HasValue || oDate.Value < yearAgo)
                    {
                        continue;                        //take only 12 month of data
                    }

                    double?transactionAmount = CurrencyXchg(transaction.transactionAmount, oDate);
                    double?runningBalance    = CurrencyXchg(transaction.runningBalance, oDate);

                    var yodleeTransactionModel = new YodleeTransactionModel {
                        transactionBaseType = transaction.transactionBaseType,
                        transactionType     = transaction.transactionType,
                        transactionDate     = (transaction.postDate.date ?? transaction.transactionDate.date).Value,
                        categoryName        = transaction.memo,
                        categoryType        = transaction.userDescription,
                        transactionAmount   = transactionAmount,
                        description         = transaction.description,
                        runningBalance      = runningBalance,
                        transactionStatus   = transaction.transactionStatus,
                        bankTransactionId   = transaction.bankTransactionId,
                        ezbobGroup          = transaction.siteCategory,
                        ezbobSubGroup       = transaction.siteCategoryType,
                        ezbobGroupPriority  = transaction.customCategoryId ?? 0
                    };

                    transactions.Add(yodleeTransactionModel);
                }                 // for each transaction

                Log.Debug("Yodlee model is being built for marketplace {0}, bank {1}, done going over transactions.", mp.Stringify(), bank.customName);

                yodleeBankModel.transactions = transactions.OrderByDescending(t => t.transactionDate).ToList();

                banks.Add(yodleeBankModel);

                Log.Debug("Yodlee model is being built for marketplace {0}, done with bank {1}.", mp.Stringify(), bank.customName);
            }             // for each bank

            model.banks = banks;
            sw.Stop();
            _timeElapsed.Add(new System.Tuple <string, double>("YodleeTransactionsModel", sw.Elapsed.TotalMilliseconds));

            Log.Debug("Yodlee model is being built for marketplace {0}, done with banks.", mp.Stringify());

            YodleeSearchWordsModel yodleeSearchWordsModel;

            YodleeRunningBalanceModel yodleeRunningBalanceModel;

            sw.Restart();
            model.CashFlowReportModel = CreateYodleeCashFlowModel(model, mp.Id, mp.Customer, directors, out yodleeSearchWordsModel, out yodleeRunningBalanceModel);
            model.SearchWordsModel    = yodleeSearchWordsModel;
            model.RunningBalanceModel = yodleeRunningBalanceModel;
            sw.Stop();
            _timeElapsed.Add(new System.Tuple <string, double>("YodleeCashFlowModel", sw.Elapsed.TotalMilliseconds));

            Log.Debug("Yodlee model is ready for marketplace {0}.", mp.Stringify());
            LogElapsedTimes(mp.Id, mp.Customer.Id);
            return(model);
        }
 public CompanyFilesRetriveDataHelper(
     DatabaseDataHelper helper,
     DatabaseMarketplaceBaseBase marketplace
     ) : base(helper, marketplace)
 {
 }         // constructor
예제 #28
0
 public abstract IMarketplaceRetrieveDataHelper GetRetrieveDataHelper(DatabaseDataHelper helper);
 protected MarketplaceRetrieveDataHelperBase(DatabaseDataHelper helper, DatabaseMarketplaceBaseBase marketplace)
 {
     Helper       = helper;
     _Marketplace = marketplace;
 }