private void btnBack_Click(object sender, EventArgs e)
        {
            this.Hide();
            Ward_MainFrame f1 = new Ward_MainFrame();

            f1.ShowDialog();
        }
Example #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            Ward_MainFrame wf = new Ward_MainFrame(position);

            wf.Show();
        }
Example #3
0
        private void btn_login_Click(object sender, EventArgs e)
        {
            username = txt_empID.Text;
            String          query = "select * from itp.hr_registration  where Employee_ID = '" + txt_empID.Text + "' and Password ='******';";
            MySqlCommand    cmd   = new MySqlCommand(query, mscon);
            int             count = 0;
            MySqlDataReader mr;

            try
            {
                mscon.Open();
                mr = cmd.ExecuteReader();


                while (mr.Read())
                {
                    count = count + 1;
                }
                mscon.Close();
                if (count == 1)
                {
                    MessageBox.Show("Correct Username or Password");

                    String       query1 = "select Position from itp.hr_registration  where Employee_ID = '" + txt_empID.Text + "';";
                    MySqlCommand cmd1   = new MySqlCommand(query1, mscon);


                    try
                    {
                        mscon.Open();
                        position = cmd1.ExecuteScalar().ToString();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }

                    if (position == "Admin")
                    {
                        Admin a = new Admin();
                        a.Show();
                        this.Hide();
                    }
                    else if (position == "Pharmacist")
                    {
                    }
                    else if (position == "Ward Master")
                    {
                        Ward_MainFrame wf = new Ward_MainFrame(position);
                        wf.Show();
                        this.Hide();
                    }
                    else if (position == "Store Manager")
                    {
                    }
                    else if (position == "Transport Manager")
                    {
                    }
                    else if (position == "Receptionist")
                    {
                        OPDmain om = new OPDmain(position);
                        om.Show();
                        this.Hide();
                    }
                    else if (position == "Lab Manager")
                    {
                        Form1 lbm = new Form1(position);
                        lbm.Show();
                        this.Hide();
                    }
                    else if (position == "Chanelling Manager")
                    {
                    }
                    else if (position == "HR Manager")
                    {
                    }
                }
                else
                {
                    MessageBox.Show("Incorrect Username or Password");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            mscon.Close();
        }