private void lbl_stf1_Click(object sender, EventArgs e) { Fac_Stf_Form info = new Fac_Stf_Form(); Label fs = (Label)sender; if (fs.Name == "lbl_stf1") { info.FS_pic = people.staff[0].imagePath; info.FS_name = people.staff[0].name; info.FS_title = people.staff[0].title; info.FS_office = people.staff[0].office; info.FS_phone = people.staff[0].phone; info.FS_email = people.staff[0].email; } else if (fs.Name == "lbl_stf2") { info.FS_pic = people.staff[1].imagePath; info.FS_name = people.staff[1].name; info.FS_title = people.staff[1].title; info.FS_office = people.staff[1].office; info.FS_phone = people.staff[1].phone; info.FS_email = people.staff[1].email; } else if (fs.Name == "lbl_stf3") { info.FS_pic = people.staff[2].imagePath; info.FS_name = people.staff[2].name; info.FS_title = people.staff[2].title; info.FS_office = people.staff[2].office; info.FS_phone = people.staff[2].phone; info.FS_email = people.staff[2].email; } else if (fs.Name == "lbl_stf4") { info.FS_pic = people.staff[3].imagePath; info.FS_name = people.staff[3].name; info.FS_title = people.staff[3].title; info.FS_office = people.staff[3].office; info.FS_phone = people.staff[3].phone; info.FS_email = people.staff[3].email; } else if (fs.Name == "lbl_stf5") { info.FS_pic = people.staff[4].imagePath; info.FS_name = people.staff[4].name; info.FS_title = people.staff[4].title; info.FS_office = people.staff[4].office; info.FS_phone = people.staff[4].phone; info.FS_email = people.staff[4].email; } else if (fs.Name == "lbl_stf6") { info.FS_pic = people.staff[5].imagePath; info.FS_name = people.staff[5].name; info.FS_title = people.staff[5].title; info.FS_office = people.staff[5].office; info.FS_phone = people.staff[5].phone; info.FS_email = people.staff[5].email; } else if (fs.Name == "lbl_stf7") { info.FS_pic = people.staff[6].imagePath; info.FS_name = people.staff[6].name; info.FS_title = people.staff[6].title; info.FS_office = people.staff[6].office; info.FS_phone = people.staff[6].phone; info.FS_email = people.staff[6].email; } else if (fs.Name == "lbl_stf8") { info.FS_pic = people.staff[7].imagePath; info.FS_name = people.staff[7].name; info.FS_title = people.staff[7].title; info.FS_office = people.staff[7].office; info.FS_phone = people.staff[7].phone; info.FS_email = people.staff[7].email; } else if (fs.Name == "lbl_stf9") { info.FS_pic = people.staff[8].imagePath; info.FS_name = people.staff[8].name; info.FS_title = people.staff[8].title; info.FS_office = people.staff[8].office; info.FS_phone = people.staff[8].phone; info.FS_email = people.staff[8].email; } else if (fs.Name == "lbl_stf10") { info.FS_pic = people.staff[9].imagePath; info.FS_name = people.staff[9].name; info.FS_title = people.staff[9].title; info.FS_office = people.staff[9].office; info.FS_phone = people.staff[9].phone; info.FS_email = people.staff[9].email; } else if (fs.Name == "lbl_stf11") { info.FS_pic = people.staff[10].imagePath; info.FS_name = people.staff[10].name; info.FS_title = people.staff[10].title; info.FS_office = people.staff[10].office; info.FS_phone = people.staff[10].phone; info.FS_email = people.staff[10].email; } else if (fs.Name == "lbl_stf12") { info.FS_pic = people.staff[11].imagePath; info.FS_name = people.staff[11].name; info.FS_title = people.staff[11].title; info.FS_office = people.staff[11].office; info.FS_phone = people.staff[11].phone; info.FS_email = people.staff[11].email; } else if (fs.Name == "lbl_stf13") { info.FS_pic = people.staff[12].imagePath; info.FS_name = people.staff[12].name; info.FS_title = people.staff[12].title; info.FS_office = people.staff[12].office; info.FS_phone = people.staff[12].phone; info.FS_email = people.staff[12].email; } info.Show(); }
//show 2nd form with details based on the click of faculty and staff private void lbl_fac1_Click(object sender, EventArgs e) { Fac_Stf_Form info = new Fac_Stf_Form(); Label fs = (Label)sender; if (fs.Name == "lbl_fac1") { info.FS_pic = people.faculty[0].imagePath; info.FS_name = people.faculty[0].name; info.FS_title = people.faculty[0].title; info.FS_office = people.faculty[0].office; info.FS_phone = people.faculty[0].phone; info.FS_email = people.faculty[0].email; } else if (fs.Name == "lbl_fac2") { info.FS_pic = people.faculty[1].imagePath; info.FS_name = people.faculty[1].name; info.FS_title = people.faculty[1].title; info.FS_office = people.faculty[1].office; info.FS_phone = people.faculty[1].phone; info.FS_email = people.faculty[1].email; } else if (fs.Name == "lbl_fac3") { info.FS_pic = people.faculty[2].imagePath; info.FS_name = people.faculty[2].name; info.FS_title = people.faculty[2].title; info.FS_office = people.faculty[2].office; info.FS_phone = people.faculty[2].phone; info.FS_email = people.faculty[2].email; } else if (fs.Name == "lbl_fac4") { info.FS_pic = people.faculty[3].imagePath; info.FS_name = people.faculty[3].name; info.FS_title = people.faculty[3].title; info.FS_office = people.faculty[3].office; info.FS_phone = people.faculty[3].phone; info.FS_email = people.faculty[3].email; } else if (fs.Name == "lbl_fac5") { info.FS_pic = people.faculty[4].imagePath; info.FS_name = people.faculty[4].name; info.FS_title = people.faculty[4].title; info.FS_office = people.faculty[4].office; info.FS_phone = people.faculty[4].phone; info.FS_email = people.faculty[4].email; } else if (fs.Name == "lbl_fac6") { info.FS_pic = people.faculty[5].imagePath; info.FS_name = people.faculty[5].name; info.FS_title = people.faculty[5].title; info.FS_office = people.faculty[5].office; info.FS_phone = people.faculty[5].phone; info.FS_email = people.faculty[5].email; } else if (fs.Name == "lbl_fac7") { info.FS_pic = people.faculty[6].imagePath; info.FS_name = people.faculty[6].name; info.FS_title = people.faculty[6].title; info.FS_office = people.faculty[6].office; info.FS_phone = people.faculty[6].phone; info.FS_email = people.faculty[6].email; } else if (fs.Name == "lbl_fac8") { info.FS_pic = people.faculty[7].imagePath; info.FS_name = people.faculty[7].name; info.FS_title = people.faculty[7].title; info.FS_office = people.faculty[7].office; info.FS_phone = people.faculty[7].phone; info.FS_email = people.faculty[7].email; } else if (fs.Name == "lbl_fac9") { info.FS_pic = people.faculty[8].imagePath; info.FS_name = people.faculty[8].name; info.FS_title = people.faculty[8].title; info.FS_office = people.faculty[8].office; info.FS_phone = people.faculty[8].phone; info.FS_email = people.faculty[8].email; } else if (fs.Name == "lbl_fac10") { info.FS_pic = people.faculty[9].imagePath; info.FS_name = people.faculty[9].name; info.FS_title = people.faculty[9].title; info.FS_office = people.faculty[9].office; info.FS_phone = people.faculty[9].phone; info.FS_email = people.faculty[9].email; } else if (fs.Name == "lbl_fac11") { info.FS_pic = people.faculty[10].imagePath; info.FS_name = people.faculty[10].name; info.FS_title = people.faculty[10].title; info.FS_office = people.faculty[10].office; info.FS_phone = people.faculty[10].phone; info.FS_email = people.faculty[10].email; } else if (fs.Name == "lbl_fac12") { info.FS_pic = people.faculty[12].imagePath; info.FS_name = people.faculty[12].name; info.FS_title = people.faculty[12].title; info.FS_office = people.faculty[12].office; info.FS_phone = people.faculty[12].phone; info.FS_email = people.faculty[12].email; } else if (fs.Name == "lbl_fac13") { info.FS_pic = people.faculty[13].imagePath; info.FS_name = people.faculty[13].name; info.FS_title = people.faculty[13].title; info.FS_office = people.faculty[13].office; info.FS_phone = people.faculty[13].phone; info.FS_email = people.faculty[13].email; } else if (fs.Name == "lbl_fac14") { info.FS_pic = people.faculty[14].imagePath; info.FS_name = people.faculty[14].name; info.FS_title = people.faculty[14].title; info.FS_office = people.faculty[14].office; info.FS_phone = people.faculty[14].phone; info.FS_email = people.faculty[14].email; } else if (fs.Name == "lbl_fac15") { info.FS_pic = people.faculty[15].imagePath; info.FS_name = people.faculty[15].name; info.FS_title = people.faculty[15].title; info.FS_office = people.faculty[15].office; info.FS_phone = people.faculty[15].phone; info.FS_email = people.faculty[15].email; } else if (fs.Name == "lbl_fac16") { info.FS_pic = people.faculty[16].imagePath; info.FS_name = people.faculty[16].name; info.FS_title = people.faculty[16].title; info.FS_office = people.faculty[16].office; info.FS_phone = people.faculty[16].phone; info.FS_email = people.faculty[16].email; } else if (fs.Name == "lbl_fac17") { info.FS_pic = people.faculty[17].imagePath; info.FS_name = people.faculty[17].name; info.FS_title = people.faculty[17].title; info.FS_office = people.faculty[17].office; info.FS_phone = people.faculty[17].phone; info.FS_email = people.faculty[17].email; } else if (fs.Name == "lbl_fac18") { info.FS_pic = people.faculty[18].imagePath; info.FS_name = people.faculty[18].name; info.FS_title = people.faculty[18].title; info.FS_office = people.faculty[18].office; info.FS_phone = people.faculty[18].phone; info.FS_email = people.faculty[18].email; } else if (fs.Name == "lbl_fac19") { info.FS_pic = people.faculty[19].imagePath; info.FS_name = people.faculty[19].name; info.FS_title = people.faculty[19].title; info.FS_office = people.faculty[19].office; info.FS_phone = people.faculty[19].phone; info.FS_email = people.faculty[19].email; } else if (fs.Name == "lbl_fac20") { info.FS_pic = people.faculty[21].imagePath; info.FS_name = people.faculty[21].name; info.FS_title = people.faculty[21].title; info.FS_office = people.faculty[21].office; info.FS_phone = people.faculty[21].phone; info.FS_email = people.faculty[21].email; } else if (fs.Name == "lbl_fac21") { info.FS_pic = people.faculty[22].imagePath; info.FS_name = people.faculty[22].name; info.FS_title = people.faculty[22].title; info.FS_office = people.faculty[22].office; info.FS_phone = people.faculty[22].phone; info.FS_email = people.faculty[22].email; } else if (fs.Name == "lbl_fac22") { info.FS_pic = people.faculty[23].imagePath; info.FS_name = people.faculty[23].name; info.FS_title = people.faculty[23].title; info.FS_office = people.faculty[23].office; info.FS_phone = people.faculty[23].phone; info.FS_email = people.faculty[23].email; } else if (fs.Name == "lbl_fac23") { info.FS_pic = people.faculty[24].imagePath; info.FS_name = people.faculty[24].name; info.FS_title = people.faculty[24].title; info.FS_office = people.faculty[24].office; info.FS_phone = people.faculty[24].phone; info.FS_email = people.faculty[24].email; } else if (fs.Name == "lbl_fac24") { info.FS_pic = people.faculty[25].imagePath; info.FS_name = people.faculty[25].name; info.FS_title = people.faculty[25].title; info.FS_office = people.faculty[25].office; info.FS_phone = people.faculty[25].phone; info.FS_email = people.faculty[25].email; } else if (fs.Name == "lbl_fac25") { info.FS_pic = people.faculty[26].imagePath; info.FS_name = people.faculty[26].name; info.FS_title = people.faculty[26].title; info.FS_office = people.faculty[26].office; info.FS_phone = people.faculty[26].phone; info.FS_email = people.faculty[26].email; } else if (fs.Name == "lbl_fac26") { info.FS_pic = people.faculty[28].imagePath; info.FS_name = people.faculty[28].name; info.FS_title = people.faculty[28].title; info.FS_office = people.faculty[28].office; info.FS_phone = people.faculty[28].phone; info.FS_email = people.faculty[28].email; } else if (fs.Name == "lbl_fac27") { info.FS_pic = people.faculty[29].imagePath; info.FS_name = people.faculty[29].name; info.FS_title = people.faculty[29].title; info.FS_office = people.faculty[29].office; info.FS_phone = people.faculty[29].phone; info.FS_email = people.faculty[29].email; } else if (fs.Name == "lbl_fac28") { info.FS_pic = people.faculty[30].imagePath; info.FS_name = people.faculty[30].name; info.FS_title = people.faculty[30].title; info.FS_office = people.faculty[30].office; info.FS_phone = people.faculty[30].phone; info.FS_email = people.faculty[30].email; } else if (fs.Name == "lbl_fac29") { info.FS_pic = people.faculty[31].imagePath; info.FS_name = people.faculty[31].name; info.FS_title = people.faculty[31].title; info.FS_office = people.faculty[31].office; info.FS_phone = people.faculty[31].phone; info.FS_email = people.faculty[31].email; } else { info.FS_pic = people.faculty[32].imagePath; info.FS_name = people.faculty[32].name; info.FS_title = people.faculty[32].title; info.FS_office = people.faculty[32].office; info.FS_phone = people.faculty[32].phone; info.FS_email = people.faculty[32].email; } info.Show(); }