protected void NetPagerParameter_PageChanging(object src, PageChangingEventArgs e) { this.NetPagerParameter.CurrentPageIndex = e.NewPageIndex; string intGoodsClass = this.tvGoodsClass.SelectedValue; string strSql = this.QueryCondition(); if (intGoodsClass != "0" && intGoodsClass != "") { strSql += string.Format(" and GoodsClassID in ({0}) ", PubFunction.GetClassID(Convert.ToInt32(intGoodsClass))); } this.Get_ParameterList(strSql); }
protected void drpPageSize_SelectedIndexChanged(object sender, EventArgs e) { this.NetPagerParameter.CurrentPageIndex = 1; this.NetPagerParameter.PageSize = int.Parse(this.drpPageSize.SelectedValue); string intGoodsClass = this.tvGoodsClass.SelectedValue; string strSql = this.QueryCondition(); if (intGoodsClass != "0" && intGoodsClass != "") { strSql += string.Format(" and GoodsClassID in ({0}) ", PubFunction.GetClassID(Convert.ToInt32(intGoodsClass))); } this.Get_ParameterList(strSql); }
protected string QueryCondition() { string goodcode = this.txtQuery.Value.Trim(); StringBuilder strSql = new StringBuilder(); strSql.Append("1=1"); if (goodcode != "") { strSql.AppendFormat(" and (GoodsCode = '{0}' or Name = '{1}' or NameCode = '{2}')", goodcode, goodcode, goodcode); } if (this.GoodsClassID != "" && this.GoodsClassID != "0") { strSql.AppendFormat(" and GoodsClassID in ({0}) ", PubFunction.GetClassID(Convert.ToInt32(this.GoodsClassID))); } return(strSql.ToString()); }
protected string QueryCondition() { string spbm = this.txtQuery.Value.Trim(); string shopid = this.sltShop.Value; string intGoodsClass = this.sltGoodsClass.Value; StringBuilder strSql = new StringBuilder(); strSql.Append("1=1 and GoodsType=0 "); if (spbm != "") { strSql.AppendFormat(" and (GoodsCode = '{0}' or Name = '{1}' or NameCode = '{2}')", spbm, spbm, spbm); } if (shopid != "") { strSql.AppendFormat(" and ShopID = '{0}'", shopid); } if (intGoodsClass != "") { strSql.AppendFormat(" and GoodsClassID in ({0}) ", PubFunction.GetClassID(Convert.ToInt32(intGoodsClass))); } return(strSql.ToString()); }