예제 #1
0
        private void backButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            systemManagerAR systemManagerAR = new systemManagerAR();

            systemManagerAR.Show();
        }
예제 #2
0
        private void EnterButton_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();
                        doctorAR doctor = new doctorAR();
                        doctor.Show();
                        break;

                    case "nurse":
                        this.Hide();
                        nurseAR nurse = new nurseAR();
                        nurse.Show();
                        break;

                    case "manager":
                        this.Hide();
                        systemManagerAR systemManager = new systemManagerAR();
                        systemManager.Show();
                        break;
                    }
                }
                else
                {
                    MessageBox.Show("wrong password");
                }
            }
            else
            {
                MessageBox.Show("user name does not exist");
            }

            cn.Close();
        }
예제 #3
0
        private void backButton_Click(object sender, EventArgs e)
        {
            switch (back)
            {
            case "systemManagerAR":
                this.Hide();
                systemManagerAR systemManagerAR = new systemManagerAR();
                systemManagerAR.Show();
                break;

            case "doctorAR":
                this.Hide();
                doctorAR doctorAR = new doctorAR();
                doctorAR.Show();
                break;

            case "nurseAR":
                this.Hide();
                nurseAR nurseAR = new nurseAR();
                nurseAR.Show();
                break;
            }
        }