Esempio n. 1
0
 private void sureBtn_Click(object sender, EventArgs e)
 {
     if (tacticalCheck.Checked && !maintenanceCheck.Checked)
     {
         this.Hide();
         var frm = new TacticalScenarios();
         frm.Show();
     }
     else if (!tacticalCheck.Checked && maintenanceCheck.Checked)
     {
         this.Hide();
         var frm = new MaintenanceControlSystem();
         frm.Show();
     }
     else if (!tacticalCheck.Checked && !maintenanceCheck.Checked)
     {
         {
             this.checkMsg.Text    = "Please check . . . ";
             this.checkMsg.Visible = true;
         }
     }
     else
     {
         this.checkMsg.Text    = "check ONLY ONE. . . ";
         this.checkMsg.Visible = true;
     }
 }
        // Restart (New Scenario)
        private void button1_Click(object sender, EventArgs e)
        {
            var frmMCS = new MaintenanceControlSystem();

            this.Hide();
            frmMCS.Show();
        }
 private void SystemAdjustments_KeyDown(object sender, KeyEventArgs key)
 {
     switch (key.KeyCode)
     {
     case Keys.Escape:
     {
         this.Hide();
         frmMCS.Show();
         break;
     }
     }
 }
        private void button1_Click(object sender, EventArgs e)
        {
            if ((this.button1.Text == "Update") && (comboBox1.SelectedIndex > -1 || comboBox2.SelectedIndex > -1 || comboBox3.SelectedIndex > -1))
            {
                this.button1.Text = "Validate";
                this.label4.Text  = null;
            }
            else if (this.button1.Text == "Validate")
            {
                if (mainScen.getProblem() == 3 || mainScen.getProblem() == 4)
                {
                    if (comboBox1.SelectedIndex < 4)                     // TWT1 Serial Numbers
                    {
                        mainScen.solveProblem();
                    }
                }
                else if (mainScen.getProblem() == 5 || mainScen.getProblem() == 6)
                {
                    if (comboBox1.SelectedIndex > 3)                      // TWT2 Serial Numbers
                    {
                        mainScen.solveProblem();
                    }
                }
                else if (mainScen.getProblem() == 8 && comboBox3.SelectedIndex > 3)    // index 4 and above are CCAs after implementation
                {
                    mainScen.solveProblem();
                }

                else if (mainScen.getProblem() > 10 && comboBox2.SelectedIndex > -1)   // all Power Supplies are similar
                {
                    mainScen.solveProblem();
                }

                this.Hide();
                frmMCS.Show();
            }
        }