Beispiel #1
0
        public virtual ActionResult List(DataSourceRequest command, PermissionListModel model, string sort, string sortDir)
        {
            var items = _permService.GetAllPermissions(
                permdesc: model.SearchPermission,
                pageIndex: command.Page - 1,
                pageSize: command.PageSize,
                sortExpression: "");

            var gridModel = new DataSourceResult
            {
                Data = items.Select(x => new PermissionListModel
                {
                    Id = (int)x.PERMISSION_ID,
                    PERMISSIONDESCRIPTION = x.PERMISSIONDESCRIPTION,
                    PARENT_PERMISSION     = x.PARENT_PERMISSION,
                    ACTION_NAME           = x.ACTION_NAME,
                    CONTROLLER_NAME       = x.CONTROLLER_NAME,
                    FORM_URL     = x.FORM_URL,
                    ISACTIVE     = x.ISACTIVE,
                    ICON_CLASS   = x.ICON_CLASS,
                    ISOPEN_CLASS = x.ISOPEN_CLASS,
                    IMAGE_URL    = x.IMAGE_URL,
                    TOGGLE_ICON  = x.TOGGLE_ICON
                }),
                Total = items.TotalCount
            };

            return(Json(gridModel));
        }
Beispiel #2
0
 public async Task <IEnumerable <string> > GetPermissions()
 {
     return(_permissionsService.GetAllPermissions());
 }