Esempio 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);
        }
Esempio 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;
            }
        }