protected void Button1_Click(object sender, EventArgs e) { String idget = Request.Cookies["userid"].Value; if (SqlGetData.DataMan("INSERT into profile_details VALUES('" + idget + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','10','Basic','dp_dummy.jpg','cover_dummy.jpg')")) { Response.Redirect("home.aspx"); } }
public static bool check_table_presence(string id) { dataset_p = SqlGetData.GetData("SELECT * FROM profile_details where uid='" + id + "'"); if (dataset_p.Tables["user_info"].Rows.Count > 0) { return(true); } else { return(false); } }
protected void Button2_Click1(object sender, EventArgs e) { string newFirstName = TextBox3.Text; string newLastName = TextBox4.Text; string newEmail = TextBox5.Text; string newPassword = TextBox6.Text; if (SqlGetData.DataMan("INSERT INTO user_info VALUES('" + newLastName + "','" + newFirstName + "','" + newEmail + "','" + newPassword + "')")) { string message = "SignUp process is done. Please login from above to continue."; Label1.Text = message; } else { } }
protected void Button1_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); FileUpload1.PostedFile.SaveAs(Server.MapPath("~/dp/") + fileName); string bindfilename = fileName; try{ if (SqlGetData.DataMan("UPDATE profile_details SET profile_pic='" + bindfilename + "' WHERE uid='" + picker + "'")) { Response.Redirect("home.aspx"); } } catch (Exception ex) { Response.Write(ex.Message); } } }
protected void Page_Load(object sender, EventArgs e) { if (Request.Cookies["userid"] != null) { picker = Request.Cookies["userid"].Value; } if (Request.Cookies["FullName"] == null) { Response.Redirect("index.aspx"); } else { meroid = Request.Cookies["userid"].Value; Label1.Text = Request.Cookies["FullName"].Value; } try { if (functions.check_table_presence(meroid)) { // Response.Write(meroid); HyperLink1.Enabled = false; dataset = SqlGetData.GetData("SELECT * FROM profile_details where uid='" + meroid + "'"); if (dataset.Tables["user_info"].Rows.Count > 0) { string getimagepath = dataset.Tables["user_info"].Rows[0][13].ToString(); //ImageBox.ImageUrl = getimagepath; string bindimage = "~/dp/" + getimagepath; Image1.ImageUrl = bindimage; } } else { HyperLink1.Text = "Complete Your Profile"; HyperLink1.NavigateUrl = "completeprofile.aspx"; } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { if (functions.cookieUpdater == "ok") { string uid2 = functions.uid; ds1 = SqlGetData.GetData("Select *from user_info where uid='" + uid2 + "'"); if (ds1.IsInitialized) { String userid = ds1.Tables["user_info"].Rows[0][0].ToString(); String Lname = ds1.Tables["user_info"].Rows[0][1].ToString(); String Fname = ds1.Tables["user_info"].Rows[0][2].ToString(); String UEmail = ds1.Tables["user_info"].Rows[0][3].ToString(); String space = " "; String FullName = Fname + space + Lname; Response.Cookies["userid"].Value = userid; Response.Cookies["userid"].Expires = DateTime.Now.AddDays(1); Response.Cookies["FullName"].Value = FullName; Response.Cookies["FullName"].Expires = DateTime.Now.AddDays(1); Response.Cookies["UEmail"].Value = UEmail; Response.Cookies["UEmail"].Expires = DateTime.Now.AddDays(1); Response.Cookies["setCookies"].Value = "ok"; Response.Cookies["setCookies"].Expires = DateTime.Now.AddDays(1); Response.Redirect("home.aspx"); functions.cookieUpdater = "notok"; } else { } } else { Response.Redirect("logout.aspx"); } } catch (Exception ex) { Console.Write(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { try { int id = 1; dataset = SqlGetData.GetData("SELECT * FROM profile_details where uid='" + id + "'"); if (dataset.IsInitialized) { string getimagepath = dataset.Tables["user_info"].Rows[0][13].ToString(); //ImageBox.ImageUrl = getimagepath; string bindimage = "~/dp/" + getimagepath; ImageBox.ImageUrl = bindimage; } } catch (Exception ex) { Response.Write(ex.Message); } }
protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text != "") { string p_actor_username = Request.Cookies["FullName"].Value; string dateTime = System.DateTime.Now.ToString(); if (FileUpload1.HasFile) { string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); FileUpload1.PostedFile.SaveAs(Server.MapPath("~/post_img/") + fileName); string bindfilename = fileName; if (SqlGetData.DataMan("INSERT INTO POST (post_caption,post_actor,post_photo,post_date,post_actor_name)VALUES('" + TextBox1.Text + "','" + meroid + "','" + bindfilename + "','" + dateTime + "','" + p_actor_username + "') ")) { Response.Redirect("home.aspx"); } } } }
protected void Button1_Click(object sender, EventArgs e) { try { ds = SqlGetData.GetData("Select *from user_info where UEmail='" + TextBox1.Text + "' and UPassword='******'"); if (ds.IsInitialized) { String userid = ds.Tables["user_info"].Rows[0][0].ToString(); String Lname = ds.Tables["user_info"].Rows[0][1].ToString(); String Fname = ds.Tables["user_info"].Rows[0][2].ToString(); String UEmail = ds.Tables["user_info"].Rows[0][3].ToString(); String space = " "; String FullName = Fname + space + Lname; Response.Cookies["userid"].Value = userid; Response.Cookies["userid"].Expires = DateTime.Now.AddDays(1); Response.Cookies["FullName"].Value = FullName; Response.Cookies["FullName"].Expires = DateTime.Now.AddDays(1); Response.Cookies["UEmail"].Value = UEmail; Response.Cookies["UEmail"].Expires = DateTime.Now.AddDays(1); Response.Cookies["setCookies"].Value = "ok"; Response.Cookies["setCookies"].Expires = DateTime.Now.AddDays(1); if (functions.check_table_presence(userid)) { functions.profile_completed = 1; } Response.Redirect("home.aspx"); } else { Response.Redirect("index.aspx"); } } catch (Exception ex) { Console.Write(ex.Message); } /* * try * { * con = new SqlConnection("server=ANONYMOUS\\SQLEXPRESS;integrated security=true;database=travel"); * con.Open(); * String qry = "Select *from user_info where UEmail='" + TextBox1.Text + "' and UPassword='******'"; * SqlCommand cmd = new SqlCommand(qry, con); * SqlDataReader sdr = cmd.ExecuteReader(); * if (sdr.Read()) * { * Response.Redirect("home.aspx"); * } * else * { * Response.Redirect("index.aspx"); * } * } * catch (Exception ex) { * Response.Write(ex.Message); * }*/ }