示例#1
0
        private void btnScenario_Click(object sender, EventArgs e)
        {
            getValues();
            DialogResult dialogResult = MessageBox.Show("This will create a Cost Scenario with the Current Values, Continue?", "Create Cost Scenario", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.No)
            {
                return;
            }

            CostScenario c = Globals.Project.createNewCostScenario();

            c.CreateFromBMP(bmp);

            MessageBox.Show("A new Cost Scenario has been created with the ID: " + c.id.ToString());
            tbScenarioName.Enabled        = true;
            tbScenarioDescription.Enabled = true;
        }
示例#2
0
        void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            // If not Edit button - ignore click
            if (e.RowIndex < 0 || e.ColumnIndex != dataGridView1.Columns["btnEdit"].Index)
            {
                return;
            }

            try
            {
                int          i   = Convert.ToInt32(dataGridView1[0, e.RowIndex].Value); // Cost Scenario ID
                CostScenario cs  = Globals.Project.getCostScenario(i);                  // Cost Scenario
                BMP          bmp = Globals.Project.getBMP(cs.CatchmentID, cs.BMPType);

                Form form = new frmCostAnalysis(bmp);
                form.ShowDialog();
            }
            catch
            {
                return;
            }

            DisplayScenarios();
        }
示例#3
0
        private void PlotCost(string CostType)
        {
            CostScenario c = new CostScenario();

            chart1.Series.Clear();
            chart1.Titles.Clear();

            chart1.Titles.Add("Cost Scenario");
            chart1.Titles[0].Text = "Plot of " + c.PropertyLabels()[CostType];

            // Data arrays
            string[] seriesArray = Globals.Project.CostScenarioNames();
            double[] pointsArray = Globals.Project.CostScenarioValues(CostType);

            // Set palette
            this.chart1.Palette = ChartColorPalette.EarthTones;

            // Add series.
            for (int i = 0; i < seriesArray.Length; i++)
            {
                Series series = this.chart1.Series.Add(seriesArray[i]);
                series.Points.Add(pointsArray[i]);
            }
        }