///<summary> /// Removes the batch. /// </summary> /// <param name="contact">The the batch.</param> public void RemoveBatch(ProductBatch batch) { if (ProductBatches == null) { return; } ProductBatches.Remove(batch); }
///<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; } }
public void RemoveProductBatch(ProductBatch productBatch) { ProductBatches.RemoveAll(batch => batch.BatchId == productBatch.BatchId); }
public void AddProductBatch(ProductBatch productBatch) { ProductBatches.Add(productBatch); ProductBatchesToExpired = ProductBatches.Where(batch => DateTime.Now.AddDays(30) > batch.ExpiredDate).ToList(); }