Example #1
0
    private void LoadData()
    {
        int forumId = RequestUtils.GetForumId(this);

        hlAdd.NavigateUrl += "?fr=" + forumId;
        gridHelper.ClearDataTable();
        string query = "select ForumTopics.*, Symbol from ForumTopics left join Statuses on Statuses.Id=Status where ForumId=" + forumId;

        using (GmConnection conn = Global.CreateConnection())
        {
            conn.Fill(gridHelper.DataTable, query);
        }
        gridHelper.DataTable.DefaultView.Sort = "Id desc";
    }
    void LoadData()
    {
        int id = RequestUtils.GetForumTopicId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                forumTopic = ForumTopic.GetForumTopic(conn, id);
            }
        }
        if (forumTopic == null)
        {
            forumTopic = new ForumTopic();
            int fr = RequestUtils.GetForumId(this);
            if (fr != 0)
            {
                forumTopic.forumId = fr;
            }
        }
    }
Example #3
0
    void LoadData()
    {
        int id = RequestUtils.GetForumId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                forum = Forum.GetForum(conn, id);
            }
        }
        if (forum == null)
        {
            forum = new Forum();
            int cm = RequestUtils.GetCommunityId(this);
            if (cm != 0)
            {
                forum.communityId = cm;
            }
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        log = MainMasterPage.InitPage(this);
        int forumId = RequestUtils.GetForumId(this);

        this.SqlDataSource1.SelectParameters["ForumId"].DefaultValue = forumId.ToString();
        try
        {
            Forum forum = null;
            using (GmConnection conn = Global.CreateConnection())
            {
                forum = Forum.GetForum(conn, forumId);
            }
            if (forum != null)
            {
                forumName = forum.name;
            }
        }
        catch (Exception ex)
        {
            log.Exception(ex);
        }
    }