Пример #1
0
        //Constuctor loads navbar
        public AdminHome()
        {
            InitializeComponent();
            NavBar frmNavBar = new NavBar("Administrator");

            LoadFormIntoPanel.load(pnlNav, frmNavBar);
        }
Пример #2
0
        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");
            }
        }
Пример #3
0
        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
        }