private void backButton_Click(object sender, EventArgs e) { this.Hide(); doctor doctor = new doctor(); doctor.Show(); }
private void EnglishButton_Click(object sender, EventArgs e) { cn.Open(); SqlCommand cmd = new SqlCommand ("select count(*) from hospitalStaff where userName='******';", cn); string u = cmd.ExecuteScalar().ToString(); if (u.Equals("1")) { cmd = new SqlCommand ("select password from hospitalStaff where userName='******';", cn); string s = cmd.ExecuteScalar().ToString(); string password = passTextBox.Text.Trim(); if (password.Equals(s)) { cmd = new SqlCommand ("select jobTitle from hospitalStaff where userName='******';", cn); string jobTitle = cmd.ExecuteScalar().ToString(); switch (jobTitle) { case "doctor": this.Hide(); doctor doctor = new doctor(); doctor.Show(); break; case "nurse": this.Hide(); nurse nurse = new nurse(); nurse.Show(); break; case "manager": this.Hide(); systemManager systemManager = new systemManager(); systemManager.Show(); break; } } else { MessageBox.Show("wrong password"); } } else { MessageBox.Show("user name does not exist"); } cn.Close(); }
private void backButton_Click(object sender, EventArgs e) { switch (back) { case "systemManager": this.Hide(); systemManager systemManager = new systemManager(); systemManager.Show(); break; case "doctor": this.Hide(); doctor doctor = new doctor(); doctor.Show(); break; case "nurse": this.Hide(); nurse nurse = new nurse(); nurse.Show(); break; } }