예제 #1
0
        /// <summary>
        /// Install a New Agency
        /// </summary>
        /// <param name="implementation">The "State" Implementation relevant to the Agency.</param>
        /// <param name="name">Name of the Agency</param>
        /// <param name="ori">Federal Identifier for the Agency</param>
        /// <param name="classicRmsConnectionString">Connection string to the Classic RMS Database.</param>
        public static Guid Create(string implementation, string name, string ori, string classicRmsConnectionString)
        {
            Log.Info("Creating Agency: " + name + " - " + ori);
            Log.Info(Program.LineBreak);

            // Create a new Agency.
            var agencyId = CreateAgency(name, ori);

            // Create the Agency's Classic Integration Role
            ClassicIntegrationRole.Setup(agencyId);

            // Create the Default Workflow
            DefaultWorkflow.CreateInAgency(agencyId);

            // Install the TriTech Default Templates
            TriTechDefaultTemplates.Install(agencyId);

            // Install the Implementation Templates
            ImplementationTemplates.Install(agencyId, implementation);

            // Import Codes From Classic RMS
            SystemCodes.UpdateAgencyCodes(agencyId, classicRmsConnectionString);
            VehicleCodes.ImportIntoAgency(agencyId, classicRmsConnectionString);
            AgencyViolationCodes.ImportAgencyViolationCodes(agencyId, classicRmsConnectionString);
            AgencySystemConfigGlobal.UpdateAgencySettings(agencyId, classicRmsConnectionString);

            // Configuration
            AgencyDefaults.Apply(agencyId);

            return(agencyId);
        }