Exemplo n.º 1
0
        public int SaveGroup(Group group)
        {
            int result = 0;
            if (group.GroupID > 0)
            {
                result = Group.Update(group);
            }
            else
            {
                result = Group.SaveGroup(group);

                BoardForum forum = new BoardForum();
                forum.CategoryID = 4; //group forums container
                forum.CreateDate = DateTime.Now;
                forum.LastPostByAccountID = _webContext.CurrentUser.AccountID;
                forum.LastPostByUsername = _webContext.CurrentUser.Username;
                forum.LastPostDate = DateTime.Now;
                forum.Name = group.Name;
                forum.PageName = group.PageName;
                forum.PostCount = 0;
                forum.Subject = group.Name;
                forum.ThreadCount = 0;
                forum.UpdateDate = DateTime.Now;
                int ForumID = BoardForum.SaveForum(forum);

                //create relationship between the group and forum
                GroupForum gf = new GroupForum();
                gf.ForumID = ForumID;
                gf.GroupID = group.GroupID;
                gf.CreateDate = DateTime.Now;
                GroupForum.SaveGroupForum(gf);
            }

            return result;
        }
Exemplo n.º 2
0
 public static Int32 SaveForum(BoardForum boardForum)
 {
         if (boardForum.ForumID > 0)
         {
             BoardForum.Update(boardForum);
         }
         else
         {
             Add(boardForum);
         }
     return boardForum.ForumID;
 }
Exemplo n.º 3
0
 public static void DeleteForum(BoardForum boardForum)
 {
     Delete(boardForum.ForumID);
 }