Пример #1
0
        /// <summary>
        /// Base Contructor for all Public Safety Aggregates
        /// </summary>
        protected PublicSafetyAggregate(Guid identityId, Guid agencyId, Guid id, ModuleType moduleType, DataEntryAggregateType aggregateType)
            : base(identityId, agencyId, id)
        {
            if (moduleType == ModuleType.Unset)
            {
                throw new ArgumentException("Public Safety Records require a valid Module Type.", "moduleType");
            }
            if (!moduleType.IsPublicSafetyRecord())
            {
                throw new Exception("Module is not a Public Safety Record Module.");
            }
            if (aggregateType == DataEntryAggregateType.Unset)
            {
                throw new Exception("AggregateType must be provided.");
            }

            ModuleType    = moduleType;
            AggregateType = aggregateType;
        }
Пример #2
0
        protected ReportCommandServiceBase(
            IReportsUnitOfWork unitOfWork,
            IWorkflowInstanceService workflowInstanceService,
            ITemplateProvider templateProvider,
            ILog log,
            ModuleType reportModule,
            IServiceAuthorizationPolicy authorizationPolicy,
            IServiceIdentityProvider identityProvider)
            : base(unitOfWork, log, authorizationPolicy, identityProvider)
        {
            if (!reportModule.IsPublicSafetyRecord())
            {
                throw new ImplementationException(
                          "The [{0}] module does not support Reports.",
                          reportModule);
            }

            CheckDependency(templateProvider, "templateProvider");
            CheckDependency(workflowInstanceService, "workflowInstanceService");

            TemplateProvider        = templateProvider;
            WorkflowInstanceService = workflowInstanceService;
            ReportModule            = reportModule;
        }