Exemple #1
0
 public CurrencyExchangeHandler(ILogger <CurrencyExchangeHandler> logger, ILogFormatter logFormatter,
                                IExchangeRateService exchangeRateService)
 {
     _logger              = logger;
     _logFormatter        = logFormatter;
     _exchangeRateService = exchangeRateService;
 }
 public ExchangeRateCommandService(IExchangeRateService exchangeRateService, IUnitOfWork unitOfWork, ICommandExecutor executor)
 {
   _exchangeRateService = exchangeRateService;
   _unitOfWork = unitOfWork;
   _executor = executor;
   _userSession = new UserSession();
 }
Exemple #3
0
 public ExchangeRateCommandService(IExchangeRateService exchangeRateService, IUnitOfWork unitOfWork, ICommandExecutor executor)
 {
     _exchangeRateService = exchangeRateService;
     _unitOfWork          = unitOfWork;
     _executor            = executor;
     _userSession         = new UserSession();
 }
 public BaseController()
 {
     this.userService                 = new UserService();
     this.rightService                = new RightService();
     this.locationService             = new LocationService();
     this.organisationService         = new OrganisationService();
     this.siteService                 = new SiteService();
     this.billService                 = new BillService();
     this.itemService                 = new ItemService();
     this.requestToAcquireItemService = new RequestToAcquireAssestService();
     this.eventService                = new EventService();
     this.assetService                = new AssetService();
     this.assetHistoryService         = new AssetHistoryService();
     this.requestForScrappingService  = new RequestForScrappingService();
     this.requestForRelocationService = new RequestForRelocationService();
     this.requestForRenovationService = new RequestForRenovationService();
     this.providerService             = new ProviderService();
     this.packingSlipService          = new PackingSlipService();
     this.requestForAssetService      = new RequestForAssetService();
     this.requestToProviderService    = new RequestToProviderService();
     this.currencyService             = new CurrencyService();
     this.invoiceService              = new InvoiceService();
     this.exchangeService             = new ExchangeRateService();
     this.accidentService             = new AccidentService();
     this.securityGroupService        = new SecurityGroupService();
 }
 public GetCryptoCurrencyExchangeRatesQueryHandler(ICryptoCurrencyService cryptoCurrencyService,
                                                   IConfiguration configuration, IExchangeRateService exchangeRateService)
 {
     _cryptoCurrencyService = cryptoCurrencyService;
     _configuration         = configuration;
     _exchangeRateService   = exchangeRateService;
 }
Exemple #6
0
 public ExchangeRateController(IExchangeRateService exchangeRateService, IHttpClientFactory httpClientFactory, IConfiguration configuration)
 {
     _exchangeRateService = exchangeRateService;
     _httpClientFactory   = httpClientFactory;
     _configuration       = configuration;
     endpoint             = _configuration.GetConnectionString("ExchangeRatesApi");
 }
Exemple #7
0
 public ExchangeRateServiceTests()
 {
     TestServicesProvider.GetModelTestData().FillData();
     context             = TestServicesProvider.GetContext();
     exchangeRateService = TestServicesProvider.GetExchangeRateService();
     accountService      = TestServicesProvider.GetAccountService();
 }
Exemple #8
0
        /// <summary>
        /// This is used mainly for ViewBudget. It calculates the numbers (totals) for each category
        /// </summary>
        /// <param name="category"></param>
        /// <param name="budgetLines"></param>
        private static void AddCategoryLinesWithNumbers(IExchangeRateService exchangeRateService, Models.Category category,
                                                        List <ProjectBudget> budgetLines, Currency displayCurrency, CountryProgramme countryProg)
        {
            List <Models.BudgetLine> bsl = new List <Models.BudgetLine>();

            Models.BudgetLine subLine;
            decimal           budgetAmount;
            decimal?          committed, posted;

            budgetAmount = 0;
            committed    = posted = 0;
            foreach (ProjectBudget item in budgetLines)
            {
                subLine = new Models.BudgetLine();
                subLine.EntityBudgetLine     = item;
                subLine.SubLineId            = item.Id;
                subLine.BudgetCategoryId     = category.EntityBudgetCategory.Id.ToString();
                subLine.BudgetCategoryNumber = category.EntityBudgetCategory.Number;
                subLine.TotalBudget          = (decimal)exchangeRateService.GetForeignCurrencyValue(displayCurrency, item.BudgetCategory.ProjectDonor.Currency, item.TotalBudget, countryProg.Id);
                subLine.TotalCommitted       = (decimal)exchangeRateService.GetForeignCurrencyValue(displayCurrency, item.BudgetCategory.ProjectDonor.Currency, item.TotalCommitted, countryProg.Id);
                subLine.TotalPosted          = (decimal)exchangeRateService.GetForeignCurrencyValue(displayCurrency, item.BudgetCategory.ProjectDonor.Currency, item.TotalPosted, countryProg.Id);
                subLine.RemainingBalance     = subLine.TotalBudget - (subLine.TotalCommitted + subLine.TotalPosted);
                //Sum up for category
                budgetAmount += subLine.TotalBudget;
                committed    += subLine.TotalCommitted;
                posted       += subLine.TotalPosted;
                bsl.Add(subLine);
            }
            category.BudgetLines      = bsl;
            category.TotalBudget      = budgetAmount;
            category.TotalCommitted   = committed;
            category.TotalPosted      = posted;
            category.RemainingBalance = budgetAmount - (committed + posted);
        }
Exemple #9
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="AccountService" /> class.
        /// </summary>
        /// <param name="databaseContext">The database context.</param>
        /// <param name="exchangeRateService">The exchange rate service.</param>
        /// <param name="bankBalanceService">The bank balance service.</param>
        /// <param name="journalService">The journal service.</param>
        public AccountService(IDatabaseContext databaseContext, IExchangeRateService exchangeRateService, IBankBalanceService bankBalanceService, IJournalService journalService)
        {
            if (databaseContext == null)
            {
                throw new ArgumentNullException(nameof(databaseContext));
            }

            if (exchangeRateService == null)
            {
                throw new ArgumentNullException(nameof(exchangeRateService));
            }

            if (bankBalanceService == null)
            {
                throw new ArgumentNullException(nameof(bankBalanceService));
            }

            if (journalService == null)
            {
                throw new ArgumentNullException(nameof(journalService));
            }

            _exchangeRateService = exchangeRateService;
            _databaseContext     = databaseContext;
            _bankBalanceService  = bankBalanceService;
            _journalService      = journalService;
        }
Exemple #10
0
 public WalletService(ICelsiusApiService celsiusApiService, ICurrencyService currencyService
                      , IExchangeRateService exchangeService)
 {
     _celsiusApiService = celsiusApiService;
     _currencyService   = currencyService;
     _exchangeService   = exchangeService;
 }
Exemple #11
0
 public HomeController(ILogger <HomeController> logger, ITransactionService transactionService,
                       IExchangeRateService exchangeRateService)
 {
     _logger              = logger;
     _transactionService  = transactionService;
     _exchangeRateService = exchangeRateService;
 }
Exemple #12
0
 public PgCostBuilder(IPgStageBuilder pgStageBuilder,
                      IRuleService ruleService,
                      ICostStageRevisionService costStageRevisionService,
                      IAgencyService agencyService,
                      IProjectService projectService,
                      EFContext efContext,
                      ICostNumberGeneratorService costNumberGeneratorService,
                      IPgCurrencyService currencyService,
                      IPgLedgerMaterialCodeService pgLedgerMaterialCodeService,
                      ICostLineItemService costLineItemService,
                      ICostTemplateVersionService costTemplateVersionService,
                      IPermissionService permissionService,
                      IPgCostService pgCostService,
                      IPgCostSectionTotalsBuilder pgTotalsBuilder,
                      IPgPaymentService pgPaymentService,
                      IExchangeRateService exchangeRateService)
 {
     _pgStageBuilder           = pgStageBuilder;
     _ruleService              = ruleService;
     _costStageRevisionService = costStageRevisionService;
     _agencyService            = agencyService;
     _projectService           = projectService;
     _efContext = efContext;
     _costNumberGeneratorService  = costNumberGeneratorService;
     _currencyService             = currencyService;
     _pgLedgerMaterialCodeService = pgLedgerMaterialCodeService;
     _costLineItemService         = costLineItemService;
     _costTemplateVersionService  = costTemplateVersionService;
     _permissionService           = permissionService;
     _pgCostService       = pgCostService;
     _pgTotalsBuilder     = pgTotalsBuilder;
     _pgPaymentService    = pgPaymentService;
     _exchangeRateService = exchangeRateService;
 }
Exemple #13
0
        private MainViewModel GetVm()
        {
            MainViewModel.IsUnitTesting = true;
            _ibClient                = new IBClient(new EReaderMonitorSignal());
            _connectionService       = Substitute.For <IConnectionService>();
            _orderManager            = Substitute.For <IOrderManager>();
            _accountManager          = Substitute.For <IAccountManager>();
            _contractManager         = Substitute.For <IContractManager>();
            _marketDataManager       = Substitute.For <IMarketDataManager>();
            _historicalDataManager   = Substitute.For <IHistoricalDataManager>();
            _orderCalculationService = Substitute.For <IOrderCalculationService>();
            _exchangeRateService     = Substitute.For <IExchangeRateService>();
            _tradeRepository         = Substitute.For <ITradeRepository>();
            var orderManager = Substitute.For <IOrderManager>();

            _ordersViewModel    = new OrdersViewModel(_contractManager, _marketDataManager, _historicalDataManager, _orderCalculationService, orderManager, _tradeRepository);
            _statusBarViewModel = Substitute.For <StatusBarViewModel>();

            var positionsManager   = Substitute.For <IPositionManager>();
            var contractManager    = Substitute.For <IContractManager>();
            var positionsViewModel = new PositionsViewModel(_marketDataManager, _accountManager, positionsManager, contractManager);
            var detailsViewModel   = new DetailsViewModel();

            _settingsViewModel = new SettingsViewModel();

            return(new MainViewModel(_ibClient, _connectionService, _orderManager, _accountManager, _ordersViewModel, _statusBarViewModel, _historicalDataManager, _exchangeRateService, _orderCalculationService, positionsViewModel, detailsViewModel, _settingsViewModel));
        }
Exemple #14
0
 public CurrencyController(ILogger <CurrencyController> logger, ICurrencyService currencyService, IExchangeRateService exchangeRateService, IMapper mapper)
 {
     this.Logger              = logger ?? throw new ArgumentNullException(nameof(logger));
     this.currencyService     = currencyService;
     this.exchangeRateService = exchangeRateService;
     this.mapper              = mapper;
 }
 public CalculatorService(IDefaultHttpClientAccessor client, IOptions <Urls> options, IExchangeRateService exchangeRateService)
 {
     _client = client;
     this._exchangeRateService = exchangeRateService;
     _options = options.Value;
     _client.SetConnection(_options.MainURL);
 }
 public InvoiceService(IUnitOfWork unitOfWork, IMapper mapper, IExchangeRateService exchangeRateService)
 {
     _unitOfWork = unitOfWork;
     _unitOfWork.SetLazyLoading(false);
     _mapper = mapper;
     _exchangeRateService = exchangeRateService;
 }
 public ExchangeRateApplication(IExchangeRatesRepository exchangeRatesRepository,
                                IDateValidationService dateValidationService,
                                IExchangeRateService exchangeRateService)
 {
     _exchangeRatesRepository = exchangeRatesRepository;
     _dateValidationService   = dateValidationService;
     _exchangeRateService     = exchangeRateService;
 }
Exemple #18
0
 public ExchangeRateBot(IMessengerProvider provider,
                        IExchangeRateService exchangeRateService,
                        IHelpCommandTextBuilder helpCommandTextBuilder)
 {
     _service  = exchangeRateService ?? throw new ArgumentNullException(nameof(exchangeRateService));
     _provider = provider ?? throw new ArgumentNullException(nameof(provider));
     _helpCommandTextBuilder = helpCommandTextBuilder ?? throw new ArgumentNullException(nameof(helpCommandTextBuilder));
 }
 public ExchangeRateController(ILogger <ExchangeRateController> logger,
                               IMapper mapper,
                               IExchangeRateService exchangeRateService)
 {
     this.logger = logger;
     this.mapper = mapper;
     this.exchangeRateService = exchangeRateService;
 }
Exemple #20
0
        public static ExchangeRateListingViewModel LoadExchangeIndexViewModel(IExchangeRateService exchangeRateService)
        {
            ExchangeRateListingViewModel exchangeRateViewModel = new ExchangeRateListingViewModel(exchangeRateService);

            // everything is fine :D
            exchangeRateViewModel.LoadExchangeIndexes();
            return(exchangeRateViewModel);
        }
        public Form1()
        {
            InitializeComponent();

            GetRateButton.Click += async(s, e) => await GetRate_Click(s, e);

            _exchangeRateService = new SuperRichService(HttpClientSingleton.Instance);
        }
 public EnvelopeController(IEnvelopeService service, IExchangeRateService exRateService,
                           IExchangeRateHttpService exRateHttpService, ICurrencyService currService)
 {
     envelopeService         = service;
     exchangeRateService     = exRateService;
     exchangeRateHttpService = exRateHttpService;
     currencyService         = currService;
 }
 public UpdateCoinbaseExchangeRatesCommandHandler(ILogger <UpdateCoinbaseExchangeRatesCommandHandler> logger,
                                                  IExchangeRateService exchangeRateService,
                                                  IHubDbRepository dbRepository)
 {
     _logger = logger;
     _exchangeRateService = exchangeRateService;
     _dbRepository        = dbRepository;
 }
 public ExchangeRateController(IExchangeRateService exchangeRateService)
 {
     if (exchangeRateService == null)
     {
         throw new ArgumentNullException("exchangeRateService");
     }
     _exchangeRateService = exchangeRateService;
 }
 public StaticDataController(ILogger <StaticDataController> logger, ICityService cityService, ICountryService countryService, ICurrencyService currencyService, IExchangeRateService exchangeRateService)
     : base(logger)
 {
     _cityService         = cityService;
     _countryService      = countryService;
     _currencyService     = currencyService;
     _exchangeRateService = exchangeRateService;
 }
Exemple #26
0
 public FunctionsService(ApplicationDbContext db,
                         IAccountService accountService,
                         IExchangeRateService exchangeRateService)
 {
     this.db                  = db;
     this.accountService      = accountService;
     this.exchangeRateService = exchangeRateService;
 }
Exemple #27
0
 public TransferServiceTests()
 {
     transferRepository  = NSubstitute.Substitute.For <ITransferRepository>();
     accountService      = NSubstitute.Substitute.For <IAccountService>();
     userRepository      = NSubstitute.Substitute.For <IUserRepository>();
     exchangeRateService = NSubstitute.Substitute.For <IExchangeRateService>();
     mapper = NSubstitute.Substitute.For <IMapper>();
 }
Exemple #28
0
 public ExchangeRateController(IExchangeRateService exchangeRateService)
 {
     if (exchangeRateService == null)
     {
         throw new ArgumentNullException("exchangeRateService");
     }
     _exchangeRateService = exchangeRateService;
 }
 public UpdateCoinbaseAccountsCommandHandler(ILogger <UpdateCoinbaseAccountsCommandHandler> logger,
                                             IExchangeRateService exchangeRateService,
                                             IHubDbRepository dbRepository, ICoinbaseConnector coinbaseConnector)
 {
     _logger = logger;
     _exchangeRateService = exchangeRateService;
     _dbRepository        = dbRepository;
     _coinbaseConnector   = coinbaseConnector;
 }
 public RiskCalculationService(
     IExchangeRateService exchangeRateService,
     IAccountManager accountManager,
     SettingsViewModel settingsViewModel)
 {
     _exchangeRateService = exchangeRateService;
     _accountManager      = accountManager;
     _settingsViewModel   = settingsViewModel;
 }
 public UpdateExchangeRateScheduleTask(
     ICurrencyService currencyService,
     IExchangeRateService exchangeRateService,
     CurrencySettings currencySettings)
 {
     _currencyService     = currencyService;
     _exchangeRateService = exchangeRateService;
     _currencySettings    = currencySettings;
 }
Exemple #32
0
 /// <summary>
 /// Customer Quotation Service
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="configuration"></param>
 /// <param name="exchangeRateService"></param>
 /// <param name="segmentTaxService"></param>
 public QuotationService(ILogger <QuotationService> logger,
                         IConfiguration configuration, IExchangeRateService exchangeRateService, ISegmentTaxService segmentTaxService)
 {
     _logger          = logger;
     ExchangeSettings = configuration.GetSection("ExchangeSettings").Get <ApiConfigurationSettings>();
     TaxSettings      = configuration.GetSection("TaxSettings").Get <ApiConfigurationSettings>();
     SegmentTaxSvc    = segmentTaxService;
     ExchangeRateSvc  = exchangeRateService;
 }
 public ExchangeRateController(IExchangeRateService exchangeRateService)
 {
     this.exchangeRateService = exchangeRateService;
 }
 public ExchangeRateReportService(ICommandExecutor executor, IExchangeRateService exchangeRateService)
 {
   _executor = executor;
   _exchangeRateService = exchangeRateService;
   _userSession = new UserSession();
 }