public void LoadCheckedCurrencies()
 {
     foreach (var cur in ISStore.CheckedCurrencies)
     {
         if (Currencies.Any(x => x.Name == cur))
         {
             Currencies.First(x => x.Name == cur).Visible = true;
         }
     }
 }
Exemplo n.º 2
0
 private void loadCurrenciesToList(DataTable table)
 {
     foreach (DataRow row in table.Rows)
     {
         if (!Currencies.Any(Currency => Currency.Name == row["kód"].ToString()) &&
             MonitoredCurrencies.Contains(row["kód"].ToString()))
         {
             Currencies.Add(new Currency(row["kód"].ToString(), row["země"].ToString()));
         }
     }
 }
Exemplo n.º 3
0
        private void Loop_Query_CMC()
        {
            if (string.IsNullOrEmpty(CMCAPIKEY))
            {
                log.Warning("No CMC API Key provided: No Crypto data.");

                return;
            }

            _ = Task.Run(async() =>
            {
                await Task.Delay(5000);

                while (true)
                {
                    try
                    {
                        Query_CMC();

                        foreach (var request in Requests)  // Request for Change 1h/24h/7d/30d
                        {
                            string reference = default;

                            Dispatcher.Invoke(() =>
                            {
                                reference = ComboBox_ReferenceCurrency.SelectedItem as string ?? string.Empty;
                            });

                            if (!string.IsNullOrEmpty(reference))
                            {
                                if (!Currencies.Any(x => x == request.Item1 && reference == request.Item2))
                                {
                                    await Query_CMC_Specific(request.Item1, request.Item2);
                                }
                            }
                        }
                    }
                    finally
                    {
                        await Task.Delay(AGE_CMC_CHANGE);
                    }
                }
            });
        }
Exemplo n.º 4
0
 public AddEditExchangeRateViewModel(IExchangeRatesService exchangeRatesService, ICurrenciesService currenciesService)
 {
     _exchangeRatesService           = exchangeRatesService;
     _currenciesService              = currenciesService;
     CancelCommand                   = new RelayCommand(OnCancel);
     SaveCommand                     = new RelayCommand(OnSave, CanSave);
     CurrenciesDropDownOpenedCommand = new RelayCommand(OnCurrenciesDropDownOpened, () => Currencies != null && Currencies.Any());
 }
 public AddEditBankAccountViewModel(IBankAccountsService bankAccountsService, RelatedPersonListViewModel relatedPersonListViewModel, IBanksService banksService, ICurrenciesService currenciesService, IAccountTypesService accountTypesService)
 {
     _currenciesService              = currenciesService;
     _bankAccountsService            = bankAccountsService;
     _banksService                   = banksService;
     _accountTypesService            = accountTypesService;
     CancelCommand                   = new RelayCommand(OnCancel);
     SaveCommand                     = new RelayCommand(OnSave, CanSave);
     BanksDropDownOpenedCommand      = new RelayCommand(OnBanksDropDownOpened, () => Banks != null && Banks.Any());
     CurrenciesDropDownOpenedCommand = new RelayCommand(OnCurrenciesDropDownOpened, () => Currencies != null && Currencies.Any());
     RelatedPersonListViewModel      = relatedPersonListViewModel;
 }
Exemplo n.º 6
0
        public DLListViewModel(ISystemAccountingSettingsService systemAccountingSettingsService
                               , IBankAccountsService bankAccountsService, IBanksService banksService, ICurrenciesService currenciesService, IAccountTypesService accountTypesService, ICompanyInformationsService companyInformationsService)
        {
            _companyInformationsService      = companyInformationsService;
            CompanyInformationModel          = _companyInformationsService.GetCompanyInformationModel();
            _systemAccountingSettingsService = systemAccountingSettingsService;

            _banksService                   = banksService;
            _currenciesService              = currenciesService;
            _accountTypesService            = accountTypesService;
            _bankAccountsService            = bankAccountsService;
            BanksDropDownOpenedCommand      = new RelayCommand(OnBanksDropDownOpened, () => Banks != null && Banks.Any());
            CurrenciesDropDownOpenedCommand = new RelayCommand(OnCurrenciesDropDownOpened, () => Currencies != null && Currencies.Any());
            AddDLCommand   = new RelayCommand(OnAddDL);
            EditDLCommand  = new RelayCommand <DL>(OnEditDL);
            _accessUtility = SmObjectFactory.Container.GetInstance <AccessUtility>();
        }
Exemplo n.º 7
0
 private bool IsCurrencyPassed(CoinModel coin)
 {
     return(Currencies.Any(x => x.IsPassed(coin.Currency)));
 }