private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "") { MessageBox.Show("You must enter your name!"); } else if (textBox2.Text == "") { MessageBox.Show("You must enter your email!"); } else if (richTextBox1.Text == "") { MessageBox.Show("You must add some suggestion/query"); } else if (textBox2.Text.Contains("@") == false || textBox2.Text.Contains(".com") == false) { MessageBox.Show("email must be in right format"); } else { Suggestions s = new Suggestions(); s.Suggestion = richTextBox1.Text; s.Yourname = textBox1.Text; s.Email2 = textBox2.Text; Dataclass.ADDsuggestion(s); MessageBox.Show("Sent"); richTextBox1.Text = ""; textBox1.Text = ""; textBox2.Text = ""; frmProjects r = new frmProjects(); this.Hide(); r.Show(); } }
private void button2_Click(object sender, EventArgs e) { BindingSource source = new BindingSource(); source.DataSource = Dataclass.Sug; dataGridView1.DataSource = source; Dataclass.SHOWall(); }
private void Button1_Click(object sender, EventArgs e) { BindingSource source = new BindingSource(); source.DataSource = Dataclass.Vol; dataGridView1.DataSource = source; Dataclass.SHOWALL(); }
private void button2_Click(object sender, EventArgs e) { BindingSource source = new BindingSource(); source.DataSource = Dataclass.Don; dataGridView1.DataSource = source; Dataclass.SHOW(); //dataGridView1.ReadOnly = false; //dataGridView1.Columns[0].Visible = false; }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Length < 5) { MessageBox.Show("Enter your name having length greater than 5"); } else if (textBox2.Text.Length < 11 && textBox2.Text.Length > 11) { MessageBox.Show("Enter your valid contact number"); } else if (!textBox3.Text.Contains("@gmail.com")) { MessageBox.Show("Enter your valid Email Adress"); } else if (textBox4.Text.Length < 13 && textBox4.Text.Length > 13) { MessageBox.Show("Enter your valid CNIC number"); } else if (textBox6.Text != "Male" && textBox6.Text != "Female") { MessageBox.Show("Enter A valid Gender"); } else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "" || textBox7.Text == "" || textBox8.Text == "" || textBox9.Text == "") { MessageBox.Show("please fill All the feilds"); } else { Volunteer v = new Volunteer(); v.Username = textBox1.Text; v.Contactno = textBox2.Text; v.Email = textBox3.Text; v.Cnic = textBox4.Text; v.Age = textBox5.Text; v.Gender = textBox6.Text; v.Profession = textBox7.Text; v.Address = textBox8.Text; v.Skill = textBox9.Text; v.Join = richTextBox1.Text; textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; textBox9.Text = ""; richTextBox1.Text = ""; Random random = new Random(); int a = random.Next(100, 1000000); v.Id = a; Dataclass.ADDvolunteer(v); MessageBox.Show("Thankyou for registration!"); } }
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Length < 5) { MessageBox.Show("Enter your name having length greater than 5"); } else if (textBox2.Text.Length < 11 && textBox2.Text.Length > 11) { MessageBox.Show("Enter your valid contact number"); } else if (!textBox3.Text.Contains("@gmail.com")) { MessageBox.Show("Enter your valid Email Adress"); } else if (textBox4.Text.Length < 13 && textBox4.Text.Length > 13) { MessageBox.Show("Enter your valid CNIC number"); } else if (textBox6.Text != "Male" && textBox6.Text != "Female") { MessageBox.Show("Enter A valid Gender"); } else if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "" || textBox5.Text == "" || textBox6.Text == "" || textBox7.Text == "" || textBox8.Text == "") { MessageBox.Show("please fill All the feilds"); } else if (!checkBox1.Checked && !checkBox2.Checked && !checkBox3.Checked && !checkBox4.Checked) { MessageBox.Show("Select atleast one catagory for donation"); } else { Donor d = new Donor(); d.Name = textBox1.Text; d.Contact = textBox2.Text; d.Email1 = textBox3.Text; d.Cnic1 = textBox4.Text; d.Age1 = textBox5.Text; d.Gender1 = textBox6.Text; d.Profession1 = textBox7.Text; d.Address1 = textBox8.Text; if (checkBox1.Checked == true) { d.Donate = "Easy Paisa"; } else if (checkBox2.Checked == true) { d.Donate = "Money Order"; } else if (checkBox3.Checked == true) { d.Donate = "Receive cash from doorstep"; } else if (checkBox4.Checked == true) { d.Donate = "Courier goods"; } textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; checkBox1.Checked = false; checkBox2.Checked = false; checkBox3.Checked = false; checkBox4.Checked = false; Random random = new Random(); int a = random.Next(100, 1000000); d.Id1 = a; Dataclass.ADDdonor(d); MessageBox.Show("Thankyou for registration!"); } }