private void BindData()
    {
        long num = _Convert.StrToLong(Utility.GetRequest("id"), -1L);

        if (num < 0L)
        {
            PF.GoError(1, "您访问的数据不存在,可能是参数错误或内容已经被删除!", base.GetType().BaseType.FullName);
        }
        else
        {
            DataTable table;
            table = table = new Tables.T_SiteAffiches().Open("", "ID=" + num.ToString(), "");
            if (table == null)
            {
                PF.GoError(1, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
            }
            else if (table.Rows.Count < 0)
            {
                PF.GoError(1, "您访问的数据不存在,可能是参数错误或内容已经被删除!", base.GetType().BaseType.FullName);
            }
            else
            {
                DataRow row = table.Rows[0];
                this.lbTitle.Text    = row["Title"].ToString();
                this.lbDateTime.Text = _Convert.StrToDateTime(row["DateTime"].ToString(), DateTime.Now.ToString()).ToString("yyyy-MM-dd hh:mm:ss");
                this.lbContent.Text  = row["Content"].ToString();
            }
        }
    }
Beispiel #2
0
    private void BindData()
    {
        DataTable dt = new Tables.T_SiteAffiches().Open("", "SiteID = " + base._Site.ID.ToString(), "[DateTime] desc");

        if (dt == null)
        {
            PF.GoError(4, "数据库繁忙,请重试", "Admin_SiteAffiches");
        }
        else
        {
            PF.DataGridBindData(this.g, dt, this.gPager);
        }
    }
Beispiel #3
0
    private DataTable GetSiteAffiches()
    {
        string    key = "Default_GetSiteAffiches";
        DataTable cacheAsDataTable = Shove._Web.Cache.GetCacheAsDataTable(key);

        if (cacheAsDataTable == null)
        {
            cacheAsDataTable = new Tables.T_SiteAffiches().Open("top 10 Title,Content", "isShow = 1", " DateTime desc");
            if (cacheAsDataTable == null)
            {
                PF.GoError(4, "数据库繁忙,请重试", base.GetType().BaseType.FullName);
                return(null);
            }
            if (cacheAsDataTable.Rows.Count > 0)
            {
                Shove._Web.Cache.SetCache(key, cacheAsDataTable, 0xe10);
            }
        }
        return(cacheAsDataTable);
    }