public GroupForumSettings(GroupForum Forum)
        {
            this.ParentForum = Forum;

            DataRow Row;

            using (var adap = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                adap.SetQuery("SELECT * FROM group_forums_settings WHERE group_id = @id");
                adap.AddParameter("id", Forum.Id);
                Row = adap.getRow();
            }

            this.WhoCanRead            = Convert.ToInt32(Row["who_can_read"]);
            this.WhoCanPost            = Convert.ToInt32(Row["who_can_post"]);
            this.WhoCanInitDiscussions = Convert.ToInt32(Row["who_can_init_discussions"]);
            this.WhoCanModerate        = Convert.ToInt32(Row["who_can_mod"]);
        }
        public bool TryGetForum(int Id, out GroupForum Forum)
        {
            if ((Forum = Forums.FirstOrDefault(c => c.Id == Id)) != null)
            {
                return(true);
            }

            Group Gp;

            if (!BiosEmuThiago.GetGame().GetGroupManager().TryGetGroup(Id, out Gp))
            {
                return(false);
            }

            if (!Gp.ForumEnabled)
            {
                return(false);
            }

            Forum = new GroupForum(Gp);
            Forums.Add(Forum);
            return(true);
        }
        public GroupForum CreateGroupForum(Group Gp)
        {
            GroupForum GF;

            if (TryGetForum(Gp.Id, out GF))
            {
                return(GF);
            }

            using (var adap = BiosEmuThiago.GetDatabaseManager().GetQueryReactor())
            {
                adap.SetQuery("INSERT INTO group_forums_settings (group_id) VALUES (@gp)");
                adap.AddParameter("gp", Gp.Id);
                adap.RunQuery();

                adap.SetQuery("UPDATE groups SET forum_enabled = '1' WHERE id = @id");
                adap.AddParameter("id", Gp.Id);
                adap.RunQuery();
            }

            GF = new GroupForum(Gp);
            Forums.Add(GF);
            return(GF);
        }
        public GroupForum GetForum(int GroupId)
        {
            GroupForum f = null;

            return(TryGetForum(GroupId, out f) ? f : null);
        }