Beispiel #1
0
        /// <summary>
        /// Prepare paged user attribute list model
        /// </summary>
        /// <param name="searchModel">User attribute search model</param>
        /// <returns>User attribute list model</returns>
        public virtual UserAttributeListModel PrepareUserAttributeListModel(UserAttributeSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            //get user attributes
            var userAttributes = _userAttributeService.GetAllUserAttributes();

            //prepare list model
            var model = new UserAttributeListModel
            {
                Data = userAttributes.PaginationByRequestModel(searchModel).Select(attribute =>
                {
                    //fill in model values from the entity
                    var attributeModel = attribute.ToModel <UserAttributeModel>();

                    return(attributeModel);
                }),
                Total = userAttributes.Count
            };

            return(model);
        }
 public UserUserSettingsModel()
 {
     UserSettings     = new UserSettingsModel();
     AddressSettings  = new AddressSettingsModel();
     DateTimeSettings = new DateTimeSettingsModel();
     ExternalAuthenticationSettings = new ExternalAuthenticationSettingsModel();
     UserAttributeSearchModel       = new UserAttributeSearchModel();
     AddressAttributeSearchModel    = new AddressAttributeSearchModel();
 }
Beispiel #3
0
        /// <summary>
        /// Prepare user attribute search model
        /// </summary>
        /// <param name="searchModel">User attribute search model</param>
        /// <returns>User attribute search model</returns>
        public virtual UserAttributeSearchModel PrepareUserAttributeSearchModel(UserAttributeSearchModel searchModel)
        {
            if (searchModel == null)
            {
                throw new ArgumentNullException(nameof(searchModel));
            }

            //prepare page parameters
            searchModel.SetGridPageSize();

            return(searchModel);
        }
        public virtual IActionResult List(UserAttributeSearchModel searchModel)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageSettings))
            {
                return(AccessDeniedKendoGridJson());
            }

            //prepare model
            var model = _userAttributeModelFactory.PrepareUserAttributeListModel(searchModel);

            return(Json(model));
        }