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); }
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); }
private void CreateScenario(MinCommercialSegmentScenario scenarioToCreate) { DataContext.MinCommercialSegmentScenarios.InsertOnSubmit(scenarioToCreate); DataContext.SubmitChanges(); }