- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- 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 Articles_CheckInTable : System.Web.UI.Page
- {
- /// <summary>
- /// 模板
- /// </summary>
- Model.UseThingsUse MU = new Model.UseThingsUse();
- /// <summary>
- /// 业务
- /// </summary>
- BLL.UseThingsUse BU = new BLL.UseThingsUse();
- /// <summary>
- /// 查询条件
- /// </summary>
- public string TiaoJian
- {
- get
- {
- if (ViewState["UseThingsUseTiaoJian"] == null)
- {
- return "";
- }
- else
- {
- return ViewState["UseThingsUseTiaoJian"].ToString();
- }
- }
- set { ViewState["UseThingsUseTiaoJian"] = value; }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("../", "Articles_CheckInTable");
- if (!IsPostBack)
- {
- TiaoJian = "";
- if (Request.QueryString["TiaoJian"] != null)
- {
- TiaoJian = Server.UrlDecode(Request.QueryString["TiaoJian"].ToString());
- }
- MyDataBind(1);
- }
- }
- /// <summary>
- /// 获取信息
- /// </summary>
- /// <param name="pidx">页号</param>
- public void MyDataBind(int pidx)
- {
- int pagesize = 20;
- int count = BU.GetCount(TiaoJian);
- if (count > 0)
- {
- pagesize = count;
- }
- List<Model.UseThingsUse> LRData = BU.GetPageList(pagesize, pidx, "ID", false, TiaoJian);
- if (LRData.Count == 0)
- {
- Model.UseThingsUse MU = new Model.UseThingsUse();
- LRData.Add(MU);
- }
- GridView1.DataSource = LRData;
- GridView1.DataBind();
- }
- /// <summary>
- /// 部门
- /// </summary>
- /// <returns></returns>
- public string YPLB()
- {
- int Id = 0;
- if (BU.GetCount(TiaoJian) > 0)
- {
- Id = EnumGet.GetDengJiIndex(Eval("DJBS").ToString());
- }
- return EnumGet.GetDengJiName(Id.ToString());
- }
- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- for (int i = 0; i < GridView1.Rows.Count; i++)
- {
- //首先判断是否是数据行
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- //当鼠标停留时更改背景色
- e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#F0F0F0'");
- //当鼠标移开时还原背景色
- e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
- }
- }
- }
- }