public void OnGet() { Sessions = -1; var ret = _dal.GetConcurrentUsersLatest(); if (ret != null) { Sessions = ret.CulSessions; Users = ret.CulUsers; } var all = _dal.GetConcurrentUsers(DateTime.Today); // DateTime.Parse("2016-01-12")); //DateTime.Now); int cnt = 0; datasource = new List <data>(); foreach (var a in all) { cnt++; datasource.Add(new data { x = cnt, xval = a.CulDate.ToString(), yval = a.CulSessions }); } datasource.Reverse(); ViewData["peakusers"] = all.Max(p => p.CulUsers); ViewData["peaksessions"] = all.Max(p => p.CulSessions); }
public IActionResult GetConcurrentUsers(string date) { DateTime dt = DateTime.Today; if (date != "today") { dt = Convert.ToDateTime(date); } var res = _pfd.GetConcurrentUsers(dt); if (res == null) { return(NotFound()); } return(Ok(res)); }