Beispiel #1
0
        public ActionResult DeregisterOdsInstance(int instanceId)
        {
            var odsInstance = _getOdsInstanceRegistrationsQuery.Execute(instanceId);

            return(PartialView("_DeregisterOdsInstanceModal", new DeregisterOdsInstanceModel
            {
                OdsInstanceId = odsInstance.Id,
                Name = odsInstance.Name,
                Description = odsInstance.Description
            }));
        }
        public ActionResult EditOdsInstanceRegistrationsForUser(string userId)
        {
            var existingUser = _getAdminAppUserByIdQuery.Execute(userId);

            var odsInstanceRegistrations = _getOdsInstanceRegistrationsQuery.Execute().Select(x => new OdsInstanceRegistrationSelection
            {
                Name = x.Name,
                OdsInstanceRegistrationId = x.Id,
                Selected = false
            }).ToList();
            var userOdsInstanceRegistrationIds = _getOdsInstanceRegistrationsByUserIdQuery.Execute(userId).Select(x => x.Id);

            odsInstanceRegistrations.Where(x => userOdsInstanceRegistrationIds.Contains(x.OdsInstanceRegistrationId)).ForEach(x => x.Selected = true);
            return(View("EditOdsInstanceRegistrationsForUser", new EditOdsInstanceRegistrationForUserModel
            {
                UserId = userId,
                Email = existingUser.Email,
                OdsInstanceRegistrations = odsInstanceRegistrations,
                GlobalSettingsTabEnumerations = GetGlobalSettingsTabsWithUsersSelected()
            }));
        }
 private bool ZeroOdsInstanceRegistrations()
 {
     return(CloudOdsAdminAppSettings.Instance.Mode.SupportsMultipleInstances &&
            !_getOdsInstanceRegistrationsQuery.Execute().Any());
 }