public void BindData()
        {
            #region 数据绑定

            DataGrid1.AllowCustomPaging = true;
            DataGrid1.VirtualItemCount  = GetRecordCount();

            if (ViewState["condition"] == null)
            {
                DataGrid1.DataSource = AdminModeratorLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1);
            }
            else
            {
                DataGrid1.DataSource = AdminModeratorLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1, ViewState["condition"].ToString());
            }
            DataGrid1.DataBind();

            #endregion
        }
Esempio n. 2
0
        public void BindData()
        {
            #region 数据绑定

            DataGrid1.AllowCustomPaging = true;
            DataGrid1.VirtualItemCount  = GetRecordCount();

            DataTable LogList = ViewState["condition"] == null?
                                AdminModeratorLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1) :
                                    AdminModeratorLogs.LogList(DataGrid1.PageSize, DataGrid1.CurrentPageIndex + 1, ViewState["condition"].ToString());


            foreach (DataRow dr in LogList.Rows)
            {
                dr["reason"] = dr["reason"].ToString().Trim();
                dr["title"]  = dr["title"].ToString().Trim() != "" ?
                               string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", BaseConfigs.GetForumPath + Urls.ShowTopicAspxRewrite(TypeConverter.ObjectToInt(dr["tid"]), 1), dr["title"]) :
                               "没有标题";
            }
            DataGrid1.DataSource = LogList;
            DataGrid1.DataBind();

            #endregion
        }