Exemple #1
0
        public void LoadData()
        {
            Group          group    = _groupRepository.GetGroupByID(_webContext.GroupID);
            List <Account> accounts = _groupService.GetAllMemberByGroupID(group.GroupID);

            _view.LoadData(group, accounts);

            if (_webContext.CurrentUser != null)
            {
                _view.ShowRequestMembership(true);
            }
            else
            {
                _view.ShowRequestMembership(false);
            }

            //is this public or private data?
            if (group.IsPublic)
            {
                _view.ShowPrivate(true);
                _view.ShowPublic(true);
            }
            else if (ViewerIsMember())
            {
                _view.ShowPrivate(true);
                _view.ShowPublic(true);
            }
            else
            {
                _view.ShowPrivate(false);
                _view.ShowPublic(true);
            }
            BoardForum       forum    = _boardForumRepository.GetForumByGroupID(group.GroupID);
            BoardCategory    category = _boardCategoryRepository.GetCategoryByPageName("Group Forum");
            List <BoardPost> threads  = _boardPostRepository.GetThreadsByForumID(forum.ForumID);

            //_view.LoadForum(forum,threads,category);
            _view.LoadDataPost(_boardPostRepository.GetPostByID(_webContext.PostID), _boardPostRepository.GetPostsByThreadID(_webContext.PostID), forum, group);
        }
Exemple #2
0
 public void LoadData(Group group, List<Account> accounts)
 {
     //((SiteMaster)Master).Title = group.Name;
     lblName.Text = group.Name;
     imgGroupLogo.ImageUrl = "/files/photos/" + _fileService.GetFullFilePathByFileID(group.FileID, File.Sizes.S);
     lblCreateDate.Text = group.CreateDate.ToShortDateString();
     lblUpdateDate.Text = group.UpdateDate.ToShortDateString();
     lblDescription.Text = group.Description;
     //lblBody.Text = group.Body;
     IBoardForumRepository _forumRepository;
     _forumRepository = new BoardForumRepository();
     BoardForum forum = _forumRepository.GetForumByGroupID(group.GroupID);
     linkNewThread.NavigateUrl = "/Groups/PostGroupforum.aspx?" + "IsThread=" + 1 + "&ForumID=" + forum.ForumID + "&GroupID=" + group.GroupID + "&PostID=0";
 }
Exemple #3
0
        public void DeleteGroup(int GroupID)
        {
            BoardForum forum = _boardForumRepository.GetForumByGroupID(GroupID);

            if (forum != null)
            {
                _boardPostRepository.DeletePostsByForumID(forum.ForumID);
                _groupForumRepository.DeleteGroupForum(forum.ForumID, GroupID);
                _boardForumRepository.DeleteForum(forum);
            }
            _groupMemberRepository.DeleteAllGroupMembersForGroup(GroupID);
            _groupRepository.DeleteGroup(GroupID);
            LoadData();
        }