SelectGoodsFormData.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:2k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- 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 SelectForm_SelectGoodsFormData : System.Web.UI.Page
- {
- string TiaoJian = "";
- BLL.UseThings BU = new BLL.UseThings();
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- TiaoJian = "";
- MyDataBind(1);
- if (Request.QueryString["id"] != null)
- {
- SelectedNodeChanged(Request.QueryString["id"].ToString());
- }
- }
- }
- /// <summary>
- /// 获取信息
- /// </summary>
- public void MyDataBind(int pidx)
- {
- AspNetPager1.RecordCount = BU.GetCount(TiaoJian);
- GridView1.DataSource = BU.GetPageList(10, pidx, "ID", false, TiaoJian);
- GridView1.DataBind();
- }
- protected void SelectedNodeChanged(string GoodsId)
- {
- TiaoJian = "Id = " + GoodsId;
- MyDataBind(1);
- }
- protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
- {
- MyDataBind(e.NewPageIndex);
- }
- 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='#F0F0FF';");
- //当鼠标移开时还原背景色
- e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
- //}
- }
- }
- }