Exemplo n.º 1
0
		/// <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;
		}
Exemplo n.º 2
0
		/// <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;
		}
Exemplo n.º 3
0
		/// <summary>Kreira novi objekt i postavlja default vrijednosti.</summary>
		public static ProductModel NewProductModel(IActor creator)
		{
			var newObject = new ProductModel(-1)
			{
				NullCheckEnabled = false
			};

			return newObject;
		}
Exemplo n.º 4
0
		/// <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);
			}
		}