protected void Page_Load(object sender, EventArgs e) { if (Session["login"] != null) { string user = Session["Username"].ToString(); DataSet ak = SqlAC.CheckData("SELECT * FROM Users WHERE Username ='******'"); string manager = ak.Tables[0].Rows[0]["Manager"].ToString(); if (int.Parse(manager) == 1) { ManagerSide.Visible = true; } Login.Visible = false; Register.Visible = false; Logout.Visible = true; UProfile.Visible = true; LBL_Userinfo.Text = "Hello " + Session["Username"]; SellP.Visible = true; AH.Visible = true; Link2.Text = "Sell"; Link3.Text = "Logout"; Link2.Click += new EventHandler(LinkAuctions_Click); Link3.Click += new EventHandler(Logout_Click); } else { ManagerSide.Visible = false; AH.Visible = false; Login.Visible = true; Register.Visible = true; Logout.Visible = false; UProfile.Visible = false; SellP.Visible = false; Link2.Text = "Register"; Link3.Text = "Login"; Link2.Text = "Register"; Link3.Text = "Login"; Link2.Click += new EventHandler(Register_Click); Link3.Click += new EventHandler(Login_Click); } }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"]; ak = SqlAC.CheckData("SELECT * FROM Auctions WHERE ID=" + id); count(); price.Text = ak.Tables[0].Rows[0]["price"].ToString(); title.InnerText = ak.Tables[0].Rows[0]["PName"].ToString(); PPic.ImageUrl = "~/APhotos/" + ak.Tables[0].Rows[0]["ImgUrl"].ToString(); PPic.Width = 300; PPic.Height = 300; string seller = ak.Tables[0].Rows[0]["SUser"].ToString(); if (Session["login"] == null || (Session["Username"].Equals(seller))) { Offer.Enabled = false; Btn_Offer.Enabled = false; } AH(id); }
protected void Activate_Click(object sender, EventArgs e) { DateTime date = DateTime.Now; int H = int.Parse(Hours.Text); int M = int.Parse(mins.Text); TimeSpan time = new TimeSpan(0, H, M); DateTime combined = date.Add(time); string t = title.Text; string Userr = User.Text; string P = Price.Text; string ey = combined.Year.ToString(); string em = combined.Month.ToString(); string ed = combined.Day.ToString(); string eh = combined.Hour.ToString(); string emin = combined.Minute.ToString(); string url = ak.Tables[0].Rows[0]["ImgUrl"].ToString(); string catagory = ak.Tables[0].Rows[0]["Catagory"].ToString(); SqlAC.udi("INSERT INTO Auctions (PName,SUser,Price,EY,EM,ED,EH,EMin,Open,ImgUrl,Catagory,Description) VALUES ('" + t + "','" + Userr + "','" + P + "','" + ey + "','" + em + "','" + ed + "','" + eh + "','" + emin + ",'1'," + url + "','" + catagory + "','" + desc + "'"); SqlAC.udi("DELETE FROM PendingAuctions WHERE id=" + id); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { DataSet ak = SqlAC.CheckData("SELECT * FROM Users WHERE Username='******'"); TB_password.Text = ak.Tables[0].Rows[0]["Password"].ToString(); TB_Conforirmpassword.Text = ak.Tables[0].Rows[0]["Password"].ToString(); TB_Email.Text = ak.Tables[0].Rows[0]["Email"].ToString(); TB_FN.Text = ak.Tables[0].Rows[0]["FName"].ToString(); TB_LN.Text = ak.Tables[0].Rows[0]["LName"].ToString(); TB_PN.Text = ak.Tables[0].Rows[0]["Phone"].ToString(); DataSet ds = SqlAC.CheckData("SELECT * FROM Cities"); TB_City.DataSource = ds.Tables[0]; TB_City.DataTextField = ds.Tables[0].Columns["City"].ToString(); TB_City.DataValueField = ds.Tables[0].Columns["City"].ToString(); TB_City.DataBind(); TB_City.Text = ak.Tables[0].Rows[0]["City"].ToString(); } catch (Exception) { Response.Redirect("Home.aspx"); } } }
private void Delete(int i) { SqlAC.udi("UPDATE Auctions SET Auctions.Open='0' WHERE ID=" + ak.Tables[0].Rows[i]["ID"].ToString() + ""); }
protected void Unnamed_Click(object sender, EventArgs e) { s = DDL.Text; SqlAC.udi("UPDATE Complaints SET Response='" + Res.Text + "',Checked='1' WHERE Title='" + s + "'"); Response.Redirect("Compllaints.aspx"); }