Ejemplo n.º 1
0
    private void UpdateGrid()
    {
        gridHelper.ClearDataTable();
        int    communityId = RequestUtils.GetCommunityId(this);
        string query       = "select Polls.*, Symbol from Polls left join Statuses on Statuses.Id=Status";

        using (GmConnection conn = Global.CreateConnection())
        {
            conn.Fill(gridHelper.DataTable, query);
        }
        gridHelper.DataTable.DefaultView.Sort = "Id";
    }
Ejemplo n.º 2
0
    public PageInfo(Page page)
    {
        this.page = page;
        log       = new Log(page);
        try
        {
            AppCache appCache      = Global.AppCache;
            WebPage  defaultPage   = appCache.DefaultPage;
            WebPage  communityPage = null;
            int      cm            = RequestUtils.GetCommunityId(page);
            if (cm > 0)
            {
                communityPage = appCache.GetWebPage(cm);
            }
            string pageName = WebUtils.GetPageNameWithoutExtension(page);
            if (pageName.Length == 0)
            {
                pageName = Constants.defaultPageName;
            }
            WebPage webPage = appCache.GetWebPage(pageName);

/*			title=GetString(GetTitle(webPage),GetTitle(communityPage),GetTitle(defaultPage)," - ");
 *                      description=GetString(GetDescription(webPage),GetDescription(communityPage),GetDescription(defaultPage)," ");
 *                      keywords=GetString(GetKeywords(webPage),GetKeywords(communityPage),GetKeywords(defaultPage),", ");*/
            AddInfo(defaultPage);
            AddInfo(webPage);
            AddInfo(communityPage);
            if (communityPage != null)
            {
                AddBanners(communityPage, appCache);
            }
            else
            {
                AddBanners(webPage, appCache);
            }
            AddBanners(defaultPage, appCache);
            page.PreRender += new EventHandler(page_PreRender);
        }
        catch (Exception ex)
        {
            log.Exception(ex);
        }
    }
Ejemplo n.º 3
0
    void LoadData()
    {
        int id = RequestUtils.GetGalleryId(this);

        if (id != 0)
        {
            using (GmConnection conn = Global.CreateConnection())
            {
                gallery = Gallery.GetGallery(conn, id);
            }
        }
        if (gallery == null)
        {
            gallery = new Gallery();
            int cm = RequestUtils.GetCommunityId(this);
            if (cm != 0)
            {
                gallery.communityId = cm;
            }
        }
    }
Ejemplo n.º 4
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;
            }
        }
    }