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

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

            var scenario = new MinCommercialSegmentScenario
            {
                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 MinCommercialSegmentScenario
            {
                ScenarioName = newScenarioName,
                CountryId    = countryId
            };

            CreateScenario(scenario);

            var newScenarioId = scenario.MinCommercialSegmentScenarioId;

            DataContext.DuplicateMinCommSeg(newScenarioId, existingScenarioId);

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