示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                cmd = new MySqlCommand("update canteen.cook set password=?b,c_password=?c where c_id='" + textBox1.Text + "'", con);
                if (textBox2.Text == textBox3.Text)
                {
                    cmd.Parameters.AddWithValue("?b", textBox2.Text);
                    cmd.Parameters.AddWithValue("?c", textBox3.Text);
                    cmd.ExecuteNonQuery();
                    MessageBox.Show("Password updated");
                }
                else
                {
                    MessageBox.Show("Password and confirm password do not match");
                }
            }
            catch (Exception e1)
            {
                MessageBox.Show(e1.ToString());
            }
            textBox1.Clear();
            textBox2.Clear();
            textBox3.Clear();
            Hide();
            Form13 f13 = new Form13();

            f13.Show();
        }
示例#2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (radioButton1.Checked == true)
     {
         Form12 f12 = new Form12();
         f12.Show();
     }
     else
     {
         Form13 f13 = new Form13();
         f13.Show();
     }
     Hide();
 }