private void Button4_Click(object sender, EventArgs e) { this.Hide(); EmployeeList obj3 = new EmployeeList(); obj3.ShowDialog(); }
private void Button2_Click(object sender, EventArgs e) { connection = new SqlConnection(); command = new SqlCommand(); connection.ConnectionString = "server=.;initial catalog=MANAGER;integrated security=true"; command.Connection = connection; connection.Open(); SqlCommand cmd = new SqlCommand(" select ad_ID FROM Employee Where em_username=@em_username and em_password =@em_password ", connection); cmd.CommandType = CommandType.Text; cmd.Parameters.AddWithValue("@em_username", textBox1.Text); cmd.Parameters.AddWithValue("@em_password", textBox2.Text); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { this.Visible = false; EmployeeList obj2 = new EmployeeList(); obj2.ShowDialog(); } else { MessageBox.Show("invalid username or password.....try again"); } connection.Close(); }
private void EmployeeListToolStripMenuItem_Click(object sender, EventArgs e) { this.Hide(); EmployeeList obj3 = new EmployeeList(); obj3.ShowDialog(); }