Пример #1
0
        public IAuthorizationValidator CreateValidator()
        {
            IAuthorizationValidator validator;

            if (_workflowType == WorkflowType.BillDemandWorkfow)
            {
                validator = new BillDemandWorkflowAuthorizationValidator();
            }
            else if (_workflowType == WorkflowType.DemandAdjustmentWorkflow)
            {
                validator = new DemandAdjustmentWorflowAuthorizationValidator();
            }
            else if (_workflowType == WorkflowType.DemandWorkflow)
            {
                validator = new DemandWorkflowAuthorizationValidator();
            }
            else
            {
                throw new ArgumentException();
            }

            validator.AuthorizationService     = _authorizationService;
            validator.EmployeeService          = _authorizationService.EmployeeService;
            validator.BillDemandBuinessService = _authorizationService.BillDemandBuinessService;
            validator.SecurityEntityService    = _authorizationService.SecurityEntityService;

            return(validator);
        }
        public IAuthorizationValidator CreateValidator()
        {
            IAuthorizationValidator validator;

            if (_workflowType == WorkflowType.BillDemandWorkfow)
                validator = new BillDemandWorkflowAuthorizationValidator();
            else if (_workflowType == WorkflowType.DemandAdjustmentWorkflow)
                validator = new DemandAdjustmentWorflowAuthorizationValidator();
            else if (_workflowType == WorkflowType.DemandWorkflow)
                validator = new DemandWorkflowAuthorizationValidator();
            else
                throw new ArgumentException();

            validator.AuthorizationService = _authorizationService;
            validator.EmployeeService = _authorizationService.EmployeeService;
            validator.BillDemandBuinessService = _authorizationService.BillDemandBuinessService;
            validator.SecurityEntityService = _authorizationService.SecurityEntityService;

            return validator;
        }