//TODO: Chuyển sang file web config private RateAndPrices GetRateAndPrices() { var context = new StoreInfoContext(); var result = new RateAndPrices(); //result.LocalGolds = new List<ReuterIndex> { // _reuterIndexRepository.GetByCode("SJC=") //}; //result.GlobalGolds = new List<ReuterIndex> { // _reuterIndexRepository.GetByCode("XAU=") //}; //result.Oils = new List<ReuterIndex> { // _reuterIndexRepository.GetByCode(".NAT_GAS"), // _reuterIndexRepository.GetByCode(".OIL"), // _reuterIndexRepository.GetByCode(".BRENT"), // _reuterIndexRepository.GetByCode(".GASOLINE"), //}; //result.Metals = new List<ReuterIndex> { // _reuterIndexRepository.GetByCode("XAG="), // _reuterIndexRepository.GetByCode("XPT="), //}; //result.VNDRates = _vndExchangeRateRepository.GetLastRates(); //var usdcodes = new List<string> { "EUR=", "INR=", "AUD=", "GBP=" }; //result.GoldVNs = context.GoldPriceVietNams.Where(g => g.IsShow == 1).OrderBy(g => g.Order).ToList(); //result.GoldWorlds = context.GoldPriceWorlds.OrderBy(e => e.Order).ToList(); //result.Metals = context.MetalPrices.Where(e => e.Order > 0).OrderBy(e => e.Order).ToList(); //result.Oils = context.OilPrices.OrderBy(e => e.Order).ToList(); //result.USDRates = context.USDExchangeRates.OrderBy(e => e.Order).ToList(); //result.VNDRates = context.VNDExchangeRates.OrderBy(e => e.Order).ToList(); //result.WorldStocks = context.StockWorlds.ToList(); //result.VNStocks = context.StockMarket_RealTimes.Where(s => s.IsShown).OrderBy(s => s.Order).ToList(); //usdcodes.ForEach(code => result.USDRates.Add(_reuterIndexRepository.GetByCode(code))); //var stockcodes = new List<string> { ".HNXI", ".VNI", ".DJI", ".IXIC", ".GSPC", "WTC-", "/.FCHI", "/.STOXX", "/.FTSE", ".N225", "/.HSI", "/.CSI300" }; //result.GlobalStockList = new List<ReuterIndex>(); //stockcodes.ForEach(code => result.GlobalStockList.Add(_reuterIndexRepository.GetByCode(code))); //result.VnMarketIndices = _vnMarketIndexRepository.GetLastIndices(); return(result); }
public PartialViewResult MarketInfo() { RateAndPrices model = GetRateAndPrices(); return(PartialView("_MarketInfo", model)); }