AskNews.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:3k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections.Generic;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. public partial class InFos_AskNews : System.Web.UI.Page
  12. {
  13.     Model.Asks MR = new Model.Asks();
  14.     BLL.Asks BR = new BLL.Asks();
  15.     public string ContentStr = "";
  16.     /// <summary>
  17.     /// 查询条件
  18.     /// </summary>
  19.     public string TiaoJian
  20.     {
  21.         get
  22.         {
  23.             if (ViewState["InFos_NewsTiaoJian"] == null)
  24.             {
  25.                 return "";
  26.             }
  27.             else
  28.             {
  29.                 return ViewState["InFos_NewsTiaoJian"].ToString();
  30.             }
  31.         }
  32.         set { ViewState["InFos_NewsTiaoJian"] = value; }
  33.     }
  34.     protected void Page_Load(object sender, EventArgs e)
  35.     {
  36.         LoginLogic.MatchLoad("../", "InFos_AskNews");
  37.         if (!IsPostBack)
  38.         {
  39.             if (Request.QueryString["type"] != null)
  40.             {
  41.                 TiaoJian = "FL='" + Request.QueryString["type"].ToString() + "'";
  42.                 MyDataBind(1);
  43.             }
  44.             else
  45.             {
  46.                 TiaoJian = "";
  47.                 MyDataBind(1);
  48.             }
  49.         }
  50.     }
  51.     public void GetList(List<Model.Asks> LRData)
  52.     {
  53.         ContentStr = "";
  54.         foreach (Model.Asks LR in LRData)
  55.         {
  56.             ContentStr += @"<tr class=""usertablerow2"">
  57.                      
  58.                             <td nowrap=""nowrap"" align=""center"" style=""width:31px"">
  59.                                 <img src=""../BBS/Images/re.gif"" /></td>
  60.                             <td align=""middle"" style=""width: 343px"">
  61.                             <a href='AskView.aspx?id=" + LR.ID.ToString() + "'>" + LR.DCNR + @"</a></td>
  62.                             <td align=""middle"" nowrap=""nowrap"" style=""width: 61px"">
  63.                            <a href='AskResoultView.aspx?id=" + LR.ID.ToString() + @"'>查看结果</a></td>
  64.                      <td align=""middle"" nowrap=""nowrap"" style=""width: 61px"">
  65.                              " + LR.DCR + @"</td>
  66.                             <td align=""middle"" nowrap=""nowrap"" align=""center"" style=""width: 101px"">
  67.                              " + LR.DCSJ.ToString("yyyy-MM-dd HH:mm:ss") +@"
  68.                             </td>
  69.                         </tr>";
  70.         }
  71.     }
  72.     protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
  73.     {
  74.         MyDataBind(e.NewPageIndex);
  75.     }
  76.     /// <summary>
  77.     /// 获取信息
  78.     /// </summary>
  79.     /// <param name="pidx">页号</param>
  80.     public void MyDataBind(int pidx)
  81.     {
  82.         AspNetPager1.RecordCount = BR.GetCount(TiaoJian);
  83.         List<Model.Asks> LRData = BR.GetPageList(20, pidx, "ID", false, TiaoJian);
  84.         if (LRData.Count == 0)
  85.         {
  86.             Model.Asks MR = new Model.Asks();
  87.             LRData.Add(MR);
  88.         }
  89.         GetList(LRData);
  90.     }
  91. }