ManagerNews.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_ManagerNews : System.Web.UI.Page
- {
- Model.INFONews MR = new Model.INFONews();
- BLL.INFONews BR = new BLL.INFONews();
- public string ContentStr = "";
- /// <summary>
- /// 查询条件
- /// </summary>
- public string TiaoJian
- {
- get
- {
- if (ViewState["InFos_NewsTiaoJian"] == null)
- {
- return "";
- }
- else
- {
- return ViewState["InFos_NewsTiaoJian"].ToString();
- }
- }
- set { ViewState["InFos_NewsTiaoJian"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "InFos_ManagerNews");
- if (!IsPostBack)
- {
- if (Request.QueryString["type"] != null)
- {
- TiaoJian = "FL='" + Request.QueryString["type"].ToString() + "'";
- MyDataBind(1);
- }
- else
- {
- TiaoJian = "";
- MyDataBind(1);
- }
- }
- }
- public void GetList(List<Model.INFONews> LRData)
- {
- ContentStr = "";
- foreach (Model.INFONews LR in LRData)
- {
- ContentStr += @"<tr class=""usertablerow2"">
-
- <td nowrap=""nowrap"" align=""center"" style=""width:31px"">
- <img src=""../BBS/Images/re.gif"" /></td>
- <td align=""middle"" style=""width: 343px"">
- <a href='InfoView.aspx?id=" + LR.ID.ToString()+ "'>" + LR.ZT + @"</a></td>
- <td align=""middle"" nowrap=""nowrap"" style=""width: 61px"">
- " + LR.ZZ + @"</td>
-
- <td align=""middle"" nowrap=""nowrap"" align=""center"" style=""width: 101px"">
- " + LR.SJ.ToString("yyyy-MM-dd HH:mm:ss") +@"
- </td>
- <td align=""middle"" nowrap=""nowrap"">
- <a href='InfoEdit.aspx?id=" + LR.ID + @"'>编辑</a> <a href='InfoDel.aspx?id=" + LR.ID + @"'>删除</a>
- </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.INFONews> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
- if (LRData.Count == 0)
- {
- Model.INFONews MR = new Model.INFONews();
- LRData.Add(MR);
- }
- GetList(LRData);
- }
- }