예제 #1
0
        /// <summary>
        /// Scenario is defined by the workbook and worksheet names
        /// </summary>
        public void LoadScenarios()
        {
            m_db.ClearScenarios();
            var table = m_db.GetScenarios();

            int i = 0;

            foreach (var pct in UrgwomForecastLevels)
            {
                foreach (var month in UrgwomMonths)
                {
                    int year  = UrgwonStartYear;
                    int count = UrgwomEndYear - UrgwonStartYear + 1;
                    for (int run = 0; run < count; run++)
                    {
                        string fn = CreateFileName(excelFilename, month, pct);

                        var connectionString = "Year=" + year + ";Month=" + month + ";Percent=" + pct + ";FileName=" + fn + ";SheetName=" + "Run" + run;
                        connectionString = ConnectionStringUtility.MakeFileNameRelative(connectionString, m_db.DataSource);
                        table.AddScenarioRow(month + " " + pct + "% " + year, i < 2, connectionString, 0);
                        i++;
                        year++;
                    }
                }
            }
            m_db.Server.SaveTable(table);
        }