protected void Button1_Click(object sender, EventArgs e) { s.insert("insert into news(Newsheading,News) values('" + txtheading.Text + "','" + txtnews.Text + "')"); string javaScript = "<script language=JavaScript>\n" + "alert('News sucessfully Added!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); GridView1.DataBind(); }
protected void Button2_Click(object sender, EventArgs e) { s.insert("update addevent set Eventname='" + txteventname.Text + "' , Eventdetail='" + txtdetail.Text + "',eventdate='" + txtdate.Text + "' where Eventid='" + Label1.Text + "'"); string javaScript = "<script language=JavaScript>\n" + "alert('Event sucessfully updated!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); GridView1.DataBind(); }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == string.Empty) { errorProvider1.SetError(textBox1, "Required"); } else if (textBox2.Text == string.Empty) { errorProvider1.SetError(textBox2, "Required"); } else if (textBox3.Text == string.Empty) { errorProvider1.SetError(textBox3, "Required"); } else if (textBox4.Text == string.Empty) { errorProvider1.SetError(textBox4, "Required"); } else { s.insert("insert into Registration([Username],[Password],[Emailid],[Contactno]) values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox4.Text + "','" + textBox3.Text + "')"); MessageBox.Show("information saved successfully"); s = null; textBox1.Text = string.Empty; textBox2.Text = string.Empty; textBox3.Text = string.Empty; textBox4.Text = string.Empty; } }
protected void Button1_Click(object sender, EventArgs e) { s.insert("insert into Request([AluminiName],[AluminiEmail],[Name],[Email],[Contact],Message) values('" + Session["name"] + "','" + Session["email"] + "','" + txtname.Text + "','" + txtemail.Text + "','" + txtcontact.Text + "','" + txtmsg.Text + "')"); string javaScript = "<script language=JavaScript>\n" + "alert('Request Sucessfully Sent!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); }
protected void Button1_Click(object sender, EventArgs e) { s.insert("insert into Registration([Username],[Password],[Emailid],[Contactno]) values('" + txtname.Text + "','" + txtpwd.Text + "','" + txtemail.Text + "','" + txtcontact.Text + "')"); string javaScript = "<script language=JavaScript>\n" + "alert('Registration successful !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 0) { SqlDataAdapter da = new SqlDataAdapter("select [Ipaddress],MacAddress from [Registration] where Ipaddress='" + lblip.Text + "' and MacAddress='" + label8.Text + "'", con); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count > 0) { string filename = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString(); // string filename = row.Cells[2].Text; string ftplocation = "ftp://107.180.1.81"; // Or on FreeBSD: "/usr/home/jared/test2.txt"; string user = "******"; string password = "******"; DownloadFile(ftplocation, filename, user, password, @"F:\"); MessageBox.Show("File successfully downloaded !!"); } else { string ftplocation = "ftp://107.180.1.81"; // Or on FreeBSD: "/usr/home/jared/test2.txt"; string user = "******"; string password = "******"; //UploadToFTP(ftplocation, file, user, password); DownloadFile(ftplocation, "About.aspx", user, password, @"F:\"); s.insert("insert into Intrudorip(Intrudorip,Macaddress) values('" + lblip.Text + "','" + label8.Text + "')"); s.SendEmail("*****@*****.**", "CAUTION !!! Unauthorized person is trying to download the file!!", "ABC"); // s.SendEmail("*****@*****.**", "CAUTION !!! Unauthorized person is trying to download the file!!", "ABC"); MessageBox.Show("file successfully downloaded !!"); } } }
protected void Button1_Click(object sender, EventArgs e) { s.insert("insert into Aluminiregistration([Name],[EnrollmentNo],[Email],[Password],[PassingYear],[Branch],[CompanyPlaced],[JobProfile],Status) values('" + txtname.Text + "','" + txtenroll.Text + "','" + txtemail.Text + "','" + txtpwd.Text + "','" + ddlyear.Text + "','" + ddlbranch.Text + "','" + txtcompany.Text + "','" + txtjobprofile.Text + "','Pending')"); string javaScript = "<script language=JavaScript>\n" + "alert('Request successfully Sent to admin!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); }
protected void Button1_Click(object sender, EventArgs e) { s.insert("insert into Participantdetail([Eventid],[EventName],[Name],[Contact],[Email],[Role]) values('" + lbleventid.Text + "','" + lbleventname.Text + "','" + txtname.Text + "','" + txtcontact.Text + "','" + txtemail.Text + "','" + txtrole.Text + "')"); string javaScript = "<script language=JavaScript>\n" + "alert('Sucessfully Applied!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); }
protected void Button1_Click1(object sender, EventArgs e) { s.insert("insert into Notice(Heading,Notice) values('" + TextBox1.Text + "','" + Notice.Value + "')"); Response.Write("<script>alert('Notice Added')</script>"); Notice.Value = string.Empty; TextBox1.Text = string.Empty; }
protected void send(object sender, EventArgs e) { save s = new save(); s.insert("insert into chat(chatfrom,chatto,message) values('" + Label1.Text + "','" + Session["empusername"] + "','" + tbmsg.Text + "')"); tbmsg.Text = ""; }
private void button1_Click(object sender, EventArgs e) { if (comboBox1.Text == "Server1") { string ftplocation = "ftp://107.180.1.81"; string file = lblfilepath.Text; // Or on FreeBSD: "/usr/home/jared/test2.txt"; string user = "******"; string password = "******"; UploadToFTP(ftplocation, file, user, password); save s = new save(); s.insert("insert into Share(Friendid,Filename,servername) values('" + textBox1.Text + "','" + label3.Text + "','" + comboBox1.Text + "')"); MessageBox.Show("Successfully Shared"); } if (comboBox1.Text == "Server2") { string ftplocation = "ftp://107.180.1.81"; string file = lblfilepath.Text; // Or on FreeBSD: "/usr/home/jared/test2.txt"; string user = "******"; string password = "******"; UploadToFTP(ftplocation, file, user, password); save s = new save(); s.insert("insert into Share(Friendid,Filename,servername) values('" + textBox1.Text + "','" + label3.Text + "','" + comboBox1.Text + "')"); MessageBox.Show("Successfully Shared"); } }
private void button1_Click(object sender, EventArgs e) { save s = new save(); s.insert("update registration set status='" + comboBox1.Text + "' where id='" + textBox1.Text + "'"); MessageBox.Show("Successfully Updated"); getvalue(); }
protected void Status_Click(object sender, EventArgs e) { Button btn = sender as Button; GridViewRow row = btn.NamingContainer as GridViewRow; string email = row.Cells[2].Text; s.insert("update [Aluminiregistration] set status='Approved' where email='" + email + "'"); GridView1.DataBind(); SendEmail(email, "Request Approval", "Your request has been approved"); }
private void button1_Click(object sender, EventArgs e) { int c = 1; if (textBox1.Text == string.Empty) { errorProvider1.SetError(textBox1, "Required"); c = 0; } if (textBox2.Text == string.Empty) { c = 0; errorProvider1.SetError(textBox2, "Required"); } else if (textBox3.Text == string.Empty) { errorProvider1.SetError(textBox3, "Required"); } if (textBox4.Text == string.Empty) { c = 0; errorProvider1.SetError(textBox4, "Required"); } if (textBox3.Text.Length < 10) { c = 0; errorProvider1.SetError(textBox3, "Required"); } if (c == 1) { string query = "select * from [Registration] where [Username]='" + textBox1.Text + "'"; SqlDataAdapter sda = new SqlDataAdapter(query, con); DataTable dt = new DataTable(); sda.Fill(dt); if (dt.Rows.Count > 0) { MessageBox.Show("already exixst"); } if (dt.Rows.Count == 0) { s.insert("insert into Registration([Username],[Password],[Emailid],[Contactno]) values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox4.Text + "','" + textBox3.Text + "')"); MessageBox.Show("information saved successfully"); s = null; textBox1.Text = string.Empty; textBox2.Text = string.Empty; textBox3.Text = string.Empty; textBox4.Text = string.Empty; } } }
protected void Button3_Click(object sender, EventArgs e) { if (FileUpload1.PostedFile.ContentLength > 0) { s.insert("update [Teacher_Record] set [Name]='" + Name.Text + "',[FatherName]='" + FatherName.Text + "',[DoB]='" + DoB.Text + "',[Sex]='" + Sex.Text + "',[Phone]='" + Phone.Text + "',[Address]='" + Address.Text + "',[PinCode]='" + PinCode.Text + "',[Email]='" + Email.Text + "',[Subject]='" + Subject.Text + "',[UserName]='" + UserName.Text + "',[Password]='" + Password.Text + "',[ProfileImages]='" + FileUpload1.PostedFile.FileName + "' where [Enrollment]='" + Enrollment.Text + "'"); string javaScript = "<script language=JavaScript>\n" + "alert('Teacher successfully Updated!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); } else { string javaScript = "<script language=JavaScript>\n" + "alert('Please Select Picture!!! !!');\n" + "</script>"; RegisterStartupScript("image1_ClickScript", javaScript); } }
private void button1_Click(object sender, EventArgs e) { string ftplocation = "ftp://107.180.1.81"; string file = lblfilepath.Text; // Or on FreeBSD: "/usr/home/jared/test2.txt"; string user = "******"; string password = "******"; UploadToFTP(ftplocation, file, user, password); save s = new save(); s.insert("insert into FileDetails(Uploadedby,Filename,ReadPermission,keywords,sharedto) values('" + uploadedby + "','" + label3.Text + "','" + comboBox1.Text + "','" + textBox2.Text + "','" + textBox1.Text + "')"); cafemanagement.Login l = new cafemanagement.Login(); l.SendEmail(textBox1.Text, "You Received a file", "lbsim.in/" + label3.Text); MessageBox.Show("Successfully Shared"); }
private void button2_Click(object sender, EventArgs e) { cn.Open(); SqlCommand cmd = new SqlCommand("select name,otp from otp where [name]='" + textBox1.Text + "' and otp='" + textBox3.Text + "'", cn); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { if (textBox1.Text == dr[0].ToString() || textBox3.Text == dr[1].ToString()) { FileSplitter.Master e1 = new FileSplitter.Master(textBox1.Text); e1.Show(); this.Hide(); s.insert("delete from otp where name='" + textBox1.Text + "'"); } } else { MessageBox.Show("Invalid username or password"); } cn.Close(); }
protected void Button2_Click(object sender, EventArgs e) { if (DropDownList1.Text == "Godaddy") { StreamReader sr = new StreamReader(Server.MapPath("~/Textfiles/TextFile.txt")); String line = sr.ReadToEnd(); sr.Close(); // textBox2.Text = line; string positiveKeyword = "good,excellent,delight,verygood,awesome"; string[] words = positiveKeyword.Split(','); string negativeKeyword = "bad,worst,awful,extremely bad"; string[] negativewords = negativeKeyword.Split(','); int i = 0, j = 0; foreach (string str in words) { foreach (string nstr in negativewords) { if (SearchWord(str, Server.MapPath("~/Textfiles/TextFile.txt")) == true) { i++; } else if (SearchWord(nstr, Server.MapPath("~/Textfiles/TextFile.txt")) == true) { j++; } } } int rate = i - j; int totalrate = i + j; decimal entropy = rate / totalrate; decimal log = Convert.ToDecimal(Math.Log(totalrate, 2)); s.insert("update [Rating] set PositiveRating='" + i + "',NegativeRating='" + j + "',TotalRating='" + totalrate + "',Entropy='" + entropy + "',Ratinglog='" + log + "' where [CompanyName]='" + DropDownList1.Text + "'"); } if (DropDownList1.Text == "Bigrock") { StreamReader sr = new StreamReader(Server.MapPath("~/Textfiles/TextFile7.txt")); String line = sr.ReadToEnd(); sr.Close(); // textBox2.Text = line; string positiveKeyword = "good,excellent,delight,verygood,awesome"; string[] words = positiveKeyword.Split(','); string negativeKeyword = "bad,worst,awful,extremely bad"; string[] negativewords = negativeKeyword.Split(','); int i = 0, j = 0; foreach (string str in words) { foreach (string nstr in negativewords) { if (SearchWord(str, Server.MapPath("~/Textfiles/TextFile7.txt")) == true) { i++; } else if (SearchWord(nstr, Server.MapPath("~/Textfiles/TextFile7.txt")) == true) { j++; } } } int rate = i - j; int totalrate = i + j; decimal entropy = Convert.ToDecimal(rate / totalrate); decimal log = Convert.ToDecimal(Math.Log(totalrate, 2)); s.insert("update [Rating] set PositiveRating='" + i + "',NegativeRating='" + j + "',TotalRating='" + totalrate + "',Entropy='" + entropy + "',Ratinglog='" + log + "' where [CompanyName]='" + DropDownList1.Text + "'"); } if (DropDownList1.Text == "Bluehost") { StreamReader sr = new StreamReader(Server.MapPath("~/Textfiles/TextFile8.txt")); String line = sr.ReadToEnd(); sr.Close(); // textBox2.Text = line; string positiveKeyword = "good,excellent,delight,verygood,awesome"; string[] words = positiveKeyword.Split(','); string negativeKeyword = "bad,worst,awful,extremely bad"; string[] negativewords = negativeKeyword.Split(','); int i = 0, j = 0; foreach (string str in words) { foreach (string nstr in negativewords) { if (SearchWord(str, Server.MapPath("~/Textfiles/TextFile8.txt")) == true) { i++; } else if (SearchWord(nstr, Server.MapPath("~/Textfiles/TextFile8.txt")) == true) { j++; } } } int rate = i - j; int totalrate = i + j; decimal entropy = rate / totalrate; decimal log = Convert.ToDecimal(Math.Log(totalrate, 2)); s.insert("update [Rating] set PositiveRating='" + i + "',NegativeRating='" + j + "',TotalRating='" + totalrate + "',Entropy='" + entropy + "',Ratinglog='" + log + "' where [CompanyName]='" + DropDownList1.Text + "'"); } }