ADNews.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:3k
- 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 InFos_ADNews : System.Web.UI.Page
- {
- Model.INFOADNews MR = new Model.INFOADNews();
- BLL.INFOADNews BR = new BLL.INFOADNews();
- public string ContentStr = "";
- /// <summary>
- /// 查询条件
- /// </summary>
- public string TiaoJian
- {
- get
- {
- if (ViewState["InFos_ADNewsTiaoJian"] == null)
- {
- return "";
- }
- else
- {
- return ViewState["InFos_ADNewsTiaoJian"].ToString();
- }
- }
- set { ViewState["InFos_ADNewsTiaoJian"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "InFos_ADNews");
- if (!IsPostBack)
- {
- if (Request.QueryString["type"] != null)
- {
- TiaoJian = "FL='" + Request.QueryString["type"].ToString() + "'";
- MyDataBind(1);
- }
- else
- {
- TiaoJian = "";
- MyDataBind(1);
- }
- }
- }
- public void GetList(List<Model.INFOADNews> LRData)
- {
- ContentStr = "";
- foreach (Model.INFOADNews LR in LRData)
- {
- ContentStr += @"<tr class=""usertablerow2"">
-
- <td nowrap=""nowrap"" align=""center"">
- <img src=""../BBS/Images/re.gif"" /></td>
- <td align=""middle"">
- <a href='AdInfoView.aspx?id=" + LR.ID.ToString() + "'>" + LR.ZT + @"</a></td>
- <td align=""middle"" nowrap=""nowrap"">
- " + LR.ZZ + @"</td>
-
- <td align=""middle"" nowrap=""nowrap"" align=""center"" >
- " + LR.SJ.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.INFOADNews> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
- if (LRData.Count == 0)
- {
- Model.INFOADNews MR = new Model.INFOADNews();
- LRData.Add(MR);
- }
- GetList(LRData);
- }
- }