Example #1
0
        public ActionResult Index()
        {
            //    var From = _settingManager.GetSettingValue("From_Info");

            //    EmailService _emailService = new EmailService(_settingManager);
            //    _emailService.Send(From , "*****@*****.**", "Test Email", "<h1>Test Email</h1>");
            var scale = new Scale(_lookupAppService);
            var model = new HomeIndexCommonVModel
            {
                UserTrackingFilter = new UserTrackingFilter()
                {
                    MeasurementScale = scale
                },
            };

            if (_userManager.IsAdminUser(AbpSession.UserId.Value))
            {
                model.UserTrackingFilter.UserList = _lookupAppService.GetUserComboboxItems().Result.Items.Select(p => p.ToSelectListItem()).ToList();
                model.UserTrackingFilter.UserList.Insert(0, new SelectListItem {
                    Value = string.Empty, Text = L("All"), Selected = true
                });

                //User Counts
                model.ActiveClientCount             = _userAppService.GetUserCount(UserTypeConst.Client, true);
                model.UnActiveClientCount           = _userAppService.GetUserCount(UserTypeConst.Client, false);
                model.ApprovedMeasurementCount      = _userTrackingAppService.GetUserTrackingCount(true);
                model.UnApprovedMeasurementCount    = _userTrackingAppService.GetUserTrackingCount(false);
                model.ApprovedPhotosTrackingCount   = _photoTrackingAppService.GetPhotoTrackingCount(true);
                model.UnApprovedPhotosTrackingCount = _photoTrackingAppService.GetPhotoTrackingCount(false);
            }
            return(View(model));
        }