private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string subarea=this.DropDownList3.SelectedItem.Text.Trim();
string game=this.DropDownList4.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="";
using(WebShop.Common common=new WebShop.Common())
{
if(game!="选择游戏")
{
if(subarea!="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='出售' and wupinxinxi.subareaid='"+subareaid+"' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择分区')</script>");
}
}
else
{
if(subarea=="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='出售' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择游戏')</script>");
}
}
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
Session["xinxileixing"]="出售";
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
}
}
}
=========================================================================================
private void DropDownList4_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.DropDownList3.Items.Clear();
System.Web.UI.WebControls.ListItem h=new ListItem();
h.Text="请选择分区";
h.Value="0";
this.DropDownList3.Items.Add(h);
string gameid=this.DropDownList4.SelectedItem.Value;
string strSql="select * from subarea where gameid='"+gameid+"'";
WebShop.Common1 comm=new WebShop.Common1();
SqlDataReader dst;
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[1].ToString();
i.Text=dst[2].ToString();
this.DropDownList3.Items.Add(i);
}
dst.Close();
}
======================================================================
public void game()
{
string strSql="select *from game";
SqlDataReader dst;
WebShop.Common1 comm=new WebShop.Common1();
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[0].ToString();
i.Text=dst[1].ToString();
this.DropDownList4.Items.Add(i);
}
dst.Close();
}
===================================================
private void DropDownList3_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.RadioButtonList1.Visible=false;
string subareaid=this.DropDownList4.SelectedItem.Text.Trim();
WebShop.Common common=new WebShop.Common();
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.subareaid,wupinxinxi.xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and wupinxinxi.subareaid='"+this.DropDownList3.SelectedItem.Value+"' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
if(subareaid=="魔兽")
{
this.RadioButtonList1.Visible=true;
}
else
{
this.RadioButtonList1.Visible=false;
}
}
==============================================
public void game()
{
string strSql="select *from game";
SqlDataReader dst;
WebShop.Common1 comm=new WebShop.Common1();
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[0].ToString();
i.Text=dst[1].ToString();
this.DropDownList4.Items.Add(i);
}
dst.Close();
}
===============================================================
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace bargaining
{
/// <summary>
/// youxibiserver 的摘要说明。
/// </summary>
public class youxibiserver : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlGenericControl Span1;
protected System.Web.UI.WebControls.DropDownList DropDownList3;
protected System.Web.UI.WebControls.DropDownList DropDownList4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.ImageButton ImageButton2;
protected System.Web.UI.WebControls.RadioButtonList RadioButtonList1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataList youxibi;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.IsPostBack)
{
game();
if(this.Request.QueryString.Count==0)
{
using(WebShop.Common common=new WebShop.Common())
{
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shengyushuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid HAVING (dbo.wupinxinxi.propid = 1) and gamesubarea='欧服' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
}
}
else
{
string str=this.Request.QueryString["str"];
using(WebShop.Common common=new WebShop.Common())
{
string strSql="SELECT wupinxinxi.serverid,wupinxinxi.subareaid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and gamename like '魔兽' and gamesubarea='"+str+"'";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
}
}
}
}
public void game()
{
string strSql="select *from game";
SqlDataReader dst;
WebShop.Common1 comm=new WebShop.Common1();
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[0].ToString();
i.Text=dst[1].ToString();
this.DropDownList4.Items.Add(i);
}
dst.Close();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.DropDownList4.SelectedIndexChanged += new System.EventHandler(this.DropDownList4_SelectedIndexChanged);
this.DropDownList3.SelectedIndexChanged += new System.EventHandler(this.DropDownList3_SelectedIndexChanged);
this.ImageButton2.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton2_Click);
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.RadioButtonList1.SelectedIndexChanged += new System.EventHandler(this.RadioButtonList1_SelectedIndexChanged);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void DropDownList4_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.DropDownList3.Items.Clear();
System.Web.UI.WebControls.ListItem h=new ListItem();
h.Text="请选择分区";
h.Value="0";
this.DropDownList3.Items.Add(h);
string gameid=this.DropDownList4.SelectedItem.Value;
string strSql="select * from subarea where gameid='"+gameid+"'";
WebShop.Common1 comm=new WebShop.Common1();
SqlDataReader dst;
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[1].ToString();
i.Text=dst[2].ToString();
this.DropDownList3.Items.Add(i);
}
dst.Close();
}
private void DropDownList3_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.RadioButtonList1.Visible=false;
string subareaid=this.DropDownList4.SelectedItem.Text.Trim();
WebShop.Common common=new WebShop.Common();
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.subareaid,wupinxinxi.xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and wupinxinxi.subareaid='"+this.DropDownList3.SelectedItem.Value+"' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
if(subareaid=="魔兽")
{
this.RadioButtonList1.Visible=true;
}
else
{
this.RadioButtonList1.Visible=false;
}
}
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string subarea=this.DropDownList3.SelectedItem.Text.Trim();
string game=this.DropDownList4.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="";
using(WebShop.Common common=new WebShop.Common())
{
if(game!="选择游戏")
{
if(subarea!="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='出售' and wupinxinxi.subareaid='"+subareaid+"' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择分区')</script>");
}
}
else
{
if(subarea=="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='出售' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择游戏')</script>");
}
}
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
Session["xinxileixing"]="出售";
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
}
}
}
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string subarea=this.DropDownList3.SelectedItem.Text.Trim();
string game=this.DropDownList4.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="";
using(WebShop.Common common=new WebShop.Common())
{
if(game!="选择游戏")
{
if(subarea!="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='求购' and wupinxinxi.subareaid='"+subareaid+"' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择分区')</script>");
}
}
else
{
if(subarea=="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='求购' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择游戏')</script>");
}
}
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
Session["xinxileixing"]="求购";
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
}
}
}
private void RadioButtonList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
using(WebShop.Common common=new WebShop.Common())
{
string gameserver=this.RadioButtonList1.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shengyushuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.subareaid,wupinxinxi.xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and wupinxinxi.subareaid='"+subareaid+"' and server.gameserver like '"+gameserver+"%' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
Session["subareaid"]=this.DropDownList3.SelectedItem.Value;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
}
}
public void Button1_Click(object sender, System.EventArgs e)
{
LinkButton d=(LinkButton)sender;
string xinxileixing="";
string serverid=d.CommandArgument.ToString();
if(Session["xinxileixing"]!=null)
{
xinxileixing=Session["xinxileixing"].ToString();
Response.Redirect("youxibiList.aspx?serverid="+serverid+"&xinxileixing='"+xinxileixing+"'");
}
else
{
Response.Redirect("youxibiList.aspx?serverid="+serverid+"");
}
}
}
}
=====================================================
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Configuration;
namespace bargaining.houtai
{
/// <summary>
/// danbaoselect 的摘要说明。
/// </summary>
public class danbaoselect : System.Web.UI.Page
{
protected System.Web.UI.WebControls.HyperLink HyperLink2;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.DataList Repeater1;
protected System.Web.UI.WebControls.Button insert;
protected System.Web.UI.WebControls.Label Label2;
string strConn=ConfigurationSettings.AppSettings["sqlconn"];
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
string h="";
if(!Page.IsPostBack)
{
try
{
h=Session["admin"].ToString();
}
catch
{
h="";
}
if(h=="")
{
Response.Write( "<script language='javascript'>") ;
Response.Write("alert('请先登陆');");
Response.Write("document.location.href='denglu.aspx'");
Response.Write("</script>");
}
else
{
bind();
}
}
}
public void bind()
{
SqlConnection sqlconn=new SqlConnection(strConn);
string strSql="select dandingdanid,wupinname,shuliang,money,wantime,lirun from danbaodingdan ";
SqlDataAdapter strgh=new SqlDataAdapter(strSql,sqlconn);
sqlconn.Open();
DataSet ds=new DataSet();
strgh.Fill(ds);
if(ds.Tables[0].Rows.Count==0)
{
Label2.Visible=true;
this.Repeater1.Visible=false;
this.Label1.Visible=false;
this.HyperLink1.Visible=false;
this.HyperLink2.Visible=false;
}
PagedDataSource sqlpage=new PagedDataSource();
sqlpage.DataSource=ds.Tables[0].DefaultView;
sqlpage.AllowPaging=true;
sqlpage.PageSize=15;
int curpage;
if(Request.QueryString.Count>0)
{
curpage=Convert.ToInt32(Request.QueryString["Page"]);
}
else
curpage=1;
sqlpage.CurrentPageIndex=curpage-1;
this.Label1.Text="当前页:"+curpage.ToString();
if(!sqlpage.IsFirstPage)
{
this.HyperLink1.NavigateUrl=Request.CurrentExecutionFilePath+"?Page="+Convert.ToString(curpage-1);
}
if(!sqlpage.IsLastPage)
{
this.HyperLink2.NavigateUrl=Request.CurrentExecutionFilePath+ "?Page=" + Convert.ToString(curpage+1);
}
this.Repeater1.DataSource=sqlpage;
this.Repeater1.DataKeyField="dandingdanid";
this.Repeater1.DataBind();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.insert.Click += new System.EventHandler(this.insert_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public void insert_Click(object sender, System.EventArgs e)
{
string tmp="";
foreach(DataListItem item in this.Repeater1.Items)
{
TextBox txt = (TextBox)item.FindControl("text1");
tmp = txt.Text;
LinkButton d=(LinkButton)sender;
string id=d.CommandArgument.ToString();
string strSql1="update danbaodingdan set lirun="+tmp+" where dandingdanid='"+id+"'";
WebShop.Common1 comm=new WebShop.Common1();
comm.exec(strSql1,CommandType.Text,"bidingdan");
if(int.Parse(tmp.ToString())>0)
{
break;
}
}
bind();
}
}
}
================================================================================
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
namespace bargaining
{
/// <summary>
/// youxibiserver 的摘要说明。
/// </summary>
public class youxibiserver : System.Web.UI.Page
{
protected System.Web.UI.HtmlControls.HtmlGenericControl Span1;
protected System.Web.UI.WebControls.DropDownList DropDownList3;
protected System.Web.UI.WebControls.DropDownList DropDownList4;
protected System.Web.UI.WebControls.Label Label5;
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.ImageButton ImageButton2;
protected System.Web.UI.WebControls.RadioButtonList RadioButtonList1;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.DataList youxibi;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(!this.IsPostBack)
{
game();
if(this.Request.QueryString.Count==0)
{
using(WebShop.Common common=new WebShop.Common())
{
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shengyushuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid HAVING (dbo.wupinxinxi.propid = 1) and gamesubarea='欧服' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
}
}
else
{
string str=this.Request.QueryString["str"];
using(WebShop.Common common=new WebShop.Common())
{
string strSql="SELECT wupinxinxi.serverid,wupinxinxi.subareaid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and gamename like '魔兽' and gamesubarea='"+str+"'";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
}
}
}
}
public void game()
{
string strSql="select *from game";
SqlDataReader dst;
WebShop.Common1 comm=new WebShop.Common1();
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[0].ToString();
i.Text=dst[1].ToString();
this.DropDownList4.Items.Add(i);
}
dst.Close();
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.DropDownList4.SelectedIndexChanged += new System.EventHandler(this.DropDownList4_SelectedIndexChanged);
this.DropDownList3.SelectedIndexChanged += new System.EventHandler(this.DropDownList3_SelectedIndexChanged);
this.ImageButton2.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton2_Click);
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.RadioButtonList1.SelectedIndexChanged += new System.EventHandler(this.RadioButtonList1_SelectedIndexChanged);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void DropDownList4_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.DropDownList3.Items.Clear();
System.Web.UI.WebControls.ListItem h=new ListItem();
h.Text="请选择分区";
h.Value="0";
this.DropDownList3.Items.Add(h);
string gameid=this.DropDownList4.SelectedItem.Value;
string strSql="select * from subarea where gameid='"+gameid+"'";
WebShop.Common1 comm=new WebShop.Common1();
SqlDataReader dst;
dst=comm.full(strSql,CommandType.Text,"game");
while(dst.Read())
{
System.Web.UI.WebControls.ListItem i=new ListItem();
i.Value=dst[1].ToString();
i.Text=dst[2].ToString();
this.DropDownList3.Items.Add(i);
}
dst.Close();
}
private void DropDownList3_SelectedIndexChanged(object sender, System.EventArgs e)
{
this.RadioButtonList1.Visible=false;
string subareaid=this.DropDownList4.SelectedItem.Text.Trim();
WebShop.Common common=new WebShop.Common();
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.subareaid,wupinxinxi.xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and wupinxinxi.subareaid='"+this.DropDownList3.SelectedItem.Value+"' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
if(subareaid=="魔兽")
{
this.RadioButtonList1.Visible=true;
}
else
{
this.RadioButtonList1.Visible=false;
}
}
private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
private void ImageButton2_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string subarea=this.DropDownList3.SelectedItem.Text.Trim();
string game=this.DropDownList4.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="";
using(WebShop.Common common=new WebShop.Common())
{
if(game!="选择游戏")
{
if(subarea!="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='出售' and wupinxinxi.subareaid='"+subareaid+"' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择分区')</script>");
}
}
else
{
if(subarea=="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='出售' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择游戏')</script>");
}
}
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
Session["xinxileixing"]="出售";
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
}
}
}
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
string subarea=this.DropDownList3.SelectedItem.Text.Trim();
string game=this.DropDownList4.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="";
using(WebShop.Common common=new WebShop.Common())
{
if(game!="选择游戏")
{
if(subarea!="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing,wupinxinxi.subareaid HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='求购' and wupinxinxi.subareaid='"+subareaid+"' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择分区')</script>");
}
}
else
{
if(subarea=="选择分区")
{
strSql="SELECT wupinxinxi.serverid,dbo.game.gamename, wupinxinxi.xinxileixing,dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid ,xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and xinxileixing='求购' ";
}
else
{
this.Response.Write("<script language='javascript'>alert('请选择游戏')</script>");
}
}
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
Session["xinxileixing"]="求购";
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
}
}
}
private void RadioButtonList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
using(WebShop.Common common=new WebShop.Common())
{
string gameserver=this.RadioButtonList1.SelectedItem.Text.Trim();
string subareaid=this.DropDownList3.SelectedItem.Value;
string strSql="SELECT wupinxinxi.serverid,dbo.game.gamename,wupinxinxi.xinxileixing, dbo.subarea.gamesubarea, dbo.server.gameserver,prop.propname,prop.propid, SUM(dbo.wupinxinxi.shengyushuliang) AS shu FROM dbo.wupinxinxi INNER JOIN dbo.game ON dbo.wupinxinxi.gameid = dbo.game.gameid INNER JOIN dbo.server ON dbo.wupinxinxi.serverid = dbo.server.serverid INNER JOIN dbo.subarea ON dbo.wupinxinxi.subareaid = dbo.subarea.subareaid inner join prop on wupinxinxi.propid=prop.propid GROUP BY dbo.game.gamename, dbo.subarea.gamesubarea, dbo.server.gameserver,dbo.prop.propname,prop.propid,wupinxinxi.propid,wupinxinxi.serverid,wupinxinxi.subareaid,wupinxinxi.xinxileixing HAVING (dbo.wupinxinxi.propid = 1) and wupinxinxi.subareaid='"+subareaid+"' and server.gameserver like '"+gameserver+"%' ";
DataSet ds=common.full(strSql,CommandType.Text,"bixiangxi");
if(ds.Tables[0].Rows.Count>0)
{
this.Label5.Visible=false;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
else
{
this.Label5.Visible=true;
Session["subareaid"]=this.DropDownList3.SelectedItem.Value;
this.youxibi.DataSource=ds.Tables[0];
this.youxibi.DataBind();
}
}
}
public void Button1_Click(object sender, System.EventArgs e)
{
LinkButton d=(LinkButton)sender;
string xinxileixing="";
string serverid=d.CommandArgument.ToString();
if(Session["xinxileixing"]!=null)
{
xinxileixing=Session["xinxileixing"].ToString();
Response.Redirect("youxibiList.aspx?serverid="+serverid+"&xinxileixing='"+xinxileixing+"'");
}
else
{
Response.Redirect("youxibiList.aspx?serverid="+serverid+"");
}
}
}
}