Beispiel #1
0
        private void linkLabelSortOrder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FormSumRange sr = new FormSumRange();

            if (sr.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var s = m_db.GetSeriesFromName(sr.SeriesName);
                if (s == null)
                {
                    MessageBox.Show("Error: The Series '" + sr.SeriesName + "' could not be found. Please check the spelling.  A short name without spaces works best.");
                    return;
                }

                s.Read();

                Series sum = Reclamation.TimeSeries.Math.AnnualSum(s, sr.MonthDayRange, 10);
                for (int i = 0; i < scenarioTable.Rows.Count; i++)
                {
                    int yr;
                    if (!Int32.TryParse(scenarioTable[i].Name, out yr))
                    {
                        MessageBox.Show("Error: The scenario name must be a year (integer) ");
                    }

                    YearRange yRange = new YearRange(yr, 10);
                    Series    sYear  = Reclamation.TimeSeries.Math.Subset(sum, yRange.DateTime1, yRange.DateTime2);

                    if (sYear.Count > 0)
                    {
                        scenarioTable[i].SortOrder = Convert.ToInt32(sYear[0].Value);
                        //scenarioTable[i].Path+=.Rows[i]["Note"] = sYear[0].Flag;
                    }
                }
                dataGridView.Columns["SortOrder"].Visible = true;
            }
        }
Beispiel #2
0
        private void linkLabelSortOrder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            FormSumRange sr = new FormSumRange();
            if (sr.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                var s = m_db.GetSeriesFromName(sr.SeriesName);
                if (s == null)
                {
                    MessageBox.Show("Error: The Series '"+sr.SeriesName +"' could not be found. Please check the spelling.  A short name without spaces works best.");
                    return;
                }

                s.Read();

                Series sum = Reclamation.TimeSeries.Math.AnnualSum(s, sr.MonthDayRange, 10);
                for (int i = 0; i < scenarioTable.Rows.Count; i++)
                {
                    int yr;
                    if (!Int32.TryParse(scenarioTable[i].Name, out yr))
                    {
                        MessageBox.Show("Error: The scenario name must be a year (integer) ");
                    }

                    YearRange yRange = new YearRange(yr, 10);
                    Series sYear = Reclamation.TimeSeries.Math.Subset(sum, yRange.DateTime1, yRange.DateTime2);

                    if (sYear.Count > 0)
                    {
                        scenarioTable[i].SortOrder = Convert.ToInt32(sYear[0].Value);
                        //scenarioTable[i].Path+=.Rows[i]["Note"] = sYear[0].Flag;
                    }
                }
                dataGridView.Columns["SortOrder"].Visible = true;

            }
        }