Beispiel #1
0
        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);
        }
Beispiel #2
0
        public IActionResult GetConcurrentUsersLatest()
        {
            var res = _pfd.GetConcurrentUsersLatest();

            if (res == null)
            {
                return(NotFound());
            }

            return(Ok(res));
        }