protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        /*取得查询参数信息*/
        string goodNo      = this.GoodNo.Text;
        string goodName    = this.GoodName.Text;
        int    goodClassId = Int32.Parse(this.GoodClassId.SelectedValue);
        string startTime   = this.StartTime.Text;
        string endTime     = this.EndTime.Text;
        /*调用业务层执行商品进货退货信息的查询并重新绑定到GridView控件*/
        DataSet buyBackInfoDs = BuyBackInfoLogic.QueryBuyBackInfo(goodNo, goodName, goodClassId, startTime, endTime);

        this.GridView1.DataSourceID = null;
        this.GridView1.DataSource   = buyBackInfoDs;
        this.GridView1.PageIndex    = e.NewPageIndex;
        this.GridView1.DataBind();
    }
    protected void Btn_Query_Click(object sender, EventArgs e)
    {
        /*取得查询参数信息*/
        string goodNo      = this.GoodNo.Text;
        string goodName    = this.GoodName.Text;
        int    goodClassId = Int32.Parse(this.GoodClassId.SelectedValue);
        string startTime   = this.StartTime.Text;
        string endTime     = this.EndTime.Text;
        /*调用业务层执行商品进货退货信息的查询并重新绑定到GridView控件*/
        DataSet buyBackInfoDs = BuyBackInfoLogic.QueryBuyBackInfo(goodNo, goodName, goodClassId, startTime, endTime);

        this.GridView1.DataSourceID = null;
        this.GridView1.DataSource   = buyBackInfoDs;
        this.GridView1.PageIndex    = 0;
        this.GridView1.DataBind();
        this.TotalPrice.Text = BuyBackInfoLogic.QueryBuyBackTotalMoney(goodNo, goodName, goodClassId, startTime, endTime).ToString();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         /*判断管理员是否已经登陆了系统*/
         if (Session["adminFlag"] == null)
         {
             Response.Write("<script>top.location.href='../login.aspx';</script>");
             return;
         }
         /*查询所有商品类别,初始化商品类别信息下拉框控件*/
         DataSet goodClassDs = GoodClassLogic.QueryAllGoodClassInfo();
         this.GoodClassId.Items.Add(new ListItem("请选择商品类别", "0"));
         for (int i = 0; i < goodClassDs.Tables[0].Rows.Count; i++)
         {
             DataRow dr = goodClassDs.Tables[0].Rows[i];
             this.GoodClassId.Items.Add(new ListItem(dr["goodClassName"].ToString(), dr["goodClassId"].ToString()));
         }
         this.GridView1.DataSourceID = null;
         this.GridView1.DataSource   = BuyBackInfoLogic.QueryBuyBackInfo("", "", 0, "", "");
         this.GridView1.DataBind();
         this.TotalPrice.Text = BuyBackInfoLogic.QueryBuyBackTotalMoney("", "", 0, "", "").ToString();;
     }
 }