コード例 #1
0
        public JsonResult Items(GridItemsRequestModel input)
        {
            var usersGroups = _authorizationRepository.GetAllUsersGroups().Select(x =>
                                                                      {
                                                                          var name = x.Name;
                                                                          var fullName = name;
                                                                          string firstToken = string.Empty;
                                                                          var offset = name.IndexOf('/', 1);

                                                                          if (name.Count(c => c == '/') == 2)
                                                                          {
                                                                              firstToken = name.Substring(1, offset-1);
                                                                              name = name.Replace("/" + firstToken + "/", "");
                                                                          }
                                                                          else if (name.Count(c => c == '/') > 2)
                                                                          {
                                                                              firstToken = name.Substring(1, name.IndexOf('/', offset + 1));
                                                                              name = name.Replace("/" + firstToken, "");
                                                                              firstToken = firstToken.Replace("/", " ");
                                                                          }

                                                                          return new UserGroupDto
                                                                                      {
                                                                                          EntityId = x.EntityId,
                                                                                          Name = name,
                                                                                          FirstToken = firstToken,
                                                                                          FullGroupName = fullName
                                                                                      };
                                                                      });
            IQueryable<UserGroupDto> items = _dynamicExpressionQuery.PerformQueryWithItems(usersGroups, input.filters);
            var gridItemsViewModel = _grid.GetGridItemsViewModel(input.PageSortFilter, items);
            return Json(gridItemsViewModel, JsonRequestBehavior.AllowGet);
        }
 public JsonResult Items(GridItemsRequestModel input)
 {
     var items = input.filters.IsNotEmpty()
         ? _dynamicExpressionQuery.PerformQuery<LoginStatistics>(input.filters)
         : _dynamicExpressionQuery.PerformQuery<LoginStatistics>(input.filters, x=>x.CreatedDate.Value.Date==DateTime.Now.Date);
     var gridItemsViewModel = _grid.GetGridItemsViewModel(input.PageSortFilter, items);
     return Json(gridItemsViewModel, JsonRequestBehavior.AllowGet);
 }
        public JsonResult Items(GridItemsRequestModel input)
        {
            var usersGroup = _authorizationRepository.GetUsersGroupById(input.ParentId);
            var permissionDtos =
                _permissionsService.GetPermissionsFor(usersGroup).Select(x =>
                                                                      {
                                                                          var opName = x.Operation.Name;
                                                                          string firstToken = string.Empty;
                                                                          var offset = opName.IndexOf('/',1);
                                                                          
                                                                          if(opName.Count(c=>c=='/') == 2)
                                                                          {
                                                                              firstToken = opName.Substring(1, offset-1);
                                                                              opName = opName.Replace("/" + firstToken +"/", "");
                                                                          }
                                                                          else if (opName.Count(c => c == '/') > 2)
                                                                          {
                                                                              firstToken = opName.Substring(1,opName.IndexOf('/', offset + 1));
                                                                              opName = opName.Replace("/"+firstToken , "");
                                                                              firstToken = firstToken.Replace("/", " ");
                                                                          }

                                                                          return new PermissionDto
                                                                                      {
                                                                                          State = x.Allow ? "Allow" : "Deny",
                                                                                          Level = x.Level,
                                                                                          Operation = opName,
                                                                                          EntityId = x.EntityId,
                                                                                          FirstToken = firstToken,
                                                                                          UserGroup = usersGroup.Name,
                                                                                          UserGroupEntityId = usersGroup.EntityId
                                                                                      };
                                                                      });
            IQueryable<PermissionDto> items = _dynamicExpressionQuery.PerformQueryWithItems(permissionDtos, input.filters);
            var gridItemsViewModel = _grid.GetGridItemsViewModel(input.PageSortFilter, items);
            return Json(gridItemsViewModel, JsonRequestBehavior.AllowGet);
        }
 public JsonResult Items(GridItemsRequestModel input)
 {
     var items = _dynamicExpressionQuery.PerformQuery((Grid<EmailTemplate>)_grid, input.filters, x=>x.CompanyId==input.EntityId);
     var gridItemsViewModel = _grid.GetGridItemsViewModel(input.PageSortFilter, items);
     return Json(gridItemsViewModel, JsonRequestBehavior.AllowGet);
 }
コード例 #5
0
 public JsonResult Items(GridItemsRequestModel input)
 {
     var items = _dynamicExpressionQuery.PerformQuery<UserLoginInfo>(input.filters);
     var gridItemsViewModel = _grid.GetGridItemsViewModel(input.PageSortFilter, items);
     return Json(gridItemsViewModel, JsonRequestBehavior.AllowGet);
 }