- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections.Generic;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class BBS_BBSNews : System.Web.UI.Page
- {
- Model.BBS MR = new Model.BBS();
- BLL.BBS BR = new BLL.BBS();
- public string ContentStr = "";
- /// <summary>
- /// 查询条件
- /// </summary>
- public string TiaoJian
- {
- get
- {
- if (ViewState["BBS_BBSNewsTiaoJian"] == null)
- {
- return "";
- }
- else
- {
- return ViewState["BBS_BBSNewsTiaoJian"].ToString();
- }
- }
- set { ViewState["BBS_BBSNewsTiaoJian"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "BBS_BBSNews");
- if (!IsPostBack)
- {
- if (Request.QueryString["type"] != null)
- {
- TiaoJian = "FL='" + Request.QueryString["type"].ToString() + "'";
- MyDataBind(1);
- }
- else
- {
- TiaoJian = "";
- MyDataBind(1);
- }
- }
- }
- public void GetList(List<Model.BBS> LRData)
- {
- ContentStr = "";
- foreach (Model.BBS LR in LRData)
- {
- ContentStr += @"
- <tr class=""usertablerow2"">
- <td nowrap=""nowrap"">
- </td>
- <td nowrap=""nowrap"" align=""center"">
- <img src=""../BBS/Images/re.gif"" /></td>
- <td align=""middle"" style=""width: 343px"">
- <a href='BBSView.aspx?id="+LR.ID+@"'>" + LR.ZT+ @"</a></td>
- <td align=""middle"" nowrap=""nowrap"" style=""width: 61px"">
- " + LR.ZTZZ + @"</td>
- <td align=""center"" nowrap=""nowrap"">
- " + LR.DJ.ToString() + @"</td>
- <td align=""center"" nowrap=""nowrap"">
- " + LR.HF.ToString() + @"</td>
- <td align=""middle"" nowrap=""nowrap"">
- " + LR.ZHHF.ToString("yyyy-MM-dd HH:mm:ss") + @"
- </td>
- </tr>
- ";
- }
- }
- protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
- {
- MyDataBind(e.NewPageIndex);
- }
- /// <summary>
- /// 获取信息
- /// </summary>
- /// <param name="pidx">页号</param>
- public void MyDataBind(int pidx)
- {
- AspNetPager1.RecordCount = BR.GetCount(TiaoJian);
- List<Model.BBS> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
- if (LRData.Count == 0)
- {
- Model.BBS MR = new Model.BBS();
- LRData.Add(MR);
- }
- GetList(LRData);
- }
- }