Ejemplo n.º 1
0
        public async Task <ActionResult> ListUsers(UserParameters parameters)
        {
            ValidateUserParameters(parameters, UserParametersValidator.NoValidation);

            var js     = new JavaScriptSerializer();
            var filter = new UserFilter()
            {
                CDSId             = parameters.CDSId,
                FilterMessage     = parameters.FilterMessage,
                HideInactiveUsers = parameters.HideInactiveUsers
            };

            filter.InitialiseFromJson(parameters);

            var results = await UserViewModel.GetModel(DataContext, filter);

            var jQueryResult = new JQueryDataTableResultModel(results);

            foreach (var result in results.Users.CurrentPage)
            {
                jQueryResult.aaData.Add(result.ToJQueryDataTableResult());
            }

            return(Json(jQueryResult));
        }