public async Task<ActionResult> Index(int row = 20) { ViewBag.DescriptionTile = Resources.VN_Resources.DIV_Title; using (Stoxdb = new StoxDataEntities()) { if (row > 60) { row = 60; } var yearReportParameter = new SqlParameter("@YearReport", 2014); var rowtotal = new SqlParameter("@TotalRow", row); var result = await Stoxdb.Database .SqlQuery<DIV>("VFS_DIV @YearReport,@TotalRow", yearReportParameter, rowtotal).ToListAsync(); //int pageSize = 60; //int pageNumber = 1;// (page ?? 1); return View(result); } }
public async Task<string> GetStockSuggest(string query) { if (!string.IsNullOrEmpty(query)) { using (Stoxdb = new StoxDataEntities()) { var result = await (from tk in Stoxdb.stox_tb_Company where tk.Ticker.Contains(query) select new TickerSuggest { id = tk.Ticker, name = tk.ShortName }).ToListAsync(); return Newtonsoft.Json.JsonConvert.SerializeObject(result); //return "[{name: 'Georges Washington', email: '*****@*****.**'},{name: 'Theodore Roosevelt',email: '*****@*****.**'},{name: 'Benjamin Franklin',email: '*****@*****.**'},{name: 'Abraham Lincoln',email: '*****@*****.**'}]"; } } else { return "[]"; } }