AskNews.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_AskNews : System.Web.UI.Page
- {
- Model.Asks MR = new Model.Asks();
- BLL.Asks BR = new BLL.Asks();
- 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_AskNews");
- if (!IsPostBack)
- {
- if (Request.QueryString["type"] != null)
- {
- TiaoJian = "FL='" + Request.QueryString["type"].ToString() + "'";
- MyDataBind(1);
- }
- else
- {
- TiaoJian = "";
- MyDataBind(1);
- }
- }
- }
- public void GetList(List<Model.Asks> LRData)
- {
- ContentStr = "";
- foreach (Model.Asks 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='AskView.aspx?id=" + LR.ID.ToString() + "'>" + LR.DCNR + @"</a></td>
- <td align=""middle"" nowrap=""nowrap"" style=""width: 61px"">
- <a href='AskResoultView.aspx?id=" + LR.ID.ToString() + @"'>查看结果</a></td>
- <td align=""middle"" nowrap=""nowrap"" style=""width: 61px"">
- " + LR.DCR + @"</td>
- <td align=""middle"" nowrap=""nowrap"" align=""center"" style=""width: 101px"">
- " + LR.DCSJ.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.Asks> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
- if (LRData.Count == 0)
- {
- Model.Asks MR = new Model.Asks();
- LRData.Add(MR);
- }
- GetList(LRData);
- }
- }