protected void Page_Load(object sender, EventArgs e) { if (!checkCookie()) Response.Redirect("Login.aspx"); String sellerUsername = Request.Cookies["Car-Trading"]["Username"].ToString(); DatabaseHandler obj=new DatabaseHandler(); DataSet ds = obj.GetSellerId(sellerUsername); String sellerId = ds.Tables[0].Rows[0]["SELLER_ID"].ToString(); ds = obj.GetSellerAuctionInfo(sellerId); if (ds == null) Label8.Text = "You have no auction currently in progress"; else { Table1.Visible = true; Table2.Visible = true; Label1.Text = ds.Tables[0].Rows[0]["CAR_BRAND"].ToString(); Label2.Text = ds.Tables[0].Rows[0]["CAR_MODEL_NAME"].ToString(); Label3.Text = ds.Tables[0].Rows[0]["CAR_MODEL_NUMBER"].ToString(); Label4.Text = ds.Tables[0].Rows[0]["CAR_PRICE"].ToString(); Label5.Text = ds.Tables[0].Rows[0]["AUCTION_START_TIME"].ToString(); Label6.Text = ds.Tables[0].Rows[0]["AUCTION_END_TIME"].ToString(); Label7.Text = ds.Tables[0].Rows[0]["AUCTION_BIDS"].ToString(); String auctionId = ds.Tables[0].Rows[0]["AUCTION_ID"].ToString(); if(Label7.Text!="0") { ds = obj.GetAuctionBids(auctionId); GridView1.DataSource = ds; GridView1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!checkCookie()) Response.Redirect("Login.aspx"); this.UnobtrusiveValidationMode = System.Web.UI.UnobtrusiveValidationMode.None; DatabaseHandler obj = new DatabaseHandler(); DataSet ds = obj.GetSellerId(Request.Cookies["Car-Trading"]["Username"].ToString()); String sellerId = ds.Tables[0].Rows[0]["SELLER_ID"].ToString(); ds = obj.GetSellerAuctionInfo(sellerId); if (ds != null) { Label1.Text = "You already have an active auction. Please remove it before adding a new one"; Button2.Enabled = false; } }