private void btn_Back_ManageInPa_Click(object sender, EventArgs e) { this.Close(); OPDmain opdm = new OPDmain(); opdm.Show(); }
private void button2_Click(object sender, EventArgs e) { OPDmain om = new OPDmain(position); om.Show(); }
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(); }