//Constuctor loads navbar public AdminHome() { InitializeComponent(); NavBar frmNavBar = new NavBar("Administrator"); LoadFormIntoPanel.load(pnlNav, frmNavBar); }
private void btnAddClub_Click(object sender, EventArgs e) { AdminAddEdit frmAddClub = new AdminAddEdit(); LoadFormIntoPanel.load(pnlContainer, frmAddClub); //lblSubPageTitle.Text = "Add New Club"; }
public RepHome(string user) { InitializeComponent(); NavBar frmNavBar = new NavBar("Representative"); LoadFormIntoPanel.load(pnlNav, frmNavBar); string queryShowClubInfo = "SELECT ClubName, ClubDescription, ClubPresident, ClubVice, ClubSecretary, ClubSecretaryID, ClubEstablished FROM CLUB" + " WHERE ClubSecretaryID='" + user + "'"; try { con.Open(); SqlCommand cmd = new SqlCommand(queryShowClubInfo, con); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { lblClubName.Text = (dr["ClubName"].ToString()); txtClubDescription.Text = (dr["ClubDescription"].ToString()); lblPresident.Text = (dr["ClubPresident"].ToString()); lblVice.Text = (dr["ClubVice"].ToString()); lblSecretary.Text = (dr["ClubSecretary"].ToString()); lblEstablished.Text = (dr["ClubEstablished"].ToString()); } con.Close(); ShowPastUpdates(); } catch (Exception ex) { MessageBox.Show("Error:" + ex.Message, "Failed to retrieve club data"); } }
public StudentHome() { InitializeComponent(); NavBar frmNavBar = new NavBar("Student"); LoadFormIntoPanel.load(pnlNav, frmNavBar); PopulateListbox("SELECT ClubName FROM CLUB WHERE ClubStatus=1"); dynamicPanel.Visible = false; //retrieve clubnames & show them inside list box }
private void btnEdit_Click(object sender, EventArgs e) { try { AdminAddEdit frmEditClub = new AdminAddEdit(lstClubs.SelectedItems[0].Text); LoadFormIntoPanel.load(pnlContainer, frmEditClub); //lblSubPageTitle.Text = "Edit Club"; } catch (Exception ex) { MessageBox.Show("Please select a club to edit", ex.Message); } }
private void btnGenActivityList_Click(object sender, EventArgs e) { AdminReports frmReports = new AdminReports("updates"); LoadFormIntoPanel.load(pnlContainer, frmReports); }