//查询库存信息列表 protected void stock_query() { DataSet _ds = new DataSet(); int _pageAmount; _ds = _stockLogic.StockQuery(3, Session["userid"].ToString(), 1, 200, out _pageAmount); if (_ds.Tables.Count > 0) { if (_ds.Tables[0].Rows.Count > 0) { rpt_stock_info.DataSource = _ds; rpt_stock_info.DataBind(); } else { tr_querynull.Visible = true; } } else { tr_querynull.Visible = true; } }
//库存信息查询 protected void stock_query(int _queryMode, String _queryId, int _pageIndex) { int _pageAmount; DataSet _ds = new DataSet(); String _querytypeStr; switch (_queryMode) { case 0: _querytypeStr = "所有"; break; case 3: _querytypeStr = "用户" + tb_user_query.Text + "的"; break; case 1: _querytypeStr = "游戏" + ddl_game_query.SelectedItem.Text + "的"; break; case 2: _querytypeStr = "服务器" + ddl_server_query.SelectedItem.Text + "的"; break; default: _querytypeStr = "所有"; break; } lb_querytype.Text = _querytypeStr + "库存信息列表"; _ds = _stockLogic.StockQuery(_queryMode, _queryId, _pageIndex, 20, out _pageAmount); pn_stock_list.Visible = true; query_null2.Visible = false; rpt_stock.Visible = true; pagination_pageindex2.Visible = true; pagination_pageamount2.Visible = true; pagination_pageindex2.InnerHtml = "第" + _pageIndex + "页"; pagination_pageamount2.InnerHtml = "共" + _pageAmount + "页"; if (_pageAmount > 1) { pagination_frame2.Visible = true; if (_pageIndex == 1) { pagination_prev2.InnerHtml = ""; pagination_next2.InnerHtml = "<a href=\"stockcfg.aspx?type=2&qm=" + _queryMode + "&id=" + _queryId + "&page=" + (_pageIndex + 1).ToString() + "\">下一页</a>"; } if (_pageIndex == _pageAmount) { pagination_prev2.InnerHtml = "<a href=\"stockcfg.aspx?type=2&qm=" + _queryMode + "&id=" + _queryId + "&page=" + (_pageIndex - 1).ToString() + "\">上一页</a>"; pagination_next2.InnerHtml = ""; } if (_pageIndex > 1 && _pageIndex < _pageAmount) { pagination_prev2.InnerHtml = "<a href=\"stockcfg.aspx?type=2&qm=" + _queryMode + "&id=" + _queryId + "&page=" + (_pageIndex - 1).ToString() + "\">上一页</a>"; pagination_next2.InnerHtml = "<a href=\"stockcfg.aspx?type=2&qm=" + _queryMode + "&id=" + _queryId + "&page=" + (_pageIndex + 1).ToString() + "\">下一页</a>"; } } else { pagination_frame2.Visible = false; } if (_ds.Tables.Count > 0) { if (_ds.Tables[0].Rows.Count > 0) { rpt_stock.DataSource = _ds; rpt_stock.DataBind(); } else { rpt_stock.Visible = false; pagination_pageindex2.Visible = false; pagination_pageamount2.Visible = false; query_null2.Visible = true; pagination_frame2.Visible = false; } } else { rpt_stock.Visible = false; pagination_pageindex2.Visible = false; pagination_pageamount2.Visible = false; query_null2.Visible = true; pagination_frame2.Visible = false; } }