public void RemovePurchase(Wholesale_Purchase m) { if (this.Purchases.Contains(m)) { this.Purchases.Remove(m); } }
private Batch(DateTime due_Date, int number, Medicine medicine, Wholesale_Purchase wholesale_Purchase, Order order) { Due_Date = due_Date; Number = number; Medicine = medicine; Wholesale_Purchase = wholesale_Purchase; }
public void AddPurchase(Wholesale_Purchase m) { if (!this.Purchases.Contains(m)) { this.Purchases.Add(m); } }
/// <summary> /// Creates and Adds Batch as part of Order /// </summary> /// <exception cref="System.Exception"> Batch was already used</exception> /// <param name="used_batches">List of alreadyu used batches</param> /// <param name="due_date">DateTime</param> /// <param name="number">count of prod in batch</param> /// <param name="medicine">Meds</param> /// <param name="wholesale_Purchase">wholesale_purchase</param> public void Create_Batch(List <Batch> used_batches, DateTime due_date, int number, Medicine medicine, Wholesale_Purchase wholesale_Purchase) { Batch new_Batch = Batch.CreateBatch(due_date, number, medicine, wholesale_Purchase, this); if (used_batches.Contains(new_Batch)) { throw new Exception("This Batch was already used"); } Add_Batch(new_Batch); }
/// <summary> /// Creates batch if as part of order /// </summary> /// <returns> /// new Batch /// </returns> /// <param name="due_Date">DateTime </param> /// <param name="number">count of med</param> /// <param name="medicine">Medicine </param> /// <param name="wholesale_Purchase">Wholesale Purchase</param> public static Batch CreateBatch(DateTime due_Date, int number, Medicine medicine, Wholesale_Purchase wholesale_Purchase, Order order) { if (order == null) { throw new Exception("no Order was provided"); } else { return(new Batch(due_Date, number, medicine, wholesale_Purchase, order)); } }