Ejemplo n.º 1
0
        ///<summary>
        /// Removes the batch.
        /// </summary>
        /// <param name="contact">The the batch.</param>
        public void RemoveBatch(ProductBatch batch)
        {
            if (ProductBatches == null)
            {
                return;
            }

            ProductBatches.Remove(batch);
        }
Ejemplo n.º 2
0
        ///<summary>
        /// Adds the batch.
        /// </summary>
        /// <param name="contact">The batch.</param>
        public void AddBatch(ProductBatch batch)
        {
            if (ProductBatches == null)
            {
                ProductBatches = new List <ProductBatch>();
            }

            // If the address is not already in the list
            if (!ProductBatches.Any(x => x.PrimaryKey == batch.PrimaryKey))
            {
                ProductBatches.Add(batch);
                batch.Product = this;
            }
        }