/// <summary>Initalizes new ProductModelProductDescription child object. Not added to collection.</summary> public static ProductModelProductDescription NewProductModelProductDescriptionChildren(ProductModel parent) { var newItem = new ProductModelProductDescription(); newItem.NullCheckEnabled = false; newItem.DescriptionID = ArrayUtil.NextNegativeId<ProductModelProductDescriptionEntity>(parent.ProductModelProductDescriptionChildren, (item) => (item.DescriptionID)); newItem.SetParent(newItem.Table.FK_ProductModelID, parent); return newItem; }
/// <summary>Po potrebi konvertira entity u business objekt.</summary> public static ProductModel ConvertEntityToBusinessObject(ProductModelEntity entity) { ProductModel bizobj = entity as ProductModel; if (bizobj == null) bizobj = new ProductModel(entity); return bizobj; }
/// <summary>Kreira novi objekt i postavlja default vrijednosti.</summary> public static ProductModel NewProductModel(IActor creator) { var newObject = new ProductModel(-1) { NullCheckEnabled = false }; return newObject; }
/// <summary>Non-business object elemente kolekcije konvertira u business objekte.</summary> public static void ConvertEntitiesToBusinessObjects(IEntityCollection entities) { for (int i = 0; i < entities.Count; i++) { ProductModelEntity entity = (ProductModelEntity)entities[i]; bool isBizObject = (entity is IBusinessObject); if (!isBizObject) entities[i] = new ProductModel(entity); } }