/// <summary>Initializes a new instance of the <see cref="DynamicRelation"/> class.</summary> /// <param name="leftOperand">The left operand, which is an entity.</param> /// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param> /// <param name="rightOperand">The right operand which is an entity.</param> /// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the left operand (only alias if you have to), specify string.Empty.</param> /// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param> /// <param name="onClause">The on clause for the join.</param> public DynamicRelation(ProductSearchEngine.EntityType leftOperand, JoinHint joinType, ProductSearchEngine.EntityType rightOperand, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause) { this.InitClass(joinType, aliasLeftOperand, aliasRightOperand, onClause, GeneralEntityFactory.Create(leftOperand), GeneralEntityFactory.Create(rightOperand)); }
/// <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(ProductSearchEngine.EntityType entityTypeToCreate) { IEntityFactory factoryToUse = null; switch(entityTypeToCreate) { case ProductSearchEngine.EntityType.BrandEntity: factoryToUse = new BrandEntityFactory(); break; case ProductSearchEngine.EntityType.CategoryEntity: factoryToUse = new CategoryEntityFactory(); break; case ProductSearchEngine.EntityType.CityEntity: factoryToUse = new CityEntityFactory(); break; case ProductSearchEngine.EntityType.CommentEntity: factoryToUse = new CommentEntityFactory(); break; case ProductSearchEngine.EntityType.KeywordEntity: factoryToUse = new KeywordEntityFactory(); break; case ProductSearchEngine.EntityType.LastViewedProductEntity: factoryToUse = new LastViewedProductEntityFactory(); break; case ProductSearchEngine.EntityType.MembershipEntity: factoryToUse = new MembershipEntityFactory(); break; case ProductSearchEngine.EntityType.ProductEntity: factoryToUse = new ProductEntityFactory(); break; case ProductSearchEngine.EntityType.ProductKeywordEntity: factoryToUse = new ProductKeywordEntityFactory(); break; case ProductSearchEngine.EntityType.ProductPhotoEntity: factoryToUse = new ProductPhotoEntityFactory(); break; case ProductSearchEngine.EntityType.ProductSpecificationEntity: factoryToUse = new ProductSpecificationEntityFactory(); break; case ProductSearchEngine.EntityType.RateEntity: factoryToUse = new RateEntityFactory(); break; case ProductSearchEngine.EntityType.RoleEntity: factoryToUse = new RoleEntityFactory(); break; case ProductSearchEngine.EntityType.StoreEntity: factoryToUse = new StoreEntityFactory(); break; case ProductSearchEngine.EntityType.StoreInformationEntity: factoryToUse = new StoreInformationEntityFactory(); break; case ProductSearchEngine.EntityType.WebTrackerEntity: factoryToUse = new WebTrackerEntityFactory(); break; } IEntity toReturn = null; if(factoryToUse != null) { toReturn = factoryToUse.Create(); } return toReturn; }
/// <summary>Initializes a new instance of the <see cref="DynamicRelation"/> class.</summary> /// <param name="leftOperand">The left operand.</param> /// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param> /// <param name="rightOperand">The right operand which is an entity type.</param> /// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param> /// <param name="onClause">The on clause for the join.</param> public DynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, ProductSearchEngine.EntityType rightOperand, string aliasRightOperand, IPredicate onClause) { this.InitClass(joinType, string.Empty, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand)); }
/// <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(ProductSearchEngine.EntityType typeToUse) { switch(typeToUse) { case ProductSearchEngine.EntityType.BrandEntity: return new BrandCollection(); case ProductSearchEngine.EntityType.CategoryEntity: return new CategoryCollection(); case ProductSearchEngine.EntityType.CityEntity: return new CityCollection(); case ProductSearchEngine.EntityType.CommentEntity: return new CommentCollection(); case ProductSearchEngine.EntityType.KeywordEntity: return new KeywordCollection(); case ProductSearchEngine.EntityType.LastViewedProductEntity: return new LastViewedProductCollection(); case ProductSearchEngine.EntityType.MembershipEntity: return new MembershipCollection(); case ProductSearchEngine.EntityType.ProductEntity: return new ProductCollection(); case ProductSearchEngine.EntityType.ProductKeywordEntity: return new ProductKeywordCollection(); case ProductSearchEngine.EntityType.ProductPhotoEntity: return new ProductPhotoCollection(); case ProductSearchEngine.EntityType.ProductSpecificationEntity: return new ProductSpecificationCollection(); case ProductSearchEngine.EntityType.RateEntity: return new RateCollection(); case ProductSearchEngine.EntityType.RoleEntity: return new RoleCollection(); case ProductSearchEngine.EntityType.StoreEntity: return new StoreCollection(); case ProductSearchEngine.EntityType.StoreInformationEntity: return new StoreInformationCollection(); case ProductSearchEngine.EntityType.WebTrackerEntity: return new WebTrackerCollection(); default: return null; } }
/// <summary>Gets the factory of the entity with the ProductSearchEngine.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(ProductSearchEngine.EntityType typeOfEntity) { return GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType()); }
/// <summary>CTor</summary> /// <param name="entityName">Name of the entity.</param> /// <param name="typeOfEntity">The type of entity.</param> public EntityFactoryBase(string entityName, ProductSearchEngine.EntityType typeOfEntity) : base(entityName) { _typeOfEntity = typeOfEntity; }
/// <summary>General factory entrance method which will return an EntityFields object with the format generated by the factory specified</summary> /// <param name="relatedEntityType">The type of entity the fields are for</param> /// <returns>The IEntityFields instance requested</returns> public static IEntityFields CreateEntityFieldsObject(ProductSearchEngine.EntityType relatedEntityType) { return FieldInfoProviderSingleton.GetInstance().GetEntityFields(InheritanceInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance(), _entityTypeNamesCache[relatedEntityType]); }
private void GetData(ProductSearchEngine.EntityClasses.ProductEntity product) { ProductTitle = product.Title; ProductTitleTextBox.Text = product.Title; ProductDetailTextBox.Text = product.DetailDescription; ProductFreeShippingStatusRadioButtonList.SelectedIndex = (bool)product.IsFreeShipping ? 1 : 0; ProductNewItemStatusRadioButtonList.SelectedIndex = (bool)product.IsNewItem ? 1 : 0; ProductRedirectUrlTextBox.Text = product.RedirectUrl; ProductPriceTextBox.Text = product.Price.ToString(); CategoryDropDownList.DataSource = new ProductSearchEngine.Business.Adapters.CategoryAdapter().GetMainCategories(); CategoryDropDownList.DataTextField = "Name"; CategoryDropDownList.DataValueField = "Id"; CategoryDropDownList.DataBind(); CategoryDropDownList.Items.FindByValue(((int)new ProductSearchEngine.Business.Adapters.CategoryAdapter().GetMainCatehoryIdBySubCategoryId((int)product.CategoryId)).ToString()).Selected = true; CategoryDropDownList_DataBound(); ListItem liSubCategory = SubCategoryDropDownList.Items.FindByValue(product.CategoryId.ToString()); if (liSubCategory != null) liSubCategory.Selected = true; BrandDropDownList.DataSource = new ProductSearchEngine.Business.Adapters.BrandAdapter().GetBrandList(); BrandDropDownList.DataTextField = "Name"; BrandDropDownList.DataValueField = "Id"; BrandDropDownList.DataBind(); ListItem li = BrandDropDownList.Items.FindByValue(product.BrandId.ToString()); if (li != null) li.Selected = true; ProductPhotosRepeater.DataSource = product.ProductPhotos; ProductPhotosRepeater.DataBind(); ProductSpecificationsRepeater.DataSource = product.ProductSpecifications; ProductSpecificationsRepeater.DataBind(); ProductKeywordRepeater.DataSource = product.ProductKeywords; ProductKeywordRepeater.DataBind(); }