예제 #1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (contractorRepository != null)
                {
                    contractorRepository.Dispose();
                    contractorRepository = null;
                }

                if (employeeRepository != null)
                {
                    employeeRepository.Dispose();
                    employeeRepository = null;
                }

                if (employeeRelationshipTypeRepository != null)
                {
                    employeeRelationshipTypeRepository.Dispose();
                    employeeRelationshipTypeRepository = null;
                }

                if (workflowMessageService != null)
                {
                    workflowMessageService.Dispose();
                    workflowMessageService = null;
                }
            }
            base.Dispose(disposing);
        }
예제 #2
0
 public ContractorEmployeesController(IContractorRepository contractorRepo, IEmployeeRepository employeeRepo, IEmployeeRelationshipTypeRepository employeeRelationshipTypeRepo, IWorkflowMessageService workflowMessageServ)
 {
     contractorRepository = contractorRepo;
     employeeRepository   = employeeRepo;
     employeeRelationshipTypeRepository = employeeRelationshipTypeRepo;
     workflowMessageService             = workflowMessageServ;
 }
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Free managed resources
                if (contractorRepository != null)
                {
                    contractorRepository.Dispose();
                    contractorRepository = null;
                }

                if (contractRepository != null)
                {
                    contractRepository.Dispose();
                    contractRepository = null;
                }

                if (employeeRepository != null)
                {
                    employeeRepository.Dispose();
                    employeeRepository = null;
                }

                if (vehicleRepository != null)
                {
                    vehicleRepository.Dispose();
                    vehicleRepository = null;
                }
            }
        }
 public RequirementService(IContractorRepository contractorRepo, IContractRepository contractRepo, IEmployeeRepository employeeRepo, IVehicleRepository vehicleRepo)
 {
     contractorRepository = contractorRepo;
     contractRepository   = contractRepo;
     employeeRepository   = employeeRepo;
     vehicleRepository    = vehicleRepo;
 }
예제 #5
0
        public ContractorsController(IContractorRepository contractorRepo,
                                     ILocalizationRepository localizationRepo,
                                     IBusinessTypeRepository businessTypeRepo,
                                     IEmployeeRepository employeeTypesRepo,
                                     IVehicleRepository vehicleRepo,
                                     IContractRepository contractRepo,
                                     IEmployeeRelationshipTypeRepository employeeRelationshipTypeRepo,
                                     IWorkflowMessageService workflowMessageServ,
                                     IIdentityMessageService emailServ)
        {
            contractorRepository               = contractorRepo;
            localizationRepository             = localizationRepo;
            businessTypeRepository             = businessTypeRepo;
            employeeRepository                 = employeeTypesRepo;
            vehicleRepository                  = vehicleRepo;
            contractRepository                 = contractRepo;
            employeeRelationshipTypeRepository = employeeRelationshipTypeRepo;

            emailService = emailServ;

            workflowMessageService = workflowMessageServ;

            userManager = new UserManager <ContractorUser>(new UserStore <ContractorUser>(new ApplicationDbContext()));
            userManager.UserValidator = new UserValidator <ContractorUser>(userManager)
            {
                AllowOnlyAlphanumericUserNames = true,
                RequireUniqueEmail             = true
            };

            var provider = new DpapiDataProtectionProvider("SampleAppName");

            userManager.UserTokenProvider = new DataProtectorTokenProvider <ContractorUser>(provider.Create("SampleTokenName"));
            userManager.EmailService      = emailService;
        }
예제 #6
0
        public void Validate(IContractorRepository contractorRepository)
        {
            if (string.IsNullOrEmpty(CompanyName))
            {
                throw new EntityModelException(nameof(CompanyName), "The company name is mandatory.");
            }

            CasCode = CasCode?.Trim();
            CspCode = CspCode?.Trim();

            if (string.IsNullOrEmpty(CasCode) && string.IsNullOrEmpty(CspCode))
            {
                throw new EntityModelException($"{nameof(CasCode)}+{nameof(CspCode)}", "The CASCode and the CSPCode can not be both empty.");
            }

            if (!string.IsNullOrEmpty(CasCode) && !string.IsNullOrEmpty(CspCode))
            {
                throw new EntityModelException($"{nameof(CasCode)}+{nameof(CspCode)}", "The CASCode and the CSPCode can not have both values.");
            }

            if (!contractorRepository.IsUnique(this))
            {
                throw new EntityModelException($"{nameof(CompanyName)}", "There is another contractor with the same company name.");
            }
        }
예제 #7
0
 public ContractorController(
     IContractorRepository repository,
     IContractorFactory factory
     )
 {
     _repository = repository;
     _factory    = factory;
 }
예제 #8
0
        public ContractorService(IContractorRepository repository, AbstractValidator <Contractor> addValidator)
        {
            Guard.ThrowIfArgumentIsNull(repository, nameof(repository));
            Guard.ThrowIfArgumentIsNull(addValidator, nameof(addValidator));

            _repository             = repository;
            _addContractorValidator = addValidator;
        }
        public HomeContractorController(IContractorRepository contractorRepo, IWorkflowMessageService workflowMessageServ)
        {
            contractorRepository   = contractorRepo;
            workflowMessageService = workflowMessageServ;

            //ViewBag.UserFullname = base.CurrentUserFullname;
            ViewBag.UserFullname = base.CurrentCustomerID.ToString();
        }
 public MProjectController(IMProjectRepository repoMProject, ILogRepository repoLog, ICompanyRepository repoCompany, IContractorRepository repoContractor, IProjectRepository repoProject)
     : base(repoLog)
 {
     RepoMProject   = repoMProject;
     RepoCompany    = repoCompany;
     RepoContractor = repoContractor;
     RepoProject    = repoProject;
 }
예제 #11
0
 public MProjectController(IMProjectRepository repoMProject, ILogRepository repoLog, ICompanyRepository repoCompany,IContractorRepository repoContractor,IProjectRepository repoProject)
     : base(repoLog)
 {
     RepoMProject = repoMProject;
     RepoCompany = repoCompany;
     RepoContractor = repoContractor;
     RepoProject = repoProject;
 }
예제 #12
0
 public DataManager(ICardRepository cardRepository, IStatusRepository statusRepository, IContractorRepository contractorRepository, ITypeCardRepository typeCardRepository, IRoleRepository roleRepository, IUserRepository userRepository)
 {
     Cards       = cardRepository;
     Contractors = contractorRepository;
     Statuses    = statusRepository;
     TypesCard   = typeCardRepository;
     Roles       = roleRepository;
     Users       = userRepository;
 }
예제 #13
0
        public void TestInitialize()
        {
            EntityFrameworkDbContextHelper.Instance.BeginTransaction();

            _contractorRepository = new ContractorRepository();
            _genericRepository    = new EntityFrameworkGenericRepository <Guid>();

            _root = new SstRegistrationTestHarnessSystem(Guid.NewGuid());
            _genericRepository.Save(_root);
        }
 public InventoryService(IInventoryRepository inventoryRepository,
                         ICategoryRepository categoryRepository,
                         IContractRepository contractRepository,
                         IContractorRepository contractorRepository)
 {
     this.inventoryRepository  = inventoryRepository;
     this.categoryRepository   = categoryRepository;
     this.contractRepository   = contractRepository;
     this.contractorRepository = contractorRepository;
 }
예제 #15
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (contractorRepository != null)
                {
                    contractorRepository.Dispose();
                    contractorRepository = null;
                }

                if (contractRepository != null)
                {
                    contractRepository.Dispose();
                    contractRepository = null;
                }

                if (periodRepository != null)
                {
                    periodRepository.Dispose();
                    periodRepository = null;
                }

                if (requirementRepository != null)
                {
                    requirementRepository.Dispose();
                    requirementRepository = null;
                }

                if (presentationRepository != null)
                {
                    presentationRepository.Dispose();
                    presentationRepository = null;
                }

                if (presentationServices != null)
                {
                    presentationServices.Dispose();
                    presentationServices = null;
                }

                //documentFileService.Dispose();
                if (workflowMessageService != null)
                {
                    workflowMessageService.Dispose();
                    workflowMessageService = null;
                }

                if (entityTypeRepository != null)
                {
                    entityTypeRepository.Dispose();
                    entityTypeRepository = null;
                }
            }
            base.Dispose(disposing);
        }
예제 #16
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (contractorRepository != null)
                {
                    contractorRepository.Dispose();
                    contractorRepository = null;
                }

                if (localizationRepository != null)
                {
                    localizationRepository.Dispose();
                    localizationRepository = null;
                }

                if (businessTypeRepository != null)
                {
                    businessTypeRepository.Dispose();
                    businessTypeRepository = null;
                }

                if (employeeRepository != null)
                {
                    employeeRepository.Dispose();
                    employeeRepository = null;
                }

                if (vehicleRepository != null)
                {
                    vehicleRepository.Dispose();
                    vehicleRepository = null;
                }

                if (employeeRelationshipTypeRepository != null)
                {
                    employeeRelationshipTypeRepository.Dispose();
                    employeeRelationshipTypeRepository = null;
                }

                if (userManager != null)
                {
                    userManager.Dispose();
                    userManager = null;
                }

                if (workflowMessageService != null)
                {
                    workflowMessageService.Dispose();
                    workflowMessageService = null;
                }
            }
            base.Dispose(disposing);
        }
예제 #17
0
 private void SetUpRepositories()
 {
     ContractorRepository = kernel.Get<IContractorRepository>();
     DeviceRepository = kernel.Get<IDeviceRepository>();
     FixedAssetRepository = kernel.Get<IFixedAssetRepository>();
     KindRepository = kernel.Get<IKindRepository>();
     LicenceRepository = kernel.Get<ILicenceRepository>();
     PeripheralDeviceRepository = kernel.Get<IPeripheralDeviceRepository>();
     PersonRepository = kernel.Get<IPersonRepository>();
     SectionRepository = kernel.Get<ISectionRepository>();
     SubgroupRepository = kernel.Get<ISubgroupRepository>();
     MembershipRoleRepository = kernel.Get<IMembershipRoleRepository>();
     MembershipUserRepository = kernel.Get<IMembershipUserRepository>();
 }
예제 #18
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (userManager != null)
                {
                    userManager.Dispose();
                    userManager = null;
                }

                if (contractorRepository != null)
                {
                    contractorRepository.Dispose();
                    contractorRepository = null;
                }
            }
            base.Dispose(disposing);
        }
 public CustomerRequirementsController(IContractorRepository contractorRepo,
                                       IContractRepository contractRepo,
                                       IPeriodRepository periodRepo,
                                       IRequirementRepository requirementRepo,
                                       IPresentationRepository presentationRepo,
                                       IPresentationServices presentationServ,
                                       IDocumentFileService documentFileServ,
                                       IWorkflowMessageService workflowMessageServ)
 {
     contractorRepository   = contractorRepo;
     contractRepository     = contractRepo;
     periodRepository       = periodRepo;
     requirementRepository  = requirementRepo;
     presentationRepository = presentationRepo;
     presentationServices   = presentationServ;
     documentFileService    = documentFileServ;
     workflowMessageService = workflowMessageServ;
 }
 public PrototypeService(ICategoryRepository categoryRepository,
                         IContractorRepository contractorRepository, IContractRepository contractRepository,
                         IImageRepository imageRepository, IInventoryRepository inventoryRepository,
                         IOrderItemRepository orderItemRepository, IOrderRepository orderRepository,
                         IShoppingCartItemRepository shoppingCartItemRepository, IShoppingCartRepository shoppingCartRepository,
                         IUserRepository userRepository)
 {
     this.categoryRepository         = categoryRepository;
     this.contractorRepository       = contractorRepository;
     this.contractRepository         = contractRepository;
     this.imageRepository            = imageRepository;
     this.inventoryRepository        = inventoryRepository;
     this.orderItemRepository        = orderItemRepository;
     this.orderRepository            = orderRepository;
     this.shoppingCartItemRepository = shoppingCartItemRepository;
     this.shoppingCartRepository     = shoppingCartRepository;
     this.userRepository             = userRepository;
 }
예제 #21
0
 public RequirementsController(IRequirementRepository requirementRepo,
                               IPresentationRepository presentationRepo,
                               IDocumentFileService documentFileServ,
                               ICustomerAuditorRespository customerAuditorRespo,
                               IContractorRepository contractorRepo,
                               IPresentationServices presentationServ,
                               IWorkflowMessageService workflowMessageServ,
                               IDocumentationBusinessTypeRepository documentationBusinessTypeRepo,
                               IPeriodRepository periodRepo,
                               IEntityTypeRepository entityTypeRepo)
 {
     requirementRepository               = requirementRepo;
     presentationRepository              = presentationRepo;
     documentFileService                 = documentFileServ;
     customerAuditorRespository          = customerAuditorRespo;
     contractorRepository                = contractorRepo;
     presentationServices                = presentationServ;
     workflowMessageService              = workflowMessageServ;
     documentationBusinessTypeRepository = documentationBusinessTypeRepo;
     periodRepository     = periodRepo;
     entityTypeRepository = entityTypeRepo;
 }
예제 #22
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (contractorRepository != null)
                {
                    contractorRepository.Dispose();
                    contractorRepository = null;
                }

                if (vehicleRepository != null)
                {
                    vehicleRepository.Dispose();
                    vehicleRepository = null;
                }

                if (workflowMessageService != null)
                {
                    workflowMessageService.Dispose();
                    workflowMessageService = null;
                }
            }
            base.Dispose(disposing);
        }
 public ContractorController(IContractorRepository repo)
 {
     repository = repo;
 }
 public ContractorService(IUnitOfWork unitOfWork, IContractorRepository ContractorRepository)
 {
     _unitOfWork           = unitOfWork;
     _ContractorRepository = ContractorRepository;
 }
예제 #25
0
 public ContractorControllerTest()
 {
     _validator  = new AddContractorValidator();
     _repository = new InMemoryContractorRepository();
     _service    = new ContractorService(_repository, _validator);
 }
예제 #26
0
 public ContractorController(IContractorRepository repoContractor, ILogRepository repoLog)
     : base(repoLog)
 {
     RepoContractor = repoContractor;
 }
예제 #27
0
 public DashboardController(IPermitRepository projects, IContractorRepository contractor)
 {
     _projects   = projects;
     _contractor = contractor;
 }
 public ContractorService(IContractorRepository contractorRepository)
 {
     _contractorRepository = contractorRepository;
 }
 public ContractorService(IContractorRepository repository)
 {
     this.repository = repository;
 }
예제 #30
0
 public UserTablesService(IUserTablesRepository usertableRepository, IContractorRepository contractorRepository, IUnitOfWork unitOfWork)
 {
     this.contractorRepository = contractorRepository;
     this.usertableRepository  = usertableRepository;
     this.unitOfWork           = unitOfWork;
 }
예제 #31
0
 public ContractorServiceTest()
 {
     _validator  = new AddContractorValidator();
     _repository = new InMemoryContractorRepository();
 }
 public ApiContractorController(IContractorRepository repository)
 {
     contractorRepository = repository;
 }
예제 #33
0
 public ContractorsController(IContractorRepository contractorRepo, IProjectRepository projectRepo)
 {
     this.contractorRepo = contractorRepo;
     this.projectRepo    = projectRepo;
 }
예제 #34
0
 public ContractorController(IContractorRepository repo)
 {
     _repo = repo;
 }