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;
            }
        }
Esempio n. 3
0
 public void RemoveProductBatch(ProductBatch productBatch)
 {
     ProductBatches.RemoveAll(batch => batch.BatchId == productBatch.BatchId);
 }
Esempio n. 4
0
 public void AddProductBatch(ProductBatch productBatch)
 {
     ProductBatches.Add(productBatch);
     ProductBatchesToExpired = ProductBatches.Where(batch => DateTime.Now.AddDays(30) > batch.ExpiredDate).ToList();
 }