Example #1
0
        private void ClearLastSelection_Click(object sender, RoutedEventArgs e)
        {
            currentMitigationListBox.SelectedIndex = currentMitigationListBox.Items.Count - 1;
            int currentIterator = currentMitigationListBox.Items.Count - 1;

            currentMitigationListBox.SelectedItem = currentMitigationListBox.Items.Count - 1;

            if (currentMitigationListBox.SelectedIndex == -1)
            {
                BiMessageBox.Show("Delete Confirmation", "There Are No Items To Clear");
                return;
            }

            var MessageBoxResult =
                BiMessageBox.Show("Delete Confirmation", "Remove " + currentMitigationListBox.SelectedItem + "?", MessageBoxButton.YesNo);

            if (MessageBoxResult != MessageBoxResult.Yes)
            {
                return;
            }
            currentMitigationListBox.Items.RemoveAt(currentMitigationListBox.SelectedIndex);

            if (EValues.Count > 0)
            {
                EValues.RemoveAt(currentIterator);
            }

            if (MitigationSelection.Count > 0)
            {
                MitigationSelection.RemoveAt(currentIterator);
            }

            b.Visibility = Visibility.Visible; //maybe remove
            return;
        }
Example #2
0
        private void ClearSelection_Click(object sender, RoutedEventArgs e)
        {
            i = 0;
            if (currentMitigationListBox.Items.Count < 1)
            {
                BiMessageBox.Show("Delete Confirmation", "There Are No Items To Clear");
                return;
            }

            var MessageBoxResult =
                BiMessageBox.Show("Delete Confirmation", "Delete All Current Selections?", MessageBoxButton.YesNo);

            if (MessageBoxResult != MessageBoxResult.Yes)
            {
                return;
            }

            currentMitigationListBox.Items.Clear();
            EValues.Clear();
            MitigationSelection.Clear();
            mitigationDisplay.Children.Clear();

            foreach (var item in rdt)
            {
                mitigationDisplay.Children.Add(CreateButtons(rdt, i));
                i++;
            }
            return;
        }
Example #3
0
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //sessionEnd = DateTime.Now;
            //MiDEDataSetTableAdapters.ApplicationSessionsTableAdapter infoAdapter = new MiDEDataSetTableAdapters.ApplicationSessionsTableAdapter();
            //infoAdapter.UpdateQuery(sessionEnd, sessionStart, sessionStart);

            BiMessageBox.Show("Close MiDE?");
        }
Example #4
0
        private void ClearAllExclusion_Click(object sender, RoutedEventArgs e)
        {
            l = 0;
            m = 0;
            //Make sure exclusion box is not empty
            if (ExclusionListBox.Items.Count < 1)
            {
                BiMessageBox.Show("Delete Confirmation", "There Are No Items To Clear");
                return;
            }

            var MessageBoxResult =
                BiMessageBox.Show("Delete Confirmation", "Delete All Current Selections?", MessageBoxButton.YesNo);

            if (MessageBoxResult != MessageBoxResult.Yes)
            {
                return;
            }
            ExclusionListBox.Items.Clear();
            ExclusionBox.Clear();
            MitigationExclusion.Clear();
            strategyExclusionCB.Items.Clear();
            mitigationExclusionCB.Items.Clear();

            foreach (var item in ds.StrategyGroups())
            {
                StrategyExCB.Add(item.Value);     //ds.StrategyGroups.Rows[l][1].ToString());
                string comboboxtext = item.Value; //ds.StrategyGroups.Rows[l][1].ToString();
                strategyExclusionCB.Items.Add(comboboxtext);
                l++;
            }

            foreach (var item in ds.EValue())
            {
                StrategyExclusion.Add(item.EName); //ds.EValues.Rows[m][2].ToString());
                string comboboxtext = item.EName;  //ds.EValues.Rows[m][2].ToString();
                mitigationExclusionCB.Items.Add(comboboxtext);
                m++;
            }
            return;
        }
Example #5
0
        //Buttons for clearing boxed and handling click events
        private void ClearAllScenario_Click(object sender, RoutedEventArgs e)
        {
            //make sure the selection box is not empty
            if (SelectionListBox.Items.Count < 1)
            {
                BiMessageBox.Show("Delete Confirmation", "There Are No Items To Clear");
                return;
            }
            k = 0;

            var MessageBoxResult =
                BiMessageBox.Show("Delete Confirmation", "Delete All Current Selections?", MessageBoxButton.YesNo);

            if (MessageBoxResult != MessageBoxResult.Yes)
            {
                return;
            }
            SelectionListBox.Items.Clear();
            SelectionBox.Clear();
            SValues.Clear();
            SVariableExclusion.Clear();
            sFactorCB.Items.Clear();

            foreach (var item in ds.SValue())
            {
                string comboboxtext = item.Name;//ds.SValues.Rows[k][1].ToString();
                sFactorCB.Items.Add(comboboxtext);
                k++;
            }

            selectedVacatingBuildingCB.Text = "Select Building";
            selectedPopRangeCB.Text         = "Select Population Range";
            selectedPopTypeCB.Text          = "Select Population Type";
            selectBuildingCB.Text           = "Select Building";
            sFactorCB.Text          = "Compression Factors";
            datePicker.SelectedDate = null;
            return;
        }
Example #6
0
        //Navigate to next page
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            //The following if's check to make sure there are valid entries
            if (SelectionBox.Count == 0)
            {
                BiMessageBox.Show("There Are No Entries For This Scenario, Please Enter Some Scenario Variables");
                return;
            }

            if (selectedVacatingBuildingCB.SelectedIndex == -1)
            {
                var MessageBoxResult =
                    BiMessageBox.Show("No Selection Check", "There Is No Selection For a Vacating Building, Is That Correct?", MessageBoxButton.YesNo);
                if (MessageBoxResult != MessageBoxResult.Yes)
                {
                    return;
                }
            }
            if (selectedPopRangeCB.SelectedIndex == -1)
            {
                var MessageBoxResult =
                    BiMessageBox.Show("No Selection Check", "There Is No Selection For a Population Range, Is That Correct?", MessageBoxButton.YesNo);
                if (MessageBoxResult != MessageBoxResult.Yes)
                {
                    return;
                }
            }
            if (selectedPopTypeCB.SelectedIndex == -1)
            {
                var MessageBoxResult =
                    BiMessageBox.Show("No Selection Check", "There Is No Selection For a Population Type, Is That Correct?", MessageBoxButton.YesNo);
                if (MessageBoxResult != MessageBoxResult.Yes)
                {
                    return;
                }
            }
            if (selectBuildingCB.SelectedIndex == -1)
            {
                var MessageBoxResult =
                    BiMessageBox.Show("No Selection Check", "There Is No Selection For What Building The Population Is Moving To, Is That Correct?", MessageBoxButton.YesNo);
                if (MessageBoxResult != MessageBoxResult.Yes)
                {
                    return;
                }
            }
            if (datePicker.SelectedDate == null)
            {
                var MessageBoxResult =
                    BiMessageBox.Show("No Selection Check", "There Is No Selection For When This Scenario Will Start, Please Enter a Date");
                return;
            }

            //Check to see if there budget throttle is applied
            if (Throttle == 1 && !(SelectionBox.Contains(BudgetThrottleText)))
            {
                BudgetThrottleText = "There are Budget Considerations";
                SelectionBox.Add(BudgetThrottleText);
            }

            SValuesSum  = SValues.Sum();
            isThrottled = Throttle;

            NavigationService.Navigate(
                new Uri("Pages/MiDESelection.xaml", UriKind.Relative));
        }