Esempio n. 1
0
        private void resizeMainPanel(Panel panel)
        {
            Reposition.setControl(panel, BUTTON_PANEL_WIDTH, .95, .1, .95);
            //fetches method for seting up the panel from dictionary
            setupDelegate setupMethod;

            setupPanels.TryGetValue(panel, out setupMethod);
            setupMethod();
        }
Esempio n. 2
0
        public void setupAdminPnl()
        {
            //fill the data tables with info
            if (isFirstSetup)
            {
                try
                {
                    admin1Data.DataSource = EmployeesTable.getAll();
                    admin1Data.Columns["password"].Visible = false;
                    admin1Data.Columns["deleted"].Visible  = false;

                    admin2Data.DataSource = CustomersTable.getAll();
                    admin2Data.Columns["deleted"].Visible = false;

                    admin3Data.DataSource = MoviesTable.getAll();
                    admin3Data.Columns["deleted"].Visible = false;
                    sortBy(admin3Data, 1, true);

                    admin4Data.DataSource = CopiesTable.getAll();
                    admin4Data.Columns["deleted"].Visible = false;
                    sortBy(admin4Data, 0, true);
                }catch
                {
                    EmployeesTable.adapter.Dispose();
                    CustomersTable.adapter.Dispose();
                    MoviesTable.adapter.Dispose();
                    CopiesTable.adapter.Dispose();
                    Prompt.dbError();
                }
            }

            Reposition.setControl(adminTitleLbl, .4, .7, 0, .1);

            Reposition.setControl(adminTab, .1, .9, .1, .9);

            Reposition.setNestedControlPosition(admin1Data, .05, .95, 0, .8);
            Reposition.setNestedControlPosition(admin2Data, .05, .95, 0, .8);
            Reposition.setNestedControlPosition(admin3Data, .05, .95, 0, .8);
            Reposition.setNestedControlPosition(admin4Data, .05, .95, 0, .8);

            //user Buttons
            Reposition.setNestedControlLocation(admin1Btn, .1, .85);
            Reposition.setNestedControlLocation(adminPasswordBtn, .4, .85);
            Reposition.setNestedControlLocation(admin2Btn, .7, .85);

            //customer buttons
            Reposition.setNestedControlLocation(admin3Btn, .3, .85);
            Reposition.setNestedControlLocation(admin4Btn, .6, .85);

            //movie buttons
            Reposition.setNestedControlLocation(admin5Btn, .3, .85);
            Reposition.setNestedControlLocation(admin6Btn, .6, .85);

            //upc buttons
            Reposition.setNestedControlLocation(admin7Btn, .3, .85);
            Reposition.setNestedControlLocation(admin8Btn, .6, .85);
        }
Esempio n. 3
0
        public void setupLoginForm()
        {
            double endOfText;
            double endOfLabels;

            endOfLabels = Reposition.setLabels(0.2, login1Lbl, login2Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, login1Txt, login2Txt);

            Reposition.setControlLocation(login1Btn, .4, endOfText);
        }
Esempio n. 4
0
        public void setupRent2Pnl()
        {
            double endOfText;
            double endOfLabels;

            Reposition.setTitle(rentTitle2Lbl);

            endOfLabels = Reposition.setLabels(0.2, rent2Lbl, rent3Lbl, rent4Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, rent2Txt, rent3Txt, rent4Txt);

            Reposition.setControlLocation(rent2Btn, 0.4, endOfLabels);
        }
Esempio n. 5
0
        public void setupRemoveUserPnl()
        {
            double endOfText;
            double endOfLabels;

            Reposition.setTitle(removeUserTitleLbl);

            endOfLabels = Reposition.setLabels(0.2, removeUser1Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, removeUser1Txt);

            Reposition.setControlLocation(removeUser1Btn, .4, endOfText + 0.1);
        }
Esempio n. 6
0
        public void setupPasswordPnl()
        {
            Panel  panel = passwordPnl;
            double endOfText;
            double endOfLabels;

            Reposition.setTitle(passwordTitleLbl);
            endOfLabels = Reposition.setLabels(0.2, password1Lbl, password2Lbl, password3Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, password1Txt, password2Txt, password3Txt);

            Reposition.setControlLocation(password1Btn, .4, endOfText);
        }
Esempio n. 7
0
        /// <summary>
        /// Sets the position of all components within the new customer panel based on percent relative locations
        /// </summary>
        public void setupNewCustomerPnl()
        {
            double endOfText;
            double endOfLabels;

            Reposition.setTitle(newCustomerTitleLbl);

            endOfLabels = Reposition.setLabels(0.2, newCustomer1Lbl, newCustomer2Lbl, newCustomer3Lbl, newCustomer4Lbl, newCustomer5Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, newCustomer1Txt, newCustomer2Txt, newCustomer3Txt, newCustomer4Txt, newCustomer5Txt);

            Reposition.setControlLocation(newCustomer1Btn, .4, endOfText);
        }
Esempio n. 8
0
        public void setupAddUserPnl()
        {
            double endOfText;
            double endOfLabels;

            Reposition.setTitle(addUserTitleLbl);
            endOfLabels = Reposition.setLabels(0.2, addUser1Lbl, addUser2Lbl, addUser3Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, addUser1Txt, addUser2Txt, addUser3Txt);

            Reposition.setControlLocation(addUserRdb, .4, endOfText);
            Reposition.setControlLocation(addUserBtn, .4, endOfText + 0.1);
        }
Esempio n. 9
0
        public void setupAddMoviePnl()
        {
            double endOfText;
            double endOfLabels;

            Reposition.setTitle(addMovieTitleLbl);

            endOfLabels = Reposition.setLabels(0.2, addMovie1Lbl, addMovie2Lbl, addMovie3Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, addMovie1Txt, addMovie2Txt, addMovie3Txt);

            Reposition.setControlLocation(addMovie1Btn, .4, endOfText);
        }
Esempio n. 10
0
        public void setupLoginForm()
        {
            double endOfText;
            double endOfLabels;

            Reposition.setControlLocation(loginTitleLbl, .3, .2);
            Reposition.setControlLocation(loginPic, .7, .1);

            endOfLabels = Reposition.setLabels(0.4, usernameLbl, passwordLbl);
            endOfText   = Reposition.setTextBoxes(0.4, usernameTxt, passwordTxt);

            Reposition.setControlLocation(loginBtn, .4, endOfText);
        }
Esempio n. 11
0
        public void setupReportsPnl()
        {
            if (isFirstSetup)
            {
                try
                {
                    reports1Data.DataSource = MoviesTable.getAll();
                    reports1Data.Columns["deleted"].Visible = false;
                    sortBy(reports1Data, 5, false);

                    reports2Data.DataSource = CustomersTable.getAll();
                    reports2Data.Columns["deleted"].Visible = false;
                    sortBy(reports2Data, 7, false);

                    reports3Data.DataSource = MoviesTable.getAll();
                    reports3Data.Columns["deleted"].Visible = false;
                    sortBy(reports3Data, 1, true);

                    reports4Data.DataSource = RentalsTable.getNotReturned();
                    reports4Data.Columns["returned"].Visible = false;
                    sortBy(reports4Data, 4, true);

                    reports5Data.DataSource = RentalsTable.getLateMovies();
                    reports5Data.Columns["returned"].Visible = false;
                    sortBy(reports5Data, 4, true);

                    reports6Data.DataSource = CopiesTable.getAll();
                    reports6Data.Columns["deleted"].Visible = false;
                    sortBy(reports6Data, 0, true);
                }catch
                {
                    CustomersTable.adapter.Dispose();
                    MoviesTable.adapter.Dispose();
                    RentalsTable.adapter.Dispose();
                    CopiesTable.adapter.Dispose();
                    Prompt.dbError();
                }
            }

            Reposition.setControl(reportsTitleLbl, .4, .7, 0, .1);

            Reposition.setControl(reportsTab, .1, .9, .1, .9);

            Reposition.setNestedControlPosition(reports1Data, .05, .95, 0, 1);
            Reposition.setNestedControlPosition(reports2Data, .05, .95, 0, 1);
            Reposition.setNestedControlPosition(reports3Data, .05, .95, 0, 1);
            Reposition.setNestedControlPosition(reports4Data, .05, .95, 0, 1);
            Reposition.setNestedControlPosition(reports5Data, .05, .95, 0, 1);
            Reposition.setNestedControlPosition(reports6Data, .05, .95, 0, 1);
        }
Esempio n. 12
0
        public void setupRentPnl()
        {
            double endOfText;
            double endOfLabels;

            setEnterKey(rent1Btn);

            Reposition.setTitle(rentTitleLbl);

            endOfLabels = Reposition.setLabels(0.2, checkout1Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, checkout1Txt);

            Reposition.setControlLocation(rent1Btn, .4, endOfText);
        }
Esempio n. 13
0
        public void setupRemoveCopyPnl()
        {
            double endOfText;
            double endOfLabels;

            setEnterKey(removeCopy1Btn);

            Reposition.setTitle(removeCopyTitleLbl);

            endOfLabels = Reposition.setLabels(0.2, removeCopy1Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, removeCopy1Txt);

            Reposition.setControlLocation(removeCopy1Btn, .4, endOfText);
        }
Esempio n. 14
0
        /*
         * ----------------------------------------------------------------------------------------------
         * Part 5: Panel Setup Methods
         * ----------------------------------------------------------------------------------------------
         */

        public void setupAddCopyPnl()
        {
            double endOfText;
            double endOfLabels;

            setEnterKey(addCopy1Btn);

            Reposition.setTitle(addCopyTitleLbl);

            endOfLabels = Reposition.setLabels(0.2, addCopy1Lbl, addCopy2Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, addCopy1Txt, addCopy2Txt);

            Reposition.setControlLocation(addCopy1Btn, .4, endOfText);
        }
Esempio n. 15
0
        public void setupReturnPnl()
        {
            Panel  panel = returnPnl;
            double endOfText;
            double endOfLabels;

            setEnterKey(return1Btn);

            Reposition.setControl(returnTitleLbl, .4, .7, 0, .1);

            endOfLabels = Reposition.setLabels(0.2, return1Lbl);
            endOfText   = Reposition.setTextBoxes(0.2, return1Txt);

            Reposition.setControlLocation(return1Btn, .4, endOfText);
        }
Esempio n. 16
0
        /// <summary>
        /// Sets the position of all components within the form based on percent relative locations
        /// </summary>
        private void resizePage()
        {
            Reposition.setControl(mainButtonPnl, 0, BUTTON_PANEL_WIDTH, .1, .95);

            resizeMainPanel(currentMainPanel);

            if (currentUser.isAdmin())
            {
                Button[] mainButtons = { rentBtn, returnBtn, reportsBtn, adminBtn };
                Reposition.setVertically(mainButtons, mainButtonPnl);
            }
            else
            {
                Button[] mainButtons = { rentBtn, returnBtn, reportsBtn, newCustomerBtn };
                Reposition.setVertically(mainButtons, mainButtonPnl);
            }
        }