Exemplo n.º 1
0
 /// <summary>CTor</summary>
 /// <param name="entityName">Name of the entity.</param>
 /// <param name="typeOfEntity">The type of entity.</param>
 public EntityFactoryBase(string entityName, SD.HnD.DAL.EntityType typeOfEntity)
     : base(entityName)
 {
     _typeOfEntity = typeOfEntity;
 }
Exemplo n.º 2
0
 /// <summary>Gets the factory of the entity with the SD.HnD.DAL.EntityType specified</summary>
 /// <param name="typeOfEntity">The type of entity.</param>
 /// <returns>factory to use or null if not found</returns>
 public static IEntityFactory GetFactory(SD.HnD.DAL.EntityType typeOfEntity)
 {
     return(GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType()));
 }
Exemplo n.º 3
0
        /// <summary>Creates a new entity collection</summary>
        /// <param name="typeToUse">The entity type to create the collection for.</param>
        /// <returns>A new entity collection object.</returns>
        public static IEntityCollection Create(SD.HnD.DAL.EntityType typeToUse)
        {
            switch (typeToUse)
            {
            case SD.HnD.DAL.EntityType.ActionRightEntity:
                return(new ActionRightCollection());

            case SD.HnD.DAL.EntityType.AttachmentEntity:
                return(new AttachmentCollection());

            case SD.HnD.DAL.EntityType.AuditActionEntity:
                return(new AuditActionCollection());

            case SD.HnD.DAL.EntityType.AuditDataCoreEntity:
                return(new AuditDataCoreCollection());

            case SD.HnD.DAL.EntityType.AuditDataMessageRelatedEntity:
                return(new AuditDataMessageRelatedCollection());

            case SD.HnD.DAL.EntityType.AuditDataThreadRelatedEntity:
                return(new AuditDataThreadRelatedCollection());

            case SD.HnD.DAL.EntityType.BookmarkEntity:
                return(new BookmarkCollection());

            case SD.HnD.DAL.EntityType.ForumEntity:
                return(new ForumCollection());

            case SD.HnD.DAL.EntityType.ForumRoleForumActionRightEntity:
                return(new ForumRoleForumActionRightCollection());

            case SD.HnD.DAL.EntityType.IPBanEntity:
                return(new IPBanCollection());

            case SD.HnD.DAL.EntityType.MessageEntity:
                return(new MessageCollection());

            case SD.HnD.DAL.EntityType.RoleEntity:
                return(new RoleCollection());

            case SD.HnD.DAL.EntityType.RoleAuditActionEntity:
                return(new RoleAuditActionCollection());

            case SD.HnD.DAL.EntityType.RoleSystemActionRightEntity:
                return(new RoleSystemActionRightCollection());

            case SD.HnD.DAL.EntityType.RoleUserEntity:
                return(new RoleUserCollection());

            case SD.HnD.DAL.EntityType.SectionEntity:
                return(new SectionCollection());

            case SD.HnD.DAL.EntityType.SupportQueueEntity:
                return(new SupportQueueCollection());

            case SD.HnD.DAL.EntityType.SupportQueueThreadEntity:
                return(new SupportQueueThreadCollection());

            case SD.HnD.DAL.EntityType.SystemDataEntity:
                return(new SystemDataCollection());

            case SD.HnD.DAL.EntityType.ThreadEntity:
                return(new ThreadCollection());

            case SD.HnD.DAL.EntityType.ThreadSubscriptionEntity:
                return(new ThreadSubscriptionCollection());

            case SD.HnD.DAL.EntityType.UserEntity:
                return(new UserCollection());

            case SD.HnD.DAL.EntityType.UserTitleEntity:
                return(new UserTitleCollection());

            default:
                return(null);
            }
        }
Exemplo n.º 4
0
        /// <summary>Creates a new, empty Entity object of the type specified</summary>
        /// <param name="entityTypeToCreate">The entity type to create.</param>
        /// <returns>A new, empty Entity object.</returns>
        public static IEntity Create(SD.HnD.DAL.EntityType entityTypeToCreate)
        {
            IEntityFactory factoryToUse = null;

            switch (entityTypeToCreate)
            {
            case SD.HnD.DAL.EntityType.ActionRightEntity:
                factoryToUse = new ActionRightEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.AttachmentEntity:
                factoryToUse = new AttachmentEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.AuditActionEntity:
                factoryToUse = new AuditActionEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.AuditDataCoreEntity:
                factoryToUse = new AuditDataCoreEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.AuditDataMessageRelatedEntity:
                factoryToUse = new AuditDataMessageRelatedEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.AuditDataThreadRelatedEntity:
                factoryToUse = new AuditDataThreadRelatedEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.BookmarkEntity:
                factoryToUse = new BookmarkEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.ForumEntity:
                factoryToUse = new ForumEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.ForumRoleForumActionRightEntity:
                factoryToUse = new ForumRoleForumActionRightEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.IPBanEntity:
                factoryToUse = new IPBanEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.MessageEntity:
                factoryToUse = new MessageEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.RoleEntity:
                factoryToUse = new RoleEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.RoleAuditActionEntity:
                factoryToUse = new RoleAuditActionEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.RoleSystemActionRightEntity:
                factoryToUse = new RoleSystemActionRightEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.RoleUserEntity:
                factoryToUse = new RoleUserEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.SectionEntity:
                factoryToUse = new SectionEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.SupportQueueEntity:
                factoryToUse = new SupportQueueEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.SupportQueueThreadEntity:
                factoryToUse = new SupportQueueThreadEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.SystemDataEntity:
                factoryToUse = new SystemDataEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.ThreadEntity:
                factoryToUse = new ThreadEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.ThreadSubscriptionEntity:
                factoryToUse = new ThreadSubscriptionEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.UserEntity:
                factoryToUse = new UserEntityFactory();
                break;

            case SD.HnD.DAL.EntityType.UserTitleEntity:
                factoryToUse = new UserTitleEntityFactory();
                break;
            }
            IEntity toReturn = null;

            if (factoryToUse != null)
            {
                toReturn = factoryToUse.Create();
            }
            return(toReturn);
        }
Exemplo n.º 5
0
 /// <summary>CTor</summary>
 /// <param name="entityName">Name of the entity.</param>
 /// <param name="typeOfEntity">The type of entity.</param>
 public EntityFactoryBase(string entityName, SD.HnD.DAL.EntityType typeOfEntity) : base(entityName)
 {
     _typeOfEntity = typeOfEntity;
 }