예제 #1
0
        public DataTableObject <IEnumerable <ViewModels.RateListViewModel> > GetRatesForBase(DataTableParams p, string baseCurrency)
        {
            Lookups.CurrencyLookup c = new Lookups.CurrencyLookup();
            var res = DIResolver.Data.NinjectConfig.GetKernal().Get <CuMaster.Data.RepositoryInterfaces.IRateTrendsRepository>();
            DataTableObject <IEnumerable <Data.Entities.CurrencyRateEntity> > result = res.GetForDataTable(baseCurrency, p);

            return(new DataTableObject <IEnumerable <ViewModels.RateListViewModel> >
            {
                data = ((IEnumerable <Data.Entities.CurrencyRateEntity>)result.data).Select(t => new RateListViewModel
                {
                    BaseCurrency = t.FromCurrency,
                    CurrencyTo = t.ToCurrency,
                    CurrencyToName = t.ToCurrencyName,
                    DateUpdated = t.LastUpdated,
                    RateFowards = t.Rate,
                    RateInverse = (t.Rate != 0) ? (1 / t.Rate) : 0,
                    IsFromRateCrypto = t.IsCryptoFrom,
                    IsToRateCrypto = t.IsCryptoTo
                }),
                extraData = result.extraData,
                recordsFiltered = result.recordsFiltered,
                recordsTotal = result.recordsTotal,
                draw = result.draw
            });
        }
예제 #2
0
        private CurrencyRateModel CreateEqualRateModel(string currencyFrom)
        {
            var cLook = new Lookups.CurrencyLookup(true);

            return(new CurrencyRateModel(currencyFrom));
        }