コード例 #1
0
        private void toolBar1_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            switch (toolBar1.Buttons.IndexOf(e.Button))
            {
            case 0:
                frmAnonCust fAnon = new frmAnonCust();
                fAnon.MdiParent = this;
                fAnon.Show();
                break;

            case 1:
                frmAutoMan fAuto = new frmAutoMan();
                fAuto.MdiParent = this;
                fAuto.Show();
                break;

            case 5:
                frmDaily fDaily = new frmDaily();
                fDaily.MdiParent = this;
                fDaily.Show();
                break;

            case 2:
                frmSolutionStatus fSol = new frmSolutionStatus();
                fSol.MdiParent = this;
                fSol.Show();
                break;

            case 3:
                frmWeekly fWeekly = new frmWeekly();
                fWeekly.MdiParent = this;
                fWeekly.Show();
                break;

            case 7:
                frmExport fExp = new frmExport();
                fExp.ShowDialog(this);
                break;

            case 9:
                frmLocation fLoc = new frmLocation();
                fLoc.ShowDialog(this);
                break;

            case 16:
                frmAbout fAbout = new frmAbout();
                fAbout.ShowDialog(this);
                break;

            case 13:
                OneTouch();
                break;

            case 11:
                if (this.ActiveMdiChild.Name == "frmWeekly")
                {
                    frmWeekly oWeekly = (frmWeekly)this.ActiveMdiChild;
                    oWeekly.GetData();
                }
                else if (this.ActiveMdiChild.Name == "frmDaily")
                {
                    frmDaily oDaily = (frmDaily)this.ActiveMdiChild;
                    oDaily.GetData();
                }
                else if (this.ActiveMdiChild.Name == "frmAnonCust")
                {
                    frmAnonCust oAnonCust = (frmAnonCust)this.ActiveMdiChild;
                    oAnonCust.GetData();
                }
                else if (this.ActiveMdiChild.Name == "frmAutoMan")
                {
                    frmAutoMan oAutoMan = (frmAutoMan)this.ActiveMdiChild;
                    oAutoMan.GetData();
                }
                else if (this.ActiveMdiChild.Name == "frmSolutionStatus")
                {
                    frmSolutionStatus oSolutionStatus = (frmSolutionStatus)this.ActiveMdiChild;
                    oSolutionStatus.GetData();
                }
                break;
            }
        }
コード例 #2
0
        private void mnuOptions_Click(object sender, System.EventArgs e)
        {
            frmLocation fLoc = new frmLocation();

            fLoc.ShowDialog(this);
        }
コード例 #3
0
        /*************************************************************************************
        *	module: frmWeekly.cs - GetData
        *
        *	author: Tim Ragain
        *	date: Jan 22, 2002
        *
        *	Purpose: Initializes the threads.  Appropriately sets the legend of the calendar control,
        *	initializes the progress bar, disables the cmdGetData button.  Initializes each
        *	column on the calendar to the appropriated days.  New ThreadStart delegate is created
        *	and each delegate is set to the appropriate day from the end date.  All threads are then
        *	started.
        *************************************************************************************/
        public void GetData()
        {
            System.DateTime dDate = new System.DateTime(monthCalendar1.SelectionStart.Year, monthCalendar1.SelectionStart.Month,
                                                        monthCalendar1.SelectionStart.Day);
            RegistryKey regArchive = Registry.CurrentUser.OpenSubKey("software").OpenSubKey("microsoft", true).CreateSubKey("OCATools").CreateSubKey("OCAReports").CreateSubKey("Archive");
            RegistryKey regWatson  = Registry.CurrentUser.OpenSubKey("software").OpenSubKey("microsoft", true).CreateSubKey("OCATools").CreateSubKey("OCAReports").CreateSubKey("Watson");

            bIsStillProcessing = true;
            try
            {
                if (regArchive.GetValue("Loc0").ToString().Length == 0)
                {
                    frmLocation fLoc = new frmLocation();
                    fLoc.ShowDialog(this);
                }
            }
            catch
            {
                frmLocation fLoc = new frmLocation();
                fLoc.ShowDialog(this);
            }
            try
            {
                if (regWatson.GetValue("Loc0").ToString().Length == 0)
                {
                    frmLocation fLoc = new frmLocation();
                    fLoc.ShowDialog(this);
                }
            }
            catch
            {
                frmLocation fLoc = new frmLocation();
                fLoc.ShowDialog(this);
            }
//			cmdGetData.Enabled = false;
            progressBar1.Visible = true;
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 22;
            progressBar1.Value   = 0;
            progressBar1.Visible = true;
            progressBar1.Refresh();
            axMSChart1.ShowLegend = true;
            axMSChart1.Plot.SeriesCollection[1].LegendText = "Database";
            axMSChart1.Plot.SeriesCollection[2].LegendText = "Watson";
            axMSChart1.Plot.SeriesCollection[3].LegendText = "Archive";

            ThreadStart s_DayOne = new ThreadStart(this.TDayOne);

            t_DayOne      = new Thread(s_DayOne);
            t_DayOne.Name = "Thread One";

            ThreadStart s_DayTwo = new ThreadStart(this.TDayTwo);

            t_DayTwo      = new Thread(s_DayTwo);
            t_DayTwo.Name = "Thread Two";

            ThreadStart s_DayThree = new ThreadStart(this.TDayThree);

            t_DayThree      = new Thread(s_DayThree);
            t_DayThree.Name = "Thread Three";

            ThreadStart s_DayFour = new ThreadStart(this.TDayFour);

            t_DayFour      = new Thread(s_DayFour);
            t_DayFour.Name = "Thread Four";

            ThreadStart s_DayFive = new ThreadStart(this.TDayFive);

            t_DayFive      = new Thread(s_DayFive);
            t_DayFive.Name = "Thread Five";

            ThreadStart s_DaySix = new ThreadStart(this.TDaySix);

            t_DaySix      = new Thread(s_DaySix);
            t_DaySix.Name = "Thread Six";

            ThreadStart s_DaySeven = new ThreadStart(this.TDaySeven);

            t_DaySeven      = new Thread(s_DaySeven);
            t_DaySeven.Name = "Thread Seven";
            //WaitForSingleObject(tSeven, -1);


            t_DayOne.Start();
            t_DayTwo.Start();
            t_DayThree.Start();
            t_DayFour.Start();
            t_DayFive.Start();
            t_DaySix.Start();
            t_DaySeven.Start();

            statusBar1.Text = "Done";
        }