public StudentRecord()
        {
            InitializeComponent();


            LabelUsername.Text = user.Username;
            LabelUserId.Text   = user.Id.ToString();


            // hide admin panel / content
            if (!isAdmin)
            {
            }



            //inits
            ws     = new WebService.WebService();
            dtFunc = new DTFunc();

            //DataGridViewMediaLibary.DataSource = userLogic.getAllUsers();
            //DataGridViewBookingHistory.DataSource = borrowLogic.getByUserForUserHistory(user.Id);
            //DataGridViewReservedHistory.DataSource = reservedLogic.getReservedHistory(user.Id);

            //DataGridViewMediaLibary.DataSource = ws.GetAllUsers();
            DataGridViewBookingHistory.DataSource  = ws.GetByUserForUserHistory(user.Id);
            DataGridViewReservedHistory.DataSource = ws.getReservedHistory(user.Id);
        }
        public Login()
        {
            InitializeComponent();

            BtnCheatLoggin.Visible     = true;
            ChkBoxIsAdminCheat.Visible = true;


            ws     = new WebService.WebService();
            dtFunc = new DTFunc(); //my class to work with dataTables
        }
Exemplo n.º 3
0
        public EditMediaLibary()
        {
            InitializeComponent();

            // connection inits
            ws     = new WebService.WebService();
            dtFunc = new DTFunc();

            //connect all dataGrids and show
            getAndShowDataGridViews();
        }
Exemplo n.º 4
0
        public StudentSettings()
        {
            InitializeComponent();

            LabelUsername.Text = user.Username;
            LabelUserId.Text   = user.Id.ToString();

            // hide admin panel / content
            if (!isAdmin)
            {
                PanelAdmin.Visible = false;
            }

            //inits connection
            ws     = new WebService.WebService();
            dtFunc = new DTFunc();
        }
        public SignUp()
        {
            InitializeComponent();

            PanelSignUpAdmin.Visible = false;

            // check if I have a user set
            // if true check if its admin
            // if not admin return to main menu
            if (currentUser != null)
            {
                if (currentUser.Userlevel != 1)
                {
                    PanelSignUpAdmin.Visible = true;
                    isAdmin = true;
                }
                else
                {
                    // they should not be able to get here once logged in unless they are an admin

                    //for more details go to STUDENT SETTINGS return btn method
                    Form mainform = Application.OpenForms["MainMenu"];

                    //reset signUp pg class vars
                    resetSignUpPgAdminStatus();

                    if (mainform != null)  //does not yet exist
                    {
                        mainform.Show();
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show("Your logged in but somehow have gotten to sign up page but not gone through mainMenu?");
                    }
                }
            }

            //get connection to db / logic
            //userLogic = new UserLogic();
            ws     = new WebService.WebService();
            dtFunc = new DTFunc();
        }
Exemplo n.º 6
0
        public StudentActivity()
        {
            InitializeComponent();

            LabelUsername.Text = user.Username;
            LabelUserId.Text   = user.Id.ToString();


            // hide admin panel / content
            if (!isAdmin)
            {
            }

            // init connection
            ws     = new WebService.WebService();
            dtFunc = new DTFunc();

            // get data for DGV's
            setDataForDataGridViews();
        }
        public DataGridViewRow activeMediaViewRow = null; //init as no row selected

        public MainMenu()
        {
            InitializeComponent();

            if (currentUser.Userlevel != 1)   // check if user is admin
            {
                isAdmin = true;
            }

            if (!isAdmin)    // depending on user level show different content
            {
                LabelStudentUsername.Text  = currentUser.Username;
                LabelStudentId.Text        = currentUser.Id.ToString();
                LabelAdminUsername.Visible = false;

                PanelMediaLibaryAdminBtns.Visible       = false;
                PanelStudentRowShowAdminContent.Visible = false;
            }
            else
            {
                LabelAdminUsername.Text = "Admin: " + currentUser.Username;
                PanelStudentRowShowStudentContent.Visible = false;
            }



            //inits
            dtFunc = new DTFunc();
            ws     = new WebService.WebService();


            //show all media
            // set data  source for data grid view
            // In this case a List<media>


            //DataGridViewMediaLibary.DataSource = mediaLogic.getAllMedia();
            DataGridViewMediaLibary.DataSource = ws.getAllMedia();
        }