private void button2Back_Click(object sender, EventArgs e) { Form11ManagerTask obj = new Form11ManagerTask(); obj.Show(); this.Hide(); }
private void button3Ok_Click(object sender, EventArgs e) { mgs.Text = ""; connection.Open(); OleDbCommand command = new OleDbCommand(); command.Connection = connection; command.CommandText = "select * from ManagerLogin where Manager_Id='" + textBox1.Text + "'and Mpassword='******'"; OleDbDataReader reader = command.ExecuteReader(); int count = 0; while (reader.Read()) { count = count + 1; } connection.Close(); textBox1.Clear(); textBox2.Clear(); if (count == 1) { // MessageBox.Show("user name and password is currect"); Form11ManagerTask obj = new Form11ManagerTask(); obj.Show(); this.Hide(); } else if (count > 1) { mgs.Text = "Duplicate Manager Id and password"; // MessageBox.Show("Duplicate user name and password"); } else { mgs.Text = "Manager Id and Password is NO CURRECT"; // MessageBox.Show("user name and password is NO CURRECT"); } }