⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myinfocenter.aspx.cs

📁 拍卖系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using myPaimai;
public partial class myInfoCenter : System.Web.UI.Page
{
    public dataOperate do1 = new dataOperate();
   public  string userID = "鸟";
    public string nickName = "";
    public string realName = "";
    public string sex = "";
    public string age = "";
    public string address = "";
    public string NO = "";
    public string email = "";
    public string credit = "";
    public string score = "";
    public string loginTime = "";
    public string registerTime = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["userID"] == null)
        {
            Response.Write("<script language='javascript'>alert('您还没登录呢!');</script>");
        }
        else
        {
            bindInfo();
        }
    }
    protected void bidShow_Click(object sender, EventArgs e)
    {
        string sql = "";
        Button btn = sender as Button;
        if (btn.CommandArgument == "win")
        {
            sql = "SELECT goods.nameOfGoods,myPrice,bidTime,bidState,goods.scale  FROM bidOfGoods,goods WHERE goods.goodsID=bidOfGoods.goodsID AND bidOfGoods.bidState='已竞得' AND userID='鸟'";
        }
        else if(btn.CommandArgument=="head")
        { 
          sql="SELECT goods.nameOfGoods,myPrice,bidTime,bidState,goods.scale  FROM bidOfGoods,goods WHERE goods.goodsID=bidOfGoods.goodsID AND bidOfGoods.bidState='领先' AND userID='鸟'";
        }
        else if (btn.CommandArgument == "out")
        {
            sql = "SELECT goods.nameOfGoods,myPrice,bidTime,bidState,goods.scale  FROM bidOfGoods,goods WHERE goods.goodsID=bidOfGoods.goodsID AND bidOfGoods.bidState='出局' AND userID='鸟'";
        }
        else
        {
           // sql = "SELECT DISTINCT goods.nameOfGoods,myPrice,bidTime,bidState,goods.scale  FROM bidOfGoods,goods WHERE goods.goodsID=bidOfGoods.goodsID  AND userID='鸟'";
 
        }
        try
        {
            SqlDataSource2.SelectCommand = sql;
            SqlDataSource2.DataBind();
            GridView2.DataBind();
            Response.Redirect("myInfoCenter.aspx?myBid");
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        string sql = "";
        Button btn = sender as Button;
        if (btn.CommandArgument == "IN")
        {
            sql = "SELECT nameOfGoods,goodsID,endTime,hightestPrice,state,scale FROM goods WHERE sellUserID='汤军' AND state='拍卖中'";
        }
        else
        {
            sql = "SELECT nameOfGoods,goodsID,endTime,hightestPrice,state,scale FROM goods WHERE sellUserID='汤军' AND state='已结束'";
        }
        try
        {
            SqlDataSource3.SelectCommand = sql;
            SqlDataSource3.DataBind();
            GridView3.DataBind();
            
        }
        catch (Exception ex)
        {
            Response.Write(ex.ToString());
        }
    }
    public void bindInfo()
    { 
      DataView dv=do1.getDataView("SELECT * FROM userPaimai WHERE userID='"+userID+"'");
      DataRow dr = dv.Table.Rows[0];
       nickName =dr[15].ToString().Trim();
       realName =dr[5].ToString().Trim();
       sex = dr[6].ToString().Trim();
       age = dr[7].ToString().Trim();
       address =dr[8].ToString().Trim();
       NO = dr[9].ToString().Trim();
       email = dr[14].ToString().Trim();
       credit = dr[12].ToString().Trim();
       score =dr[13].ToString().Trim();
       loginTime = dr[11].ToString().Trim();
       registerTime = dr[18].ToString().Trim();
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -