Ejemplo n.º 1
0
        public IActionResult Index()
        {
            GroupIndexModel model = new GroupIndexModel();
            var             grps  = _chatService.GetAllGroups().Where(g => g.Privacy == PrivacyType.Public).ToList();

            model.Groups = grps.ToList();
            return(View(model));
        }
Ejemplo n.º 2
0
        public virtual ActionResult Index()
        {
            var model = new GroupIndexModel
            {
                Groups = AdminInitialise.EntitiesTypes
                         .GroupBy(x => x.Verbose.Group)
                         .Select(x => new GroupModel
                {
                    Name     = x.Key,
                    Entities = x.ToList()
                }).ToList()
            };

            return(View(model));
        }
Ejemplo n.º 3
0
        public virtual ActionResult Index()
        {
            var model = new GroupIndexModel
            {
                Groups = _admin.Entities
                         .Except(new[] { _admin.ChangeEntity })
                         .GroupBy(x => x.Verbose.Group)
                         .Select(x => new GroupModel
                {
                    Name     = x.Key,
                    Entities = x.ToList()
                }).ToList(),
                ChangeEnabled = _admin.ChangeEntity != null,
                Changes       = _recordsService.GetLastChanges(10)
            };

            return(View(model));
        }
Ejemplo n.º 4
0
        public IActionResult Index()
        {
            var userId           = _userManager.GetUserId(User);
            var groupsNormalUser = _groupService.GetGroupsSimpleUser(userId).Select(f => new GroupListingModel
            {
                Id          = f.Id,
                Name        = f.Name,
                Description = f.Description,
                ImageUrl    = f.ImageUrl,
            });

            var groupsAdmin = _groupService.GetGroupsAdminUser(userId).Select(f => new GroupListingModel
            {
                Id          = f.Id,
                Name        = f.Name,
                Description = f.Description,
                ImageUrl    = f.ImageUrl,
            });

            var groupsOther = _groupService.GetGroupsNotAdminNotUser(userId).Select(f => new GroupListingModel
            {
                Id          = f.Id,
                Name        = f.Name,
                Description = f.Description,
                ImageUrl    = f.ImageUrl,
            });

            var groupListingModelsNormalUser = groupsNormalUser as IList <GroupListingModel> ?? groupsNormalUser.ToList();
            var groupListingModelsAdmin      = groupsAdmin as IList <GroupListingModel> ?? groupsAdmin.ToList();
            var groupListingModelsOther      = groupsOther as IList <GroupListingModel> ?? groupsOther.ToList();

            var model = new GroupIndexModel
            {
                GroupUser   = groupListingModelsNormalUser.OrderBy(group => group.Name),
                GroupsAdmin = groupListingModelsAdmin.OrderBy(group => group.Name),
                GroupsOther = groupListingModelsOther.OrderBy(group => group.Name),
                UserId      = userId
            };

            return(View(model));
        }