private void button2_Click(object sender, EventArgs e) { DataTable dt = Program.get_dt("SELECT Permission FROM Login WHERE Id='" + u.Id + "'"); if (dt.Rows[0][0].Equals("HOD")) { this.Hide(); HeadOfDepart_Main HA = new HeadOfDepart_Main(((CHeadOfDepartment)u)); this.Closed += (s, args) => this.Close(); HA.Show(); } if (dt.Rows[0][0].Equals("TS")) { this.Hide(); TeachingStaffMenu Ts = new TeachingStaffMenu(((CTeachingStaff)u)); this.Closed += (s, args) => this.Close(); Ts.Show(); } if (dt.Rows[0][0].Equals("SEC")) { this.Hide(); SecretaryFolder.Secretary_Menu Sec = new SecretaryFolder.Secretary_Menu(((CSecretary)u)); this.Closed += (s, args) => this.Close(); Sec.Show(); } if (dt.Rows[0][0].Equals("ADS")) { this.Hide(); Administration.Administration_main Es = new Administration.Administration_main(((CAdministration)u)); this.Closed += (s, args) => this.Close(); Es.Show(); } }
private void button1_Click(object sender, EventArgs e) { Administration_main f1 = new Administration_main(ADS); this.Hide(); this.Closed += (s, args) => this.Close(); f1.Show(); }