private void button1_Click(object sender, EventArgs e)
        {
            int             id              = Convert.ToInt32(userNameBox.Text);
            string          password        = passwordBox.Text;
            EmployeeService employeeService = new EmployeeService();

            if (employeeService.CheckLogin(id, password) == "Admin")
            {
                AdminPanel ap = new AdminPanel();
                this.Hide();
                ap.ShowDialog();
                this.Close();
            }
            else if (employeeService.CheckLogin(id, password) == "Pathologist")
            {
                PathologistPanel pp = new PathologistPanel();
                this.Hide();
                pp.ShowDialog();
                this.Close();
            }
            else if (employeeService.CheckLogin(id, password) == "Nurse")
            {
                NursePanel np = new NursePanel();
                this.Hide();
                np.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid User id or Password!!");
            }
        }
Example #2
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            AdminPanel ap = new AdminPanel();

            this.Hide();
            ap.ShowDialog();
            this.Close();
        }