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(); } }
public static void ADDsuggestion(Suggestions s) { Dataclass.Sug.Add(s); }