Back to Implementing the Collectionusing System.Drawing;
using System.IO;
public class ProductImagesCollection : EPS.Business.BusinessObjects.EntitySubItemCollection
public ProductImagesCollection (IBusinessEntity parentEntity): base(parentEntity)
{ }
protected override void Configure()
{
this.PrimaryKeyField = "image_pk";
this.ForeignKeyField = "product_fk";
this.ParentTableName = "products";
this.ParentTablePrimaryKeyField = "product_pk";
}
public override EPS.Business.BusinessObjects.EntitySubItemCollectionItem GetItemObject()
{
return (EntitySubItemCollectionItem)(new ProductImageEntity());
}
public new ProductImageEntity this[int index]
{
get
{
return (ProductImageEntity)this.GetItemByIndex(index);
}
}
public void Add(string label, Bitmap image)
{
ProductImageEntity entImage = (ProductImageEntity)this.AddNewRow();
entImage.Label = label;
entImage.Image = image;
}
}
Back to Implementing the Collection