Exemplo n.º 1
0
 public ViewModelFactory(IValidationRuleFactory validationRuleFactory, IComponentsController componentsController, IClientFactory clientCreator, IApp app)
 {
     this.validationRuleFactory = validationRuleFactory;
     this.componentsController  = componentsController;
     this.clientCreator         = clientCreator;
     this.app = app;
 }
 public ValidationRulesGenerator(IValidatorFactory validatorFactory, IValidationRuleFactory validationRuleFactory, ICamelCasePropertyResolver propertyResolver, IValueTypeRuleFactory valueTypeRuleFactory, IValueTypeMatches valueTypeMatchesFinder)
 {
     _validatorFactory       = validatorFactory;
     _validationRuleFactory  = validationRuleFactory;
     _propertyResolver       = propertyResolver;
     _valueTypeRuleFactory   = valueTypeRuleFactory;
     _valueTypeMatchesFinder = valueTypeMatchesFinder;
 }
Exemplo n.º 3
0
        public HubEnvironment(IHubContext <MainHub> hubContext, IValidationRuleFactory validationRuleFactory)
        {
            IRepositoryFactory repositoryFactory = new RepositoryFactory(new DBContext());
            IActivityFactory   activityFactory   = new ActivityFactory(repositoryFactory, validationRuleFactory);

            this.useCaseFactory = new UseCaseFactory(activityFactory);
            this.hubContext     = hubContext;
        }
Exemplo n.º 4
0
        public HubController(IHubContext <CurHub> hubContext, IValidationRuleFactory validationRuleFactory)
        {
            IUnitOfWorkFactory unitOfWorkFactory = new UnitOfWorkFactory();
            IUnitOfWork        unitOfWork        = unitOfWorkFactory.CreateUnitOfWork();
            IActivityFactory   activityFactory   = new ActivityFactory(unitOfWork, validationRuleFactory);

            this.useCaseFactory = new UseCaseFactory(activityFactory);
            this.hubContext     = hubContext;
        }
Exemplo n.º 5
0
        public ActivitiesFactory(IRepositoryFactory repositoryFactory, IValidationRuleFactory validationRuleFactory)
        {
            // Extension point of the factory
            this.ruleCollection.Add(typeof(IValidationActivity <LoginRequestEvent>), new LoginValidationActivity(validationRuleFactory.Create <ILoginOperationValidationRule>()));
            this.ruleCollection.Add(typeof(IRequestActivity <LoginRequestEvent, LoginResponseEvent>), new GetAccountByRequest(repositoryFactory.Create <IAccountRepository>()));

            this.ruleCollection.Add(typeof(IValidationActivity <CreateAccountRequestEvent>), new CreateAccountValidationActivity(validationRuleFactory.Create <ICreateAccountOperationValidationRule>()));
            this.ruleCollection.Add(typeof(IRequestActivity <CreateAccountRequestEvent, CreateAccountResponseEvent>), new CreateAccountByRequest(repositoryFactory.Create <IAccountRepository>()));

            this.ruleCollection.Add(typeof(IRequestActivity <GetAccountByIdRequestEvent, GetAccountByIdResponseEvent>), new GetAccountById(repositoryFactory.Create <IAccountRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetAllAccountRequestEvent, GetAllAccountResponseEvent>), new GetAllAccountByRequest(repositoryFactory.Create <IAccountRepository>()));



            this.ruleCollection.Add(typeof(IRequestActivity <CreateEmployeeRequestEvent, CreateEmployeeResponseEvent>), new CreateEmployeeByRequest(repositoryFactory.Create <IEmployeeRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetEmployeeByIdRequestEvent, GetEmployeeByIdResponseEvent>), new GetEmployeeById(repositoryFactory.Create <IEmployeeRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetEmployeeByAccountIdRequestEvent, GetEmployeeByAccountIdResponseEvent>), new GetEmployeeByAccountId(repositoryFactory.Create <IEmployeeRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetAllEmployeeRequestEvent, GetAllEmployeeResponseEvent>), new GetAllEmployeeByRequest(repositoryFactory.Create <IEmployeeRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetCountEmployeeByTeamIdRequestEvent, GetCountEmployeeByTeamIdResponseEvent>), new GetCountEmployeeById(repositoryFactory.Create <IEmployeeRepository>()));

            this.ruleCollection.Add(typeof(IRequestActivity <CreateTeamRequestEvent, CreateTeamResponseEvent>),
                                    new CreateTeamByRequest(repositoryFactory.Create <ITeamRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetTeamByIdRequestEvent, GetTeamByIdResponseEvent>),
                                    new GetTeamById(repositoryFactory.Create <ITeamRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetAllTeamRequestEvent, GetAllTeamResponseEvent>),
                                    new GetAllTeamByRequest(repositoryFactory.Create <ITeamRepository>()));

            this.ruleCollection.Add(typeof(IRequestActivity <CreateProjectRequestEvent, CreateProjectResponseEvent>), new CreateProjectByRequest(repositoryFactory.Create <IProjectRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <UpdateProjectRequestEvent, UpdateProjectResponseEvent>), new UpdateProjectByRequest(repositoryFactory.Create <IProjectRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetAllProjectRequestEvent, GetAllProjectResponseEvent>), new GetAllProjectByRequest(repositoryFactory.Create <IProjectRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetProjectByIdRequestEvent, GetProjectByIdResponseEvent>), new GetProjectById(repositoryFactory.Create <IProjectRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetProjectByTeamIdRequestEvent, GetProjectByTeamIdResponseEvent>), new GetProjectByTeamId(repositoryFactory.Create <IProjectRepository>()));

            this.ruleCollection.Add(typeof(IRequestActivity <CreateProjectTaskRequestEvent, CreateProjectTaskResponseEvent>), new CreateProjectTaskByRequest(repositoryFactory.Create <IProjectTaskRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <UpdateProjectTaskRequestEvent, UpdateProjectTaskResponseEvent>), new UpdateProjectTaskByRequest(repositoryFactory.Create <IProjectTaskRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetAllProjectTaskRequestEvent, GetAllProjectTaskResponseEvent>), new GetAllProjectTaskByRequest(repositoryFactory.Create <IProjectTaskRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetProjectTaskByIdRequestEvent, GetProjectTaskByIdResponseEvent>), new GetProjectTaskById(repositoryFactory.Create <IProjectTaskRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetTaskListByEmployeeIdRequestEvent, GetTaskListByEmployeeIdResponseEvent>), new GetTaskByEmployeeId(repositoryFactory.Create <IProjectTaskRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetCountTaskByProjectIdRequestEvent, GetCountTaskByProjectIdResponseEvent>), new GetCountProjectTaskByProjectId(repositoryFactory.Create <IProjectTaskRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetCountSuccessTaskByProjectIdRequestEvent, GetCountSuccessTaskByProjectIdResponseEvent>), new GetCountSuccessProjectTaskByProjectId(repositoryFactory.Create <IProjectTaskRepository>()));


            this.ruleCollection.Add(typeof(IRequestActivity <GetAllCustomerRequestEvent, GetAllCustomerResponseEvent>), new GetAllCustomerByRequest(repositoryFactory.Create <ICustomerRepository>()));
            this.ruleCollection.Add(typeof(IRequestActivity <GetCustomerByIdRequestEvent, GetCustomerByIdResponseEvent>), new GetCustomerById(repositoryFactory.Create <ICustomerRepository>()));
        }
Exemplo n.º 6
0
        public ActivityFactory(IRepositoryFactory repositoryFactory, IValidationRuleFactory validationRuleFactory)
        {
            this.ruleCollection.Add(typeof(IValidationActivity <AddProductGoodsRequest>), new AddProductGoodsValidationActivity(validationRuleFactory.Create <IArrivedGoodsValidationRule>(), validationRuleFactory.Create <IProductValidationRule>()));
            this.ruleCollection.Add(typeof(IValidationActivity <EditProductGoodsRequest>), new EditProductGoodsValidationActivity(validationRuleFactory.Create <IArrivedGoodsValidationRule>(), validationRuleFactory.Create <IProductValidationRule>()));
            this.ruleCollection.Add(typeof(IValidationActivity <GetProductByDateRequest>), new GetProductsByDateValidationActivity(validationRuleFactory.Create <IProductByDateValidationRule>()));
            this.ruleCollection.Add(typeof(IGetArrivedGoodsActivity), new GetArrivedGoodsActivity(repositoryFactory.Create <IArrivedGoodsRepository>()));
            this.ruleCollection.Add(typeof(IAddArrivedGoodsActivity), new AddArrivedGoodsActivity(repositoryFactory.Create <IArrivedGoodsRepository>()));
            this.ruleCollection.Add(typeof(IEditArrivedGoodsActivity), new EditArrivedGoodsActivity(repositoryFactory.Create <IArrivedGoodsRepository>()));
            this.ruleCollection.Add(typeof(IAddProductActivity), new AddProductActivity(repositoryFactory.Create <IProductRepository>()));
            this.ruleCollection.Add(typeof(IEditProductActivity), new EditProductActivity(repositoryFactory.Create <IProductRepository>()));
            this.ruleCollection.Add(typeof(IGetProductsByDateActivity), new GetProductsByDateActivity(repositoryFactory.Create <IProductRepository>()));
            this.ruleCollection.Add(typeof(IGetProductActivity), new GetProductActivity(repositoryFactory.Create <IProductRepository>()));

            this.ruleCollection.Add(typeof(IGetCategoryActivity), new GetCategoryActivity(repositoryFactory.Create <ICategoryRepository>()));

            this.ruleCollection.Add(typeof(IGetClassActivity), new GetClassActivity(repositoryFactory.Create <IClassRepository>()));

            this.ruleCollection.Add(typeof(IGetDepartmentActivity), new GetDepartmentActivity(repositoryFactory.Create <IDepartmentRepository>()));

            this.ruleCollection.Add(typeof(IGetProviderActivity), new GetProviderActivity(repositoryFactory.Create <IProviderRepository>()));

            this.ruleCollection.Add(typeof(IValidationActivity <GetReportDetailedRequest>), new ReportDetailedVaildationActivity(validationRuleFactory.Create <IReportValidationRule>()));
            this.ruleCollection.Add(typeof(IGetReportDetailedActivity), new GetReportDetailedActivity(repositoryFactory.Create <IClassRepository>(),
                                                                                                      repositoryFactory.Create <ISaleRepository>(), repositoryFactory.Create <IProductRepository>()));

            this.ruleCollection.Add(typeof(IValidationActivity <GetReportSimpleRequest>), new ReportSimpleVaildationActivity(validationRuleFactory.Create <IReportValidationRule>()));
            this.ruleCollection.Add(typeof(IGetReportSimpleActivity), new GetReportSimpleActivity(repositoryFactory.Create <IClassRepository>(),
                                                                                                  repositoryFactory.Create <ISaleRepository>(), repositoryFactory.Create <IProductRepository>()));

            this.ruleCollection.Add(typeof(IValidationActivity <AddSaleRequest>), new AddSaleValidationActivity(validationRuleFactory.Create <ISaleValidationRule>()));
            this.ruleCollection.Add(typeof(IValidationActivity <GetSaleByClassRequest>), new GetSalesByClassValidationActivity(validationRuleFactory.Create <ISaleByDateValidationRule>()));
            this.ruleCollection.Add(typeof(IAddSaleActivity), new AddSaleActivity(repositoryFactory.Create <ISaleRepository>()));
            this.ruleCollection.Add(typeof(IGetSalesByClassActivity), new GetSalesByClassActivity(repositoryFactory.Create <ISaleRepository>()));
            this.ruleCollection.Add(typeof(IGetSaleActivity), new GetSaleActivity(repositoryFactory.Create <ISaleRepository>()));

            this.ruleCollection.Add(typeof(IGetSellerActivity), new GetSellerActivity(repositoryFactory.Create <ISellerRepository>()));

            this.ruleCollection.Add(typeof(IGetTareChangeActivity), new GetTareChangeActivity(repositoryFactory.Create <ITareChangeRepository>()));

            this.ruleCollection.Add(typeof(IValidationActivity <GetUserRequest>), new EnterValidationActivity(validationRuleFactory.Create <IEnterValidationRule>()));
            this.ruleCollection.Add(typeof(IGetUserActivity), new GetUserActivity(repositoryFactory.Create <IUserRepository>()));
        }
Exemplo n.º 7
0
 public ValidationEngine(IValidationRuleFactory ruleFactory)
 {
     _ruleFactory = ruleFactory;
 }
 public EnumerationValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
 public ValidationServiceDependencies(IValidationRuleFactory validationRuleFactory, IConditionEvaluatorFactory conditionEvaluatorFactory, INotificationService notificationService)
 {
     ValidationRuleFactory = validationRuleFactory;
     ConditionEvaluatorFactory = conditionEvaluatorFactory;
     NotificationService = notificationService;
 }
Exemplo n.º 10
0
 public PasswordFieldValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
 public ImportValidator(IDependencyResolver dependencyResolver, IValidationRuleFactory ruleFactory)
 {
     this._dependencyResolver = dependencyResolver;
     this._ruleFactory        = ruleFactory;
 }
 public GetValidationRulesListRequestHandler(IOptionsParser optionsParser,
                                             IValidationRuleFactory validationRuleFactory)
 {
     _optionsParser         = optionsParser;
     _validationRuleFactory = validationRuleFactory;
 }
Exemplo n.º 13
0
 public TextAreaValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
Exemplo n.º 14
0
 public void SetUp()
 {
     _mocks = new MockRepository();
     _mockedValidationRuleFactory = _mocks.StrictMock <IValidationRuleFactory <string> >();
     _mockedValidationRule        = _mocks.StrictMock <IValidationRule <string> >();
 }
Exemplo n.º 15
0
        public ActivitiesFactory(IRepositoryFactory repositoryFactory, IValidationRuleFactory validationRuleFactory)
        {
            // Extension point of the factory
            this.ruleCollection.Add(
                typeof(IValidationActivity <EnterRequestEvent>),
                new LoginValidationActivity(validationRuleFactory.Create <IEnterOperationValidationRule>())
                );
            this.ruleCollection.Add(
                typeof(IRequestActivity <EnterRequestEvent, EnterResponseEvent, IUserRepository>),
                new GetUserByRequest(repositoryFactory.Create <IUserRepository>())
                );

            this.ruleCollection.Add(
                typeof(IValidationActivity <EditUserRequestEvent>),
                new EditUserValidationActivity(validationRuleFactory.Create <IUpdateUserOperationValidationRule>())
                );
            this.ruleCollection.Add(
                typeof(IRequestActivity <EditUserRequestEvent, EditUserResponseEvent, IUserRepository>),
                new EditUserByRequest(repositoryFactory.Create <IUserRepository>())
                );

            this.ruleCollection.Add(
                typeof(IRequestActivity <EditAccountRequestEvent, EditAccountResponseEvent, IAccountRepository>),
                new EditAccountByRequest(repositoryFactory.Create <IAccountRepository>())
                );

            this.ruleCollection.Add(
                typeof(IRequestActivity <GetNotesRequestEvent, GetNotesResponseEvent, INoteRepository>),
                new GetNotesByAccountId(repositoryFactory.Create <INoteRepository>())
                );

            this.ruleCollection.Add(
                typeof(IValidationActivity <EditNoteRequestEvent>),
                new EditNoteValidationActivity(validationRuleFactory.Create <IEditNoteOperationValidationRule>())
                );
            this.ruleCollection.Add(
                typeof(IRequestActivity <EditNoteRequestEvent, EditNoteResponseEvent, INoteRepository>),
                new EditNoteByRequest(repositoryFactory.Create <INoteRepository>())
                );

            this.ruleCollection.Add(
                typeof(IValidationActivity <AccessLevelCheckEvent>),
                new AccessLevelValidationActivity()
                );
            this.ruleCollection.Add(
                typeof(IValidationActivity <EnterResponseEvent>),
                new AfterLoginValidationActivity(validationRuleFactory.Create <IAfterLoginOperationValidationRule>())
                );

            this.ruleCollection.Add(
                typeof(IRequestActivity <ChangeUserStatusRequestEvent, ChangeUserStatusResponseEvent, IUserRepository>),
                new ChangeUserStatusByRequest(repositoryFactory.Create <IUserRepository>())
                );

            this.ruleCollection.Add(
                typeof(IRequestActivity <CreateUserRequestEvent, CreateUserResponseEvent, IUserRepository>),
                new CreateUserByRequest(repositoryFactory.Create <IUserRepository>())
                );

            this.ruleCollection.Add(
                typeof(IRequestActivity <CreateAccountRequestEvent, CreateAccountResponseEvent, IAccountRepository>),
                new CreateAccountByRequest(repositoryFactory.Create <IAccountRepository>())
                );

            this.ruleCollection.Add(
                typeof(IRequestActivity <DeleteUserRequestEvent, DeleteUserResponseEvent, IUserRepository>),
                new DeleteUserByRequest(repositoryFactory.Create <IUserRepository>())
                );
        }
Exemplo n.º 16
0
 public QueryValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
 public ValidationEngine(IValidationRuleFactory ruleFactory)
 {
     _ruleFactory = ruleFactory;
 }
Exemplo n.º 18
0
 public ViewModelFactory(IValidationRuleFactory validationRuleFactory, IMainWindowController mainWindowController, IFrontServiceClient frontServiceClient)
 {
     this.validationRuleFactory = validationRuleFactory;
     this.mainWindowController  = mainWindowController;
     this.frontServiceClient    = frontServiceClient;
 }
Exemplo n.º 19
0
 public ActivityFactory(IUnitOfWork unitOfWork, IValidationRuleFactory validationRuleFactory)
 {
     this.unitOfWork            = unitOfWork;
     this.validationRuleFactory = validationRuleFactory;
 }
 public IfEmptyRequireValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
Exemplo n.º 21
0
 public TaxonomyValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
Exemplo n.º 22
0
 public CheckBoxValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
Exemplo n.º 23
0
 public UrlFieldValidator(IValidationRuleFactory validationRuleFactory)
 {
     _validationRuleFactory = validationRuleFactory;
 }
Exemplo n.º 24
0
 public Validator(IValidationRuleFactory <T> factory)
 {
     _validationRules = factory.CreateValidationRules();
 }