CheckInTable.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;
  5. using System.Collections.Generic;
  6. using System.Web;
  7. using System.Web.Security;
  8. using System.Web.UI;
  9. using System.Web.UI.WebControls;
  10. using System.Web.UI.WebControls.WebParts;
  11. using System.Web.UI.HtmlControls;
  12. public partial class Articles_CheckInTable : System.Web.UI.Page
  13. {
  14.     /// <summary>
  15.     /// 模板 
  16.     /// </summary>
  17.     Model.UseThingsUse MU = new Model.UseThingsUse();
  18.     /// <summary>
  19.     /// 业务
  20.     /// </summary>
  21.     BLL.UseThingsUse BU = new BLL.UseThingsUse();
  22.     /// <summary>
  23.     /// 查询条件
  24.     /// </summary>
  25.     public string TiaoJian
  26.     {
  27.         get
  28.         {
  29.             if (ViewState["UseThingsUseTiaoJian"] == null)
  30.             {
  31.                 return "";
  32.             }
  33.             else
  34.             {
  35.                 return ViewState["UseThingsUseTiaoJian"].ToString();
  36.             }
  37.         }
  38.         set { ViewState["UseThingsUseTiaoJian"] = value; }
  39.     }
  40.     protected void Page_Load(object sender, EventArgs e)
  41.     {
  42.         LoginLogic.MatchLoad("../", "Articles_CheckInTable");
  43.         if (!IsPostBack)
  44.         {
  45.             TiaoJian = "";
  46.             if (Request.QueryString["TiaoJian"] != null)
  47.             {
  48.                 TiaoJian = Server.UrlDecode(Request.QueryString["TiaoJian"].ToString());
  49.             }
  50.             MyDataBind(1);
  51.         }
  52.     }
  53.     /// <summary>
  54.     /// 获取信息
  55.     /// </summary>
  56.     /// <param name="pidx">页号</param>
  57.     public void MyDataBind(int pidx)
  58.     {
  59.         int pagesize = 20;
  60.         int count = BU.GetCount(TiaoJian);
  61.         if (count > 0)
  62.         {
  63.             pagesize = count;
  64.         }
  65.         List<Model.UseThingsUse> LRData = BU.GetPageList(pagesize, pidx, "ID", false, TiaoJian);
  66.         if (LRData.Count == 0)
  67.         {
  68.             Model.UseThingsUse MU = new Model.UseThingsUse();
  69.             LRData.Add(MU);
  70.         }
  71.         GridView1.DataSource = LRData;
  72.         GridView1.DataBind();
  73.     }
  74.     /// <summary>
  75.     /// 部门
  76.     /// </summary>
  77.     /// <returns></returns>
  78.     public string YPLB()
  79.     {
  80.         int Id = 0;
  81.         if (BU.GetCount(TiaoJian) > 0)
  82.         {
  83.             Id = EnumGet.GetDengJiIndex(Eval("DJBS").ToString());
  84.         }
  85.         return EnumGet.GetDengJiName(Id.ToString());
  86.     }
  87.     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
  88.     {
  89.         for (int i = 0; i < GridView1.Rows.Count; i++)
  90.         {
  91.             //首先判断是否是数据行
  92.             if (e.Row.RowType == DataControlRowType.DataRow)
  93.             {
  94.                 //当鼠标停留时更改背景色
  95.                 e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F0F0F0'");
  96.                 //当鼠标移开时还原背景色
  97.                 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
  98.             }
  99.         }
  100.     }
  101. }