Exemple #1
0
        private void btn_LoadClient_Click(object sender, EventArgs e)
        {
            resetCal();
            clientInstance.Dispose();

            clientInstance = new uc_Clients();

            pnl_Home.Controls.Add(clientInstance);
            clientInstance.Dock = DockStyle.Fill;
            clientInstance.BringToFront();
            clientInstance.Show();
        }
Exemple #2
0
        // Below Possibly be replaced with custom uc version if we have the time !!!
        private void buttonUp(PictureBox buttonName)
        {
            switch (buttonName.Name)
            {
            case "btnHome":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Buttonh_bUp;
                // Reset Calendar and clear controls
                resetCal();
                clearControls();
                scheduleClicked = false;
                //*************************************************************************

                break;

            case "btnSch":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Button_calup;
                //Reset Calendar
                resetCal();
                Cal_Month.Enabled = true;     // should I only ,make calendar available in schedule ?????
                updateSched();
                scheduleClicked = true;
                break;

            case "btnSales":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Button_salesup;
                break;

            case "btnStock":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Button_stockup;
                //Reset Calendar and dispose of running Instance
                resetCal();
                stockInstance.Dispose();
                //Redo updated instance and populate Panel
                stockInstance = new uc_Stock();
                pnl_Home.Controls.Add(stockInstance);
                stockInstance.Dock = DockStyle.Fill;
                stockInstance.BringToFront();
                stockInstance.Show();
                break;

            case "btnClients":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Button_clientsup;
                //Reset Calendar and dispose of running Instance
                resetCal();
                clientInstance.Dispose();
                //Redo updated instance and populate Panel
                clientInstance = new uc_Clients();
                pnl_Home.Controls.Add(clientInstance);
                clientInstance.Dock = DockStyle.Fill;
                clientInstance.BringToFront();
                clientInstance.Show();
                break;

            case "btnUsers":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Button_userup;
                //Reset Calendar and dispose of running Instance
                resetCal();
                userInstance.Dispose();
                //Redo updated instance and populate Panel
                userInstance = new uc_Users();
                pnl_Home.Controls.Add(userInstance);
                userInstance.Dock = DockStyle.Fill;
                userInstance.BringToFront();
                userInstance.Show();
                break;

            case "btnReports":
                //Update Button Picture
                buttonName.Image = Properties.Resources.Round_Button_reportup;
                break;

            default:
                MessageBox.Show("Nothing Was Clicked !");     // shows button clicked
                break;
            }
        }