Ejemplo n.º 1
0
        public ActionResult Admin()
        {
            AdminViewModel viewModel = new AdminViewModel();

            viewModel.Users = db.Users.AsEnumerable();
            viewModel.MessageHtmlContent = db.GetParameterValueByCode(ParameterType.RegMessageContent);

            //registered users
            viewModel.RegisteredUsersChartViewModel = new MorrisLineChartViewModel
            {
                HeaderTitle   = "Registered Users",
                Dates         = db.Users.Where(u => u.CreationDate.HasValue).AsEnumerable().Select(u => u.CreationDateLocal.Value).AsEnumerable(),
                Interval      = DateInterval.Monthly,
                Label         = "Users",
                HtmlElementId = "registered-users"
            };

            return(View(viewModel));
        }