コード例 #1
0
        internal string CreateNewScenario(string newScenarioName, int countryId)
        {
            var scenarioExists = CheckScenarioExists(newScenarioName);

            if (scenarioExists != string.Empty)
            {
                return(scenarioExists);
            }

            var scenario = new MaxFleetFactorScenario
            {
                ScenarioName = newScenarioName,
                CountryId    = countryId
            };

            CreateScenario(scenario);

            return(string.Empty);
        }
コード例 #2
0
        internal string CloneExistingScenario(int existingScenarioId, string newScenarioName, int countryId)
        {
            var scenarioExists = CheckScenarioExists(newScenarioName);

            if (scenarioExists != string.Empty)
            {
                return(scenarioExists);
            }

            var scenario = new MaxFleetFactorScenario
            {
                ScenarioName = newScenarioName,
                CountryId    = countryId
            };

            CreateScenario(scenario);

            var newScenarioId = scenario.MaxFleetFactorScenarioId;

            DataContext.DuplicateMaxFleet(newScenarioId, existingScenarioId);

            return(string.Empty);
        }
コード例 #3
0
 private void CreateScenario(MaxFleetFactorScenario scenarioToCreate)
 {
     DataContext.MaxFleetFactorScenarios.InsertOnSubmit(scenarioToCreate);
     DataContext.SubmitChanges();
 }