protected void btnUpdate_Click(object sender, EventArgs e)
 {
     ////保存修改到数据库
     int quantity = 0;
     if (!Int32.TryParse(txtLedNo.Text, out quantity))
     {
         quantity = 0;
     }
     StockChannelDal stockChannelDal = new StockChannelDal();
     stockChannelDal.Save(txtChannelCode.Text, txtCigaretteCode.Text, txtCigaretteName.Text, quantity, ddlStatus.SelectedValue, ddlIsStockIn.SelectedValue);
     JScript.Instance.ShowMessage(UpdatePanel1, "保存数据成功。");
 }
    private void BindData()
    {
        pager.PageSize = PagingSize;

        StockChannelDal stockChannelDal = new StockChannelDal();
        string filter = null;
        if (ViewState["Filter"] != null)
            filter = ViewState["Filter"].ToString();
        pager.RecordCount = stockChannelDal.GetCount(filter);
        DataTable table = stockChannelDal.GetAll(pageIndex, PagingSize, filter);
        BindTable2GridView(gvMain, table);
    }