public AttributeTypeCollection Read(EntityType entityType, IEntityTypeRepository entityTypeRepository)
 {
     var attributes = new AttributeTypeCollection();
     using (SqlConnection sqlConnection = _connectionProvider.GetConnection())
     {
         using (SqlCommand sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText =
                 string.Format(
                     "SELECT * FROM hsck.EntityAttributeTypes WHERE ParentEntityTypeName='{0}'",
                     entityType.Name);
             using (SqlDataReader reader = sqlCommand.ExecuteReader())
             {
                 while (reader.Read())
                 {
                     var entityTypeName = (string) reader["ChildEntityTypeName"];
                     var attributeName = (string) reader["Name"];
                     EntityType ofType = entityTypeName == entityType.Name
                                             ? entityType
                                             : entityTypeRepository.Read(entityTypeName);
                     var entityAttributeType =
                         new EntityAttributeType
                             {
                                 Id = (int) reader["Id"],
                                 Name = attributeName,
                                 OfType = ofType
                             };
                     attributes.Add(entityAttributeType);
                 }
             }
         }
     }
     return attributes;
 }
 public ModelVerification(IEntityTypeRepository typeRepository, ITableFactory tableFactory, int tolerance)
 {
     _tolerance         = tolerance;
     _tableFactory      = tableFactory;
     NameSpacesToIgnore = Enumerable.Empty <string>();
     _typeRepository    = typeRepository;
 }
 public AttributeTypeCollection Read(EntityType entityType, IEntityTypeRepository entityTypeRepository)
 {
     var attributes = new AttributeTypeCollection();
     using (SqlConnection sqlConnection = _connectionProvider.GetConnection())
     {
         using (SqlCommand sqlCommand = sqlConnection.CreateCommand())
         {
             sqlCommand.CommandText = string.Format("SELECT * FROM hsck.AttributeTypes WHERE EntityTypeId='{0}'", entityType.Id);
             using (SqlDataReader reader = sqlCommand.ExecuteReader())
             {
                 while (reader.Read())
                 {
                     var dataType = (DataType) Enum.Parse(typeof (DataType), (string) reader["DataType"]);
                     var attributeType = new AttributeType
                                             {
                                                 Id = (int) reader["Id"],
                                                 Name = (string) reader["Name"],
                                                 DataType = dataType
                                             };
                     attributes.Add(attributeType);
                 }
             }
         }
     }
     attributes.Add(_entityAttributeTypeRepository.Read(entityType, entityTypeRepository));
     return attributes;
 }
Example #4
0
 public AttributesController(IAttributeRepository attributeRepository,
                             IEntityTypeRepository entityTypeRepository, IHubContext <SignalRServer> signalRHub)
 {
     _signalRHub           = signalRHub;
     _attributeRepository  = attributeRepository;
     _entityTypeRepository = entityTypeRepository;
 }
 public EntityTypeBusinessEngine(IDataRepositoryFactory data_repo_fact, ICache cache, IEntityServiceFactory ent_serv_fact)
     : base(data_repo_fact, null, ent_serv_fact)
 {
     _cache         = cache;
     _repo_ent_type = _data_repository_factory.GetDataRepository <IEntityTypeRepository>();
     GetTypes();
 }
Example #6
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);
        }
Example #7
0
 /// <summary>
 ///     Create a new <see cref="SystemEntityAccessControlChecker" />.
 /// </summary>
 /// <param name="roleRepository">
 ///     Used to load roles for a given user. This cannot be null.
 /// </param>
 /// <param name="queryRepository">
 ///     Used to load queries for a role and permission. This cannot be null.
 /// </param>
 /// <param name="entityTypeRepository">
 ///     Used to load the types of each entity. This cannot be null.
 /// </param>
 /// <exception cref="ArgumentNullException">
 ///     No argument can be null.
 /// </exception>
 internal SystemEntityAccessControlChecker(IUserRoleRepository roleRepository, IQueryRepository queryRepository,
                                           IEntityTypeRepository entityTypeRepository) : base(roleRepository, queryRepository, entityTypeRepository)
 {
     if (roleRepository == null)
     {
         throw new ArgumentNullException(nameof(roleRepository));
     }
     if (queryRepository == null)
     {
         throw new ArgumentNullException(nameof(queryRepository));
     }
     if (entityTypeRepository == null)
     {
         throw new ArgumentNullException(nameof(entityTypeRepository));
     }
 }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (documentationRepository != null)
                {
                    documentationRepository.Dispose();
                    documentationRepository = null;
                }

                if (entityTypeRepository != null)
                {
                    entityTypeRepository.Dispose();
                    entityTypeRepository = null;
                }
            }
            base.Dispose(disposing);
        }
        /// <summary>
        /// Create a new <see cref="EntityAccessControlChecker"/>.
        /// </summary>
        /// <param name="roleRepository">
        /// Used to load roles for a given user. This cannot be null.
        /// </param>
        /// <param name="queryRepository">
        /// Used to load queries for a role and permission. This cannot be null.
        /// </param>
        /// <param name="entityTypeRepository">
        /// Used to load the types of each entity. This cannot be null.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// No argument can be null.
        /// </exception>
        internal EntityAccessControlChecker(IUserRoleRepository roleRepository, IQueryRepository queryRepository,
                                            IEntityTypeRepository entityTypeRepository)
        {
            if (roleRepository == null)
            {
                throw new ArgumentNullException("roleRepository");
            }
            if (queryRepository == null)
            {
                throw new ArgumentNullException("queryRepository");
            }
            if (entityTypeRepository == null)
            {
                throw new ArgumentNullException("entityTypeRepository");
            }

            RoleRepository       = roleRepository;
            QueryRepository      = queryRepository;
            EntityTypeRepository = entityTypeRepository;
        }
Example #10
0
 public ContractorRequirementsController(IContractorRepository contractorRepo,
                                         IContractRepository contractRepo,
                                         IPeriodRepository periodRepo,
                                         IRequirementRepository requirementRepo,
                                         IPresentationRepository presentationRepo,
                                         IPresentationServices presentationServ,
                                         IDocumentFileService documentFileServ,
                                         IWorkflowMessageService workflowMessageServ,
                                         IEntityTypeRepository entityTypeRepo)
 {
     contractorRepository   = contractorRepo;
     contractRepository     = contractRepo;
     periodRepository       = periodRepo;
     requirementRepository  = requirementRepo;
     presentationRepository = presentationRepo;
     presentationServices   = presentationServ;
     documentFileService    = documentFileServ;
     workflowMessageService = workflowMessageServ;
     entityTypeRepository   = entityTypeRepo;
 }
        /// <summary>
        /// Create a new <see cref="SecuresFlagEntityAccessControlChecker"/> using
        /// the given <paramref name="checker"/>.
        /// </summary>
        /// <param name="checker">
        /// The <see cref="IEntityAccessControlChecker"/> that checks access
        /// to specific entities. This cannot be null.
        /// </param>
        /// <param name="entityMemberRequestFactory">
        /// The <see cref="IEntityMemberRequestFactory"/> that generates entity member requests
        /// to determine which related entities to check security on. This cannot be null.
        /// </param>
        /// <param name="typeRepository">
        /// A <see cref="IEntityTypeRepository"/>. This cannot be null.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// No argument can be null.
        /// </exception>
        internal SecuresFlagEntityAccessControlChecker(IEntityAccessControlChecker checker,
                                                       IEntityMemberRequestFactory entityMemberRequestFactory, IEntityTypeRepository typeRepository)
        {
            if (checker == null)
            {
                throw new ArgumentNullException(nameof(checker));
            }
            if (typeRepository == null)
            {
                throw new ArgumentNullException(nameof(typeRepository));
            }
            if (entityMemberRequestFactory == null)
            {
                throw new ArgumentNullException(nameof(entityMemberRequestFactory));
            }

            Checker                    = checker;
            TypeRepository             = typeRepository;
            EntityMemberRequestFactory = entityMemberRequestFactory;
        }
Example #12
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;
 }
Example #13
0
 public UpdateEntityTypeCommandHandler(IEntityTypeRepository repository)
 {
     this.repository = repository;
 }
Example #14
0
 public GetEntityTypeQuery(IEntityTypeRepository repository)
 {
     this.repository = repository;
 }
Example #15
0
 public EntityTypesController(IEntityTypeRepository entityTypeRepository,
                              IHubContext <SignalRServer> signalRHub)
 {
     _entityTypeRepository = entityTypeRepository;
     _signalRHub           = signalRHub;
 }
Example #16
0
 public EntityTypeController(IEntityTypeRepository EntityTypeRepository)
 {
     _EntityTypeRepository = EntityTypeRepository;
 }
 public CreateEntityCommandHandler(IEntityRepository repository,
                                   IEntityTypeRepository teRepository)
 {
     _entityRepository = repository;
     _teRepository     = teRepository;
 }
 public DocumentationsController(IDocumentationRepository documentationRepo, IEntityTypeRepository entityTypeRepo)
 {
     documentationRepository = documentationRepo;
     entityTypeRepository    = entityTypeRepo;
 }
Example #19
0
 public Repository(IEntityTypeRepository entityTypeRepository,
                   IEntityRepository entityRepository)
 {
     EntityTypes = entityTypeRepository;
     Entities = entityRepository;
 }
 public HomeController(IEntityTypeRepository repos)
 {
     _repos = repos;
 }
Example #21
0
 public EntityTypeController(ApplicationDbContext context, IEntityTypeRepository repository)
 {
     _context    = context;
     _repository = repository;
 }