Esempio n. 1
0
    public void RemoveBud(Order_Bud bud)
    {
        List <Order_Bud> newList = new List <Order_Bud>();

        foreach (Order_Bud order_bud in budList)
        {
            if (!order_bud.GetStrain().strainID.Equals(bud.GetStrain().strainID))
            {
                newList.Add(order_bud);
            }
        }
        budList = newList;
        parentPanel.orderFormPanel.UpdateList();
    }
Esempio n. 2
0
 bool CheckAgainstList(Order_Bud bud)
 {
     if (budList != null)
     {
         foreach (Order_Bud pro in budList)
         {
             if (pro != null)
             {
                 if (pro.GetStrain().name.Equals(bud.GetStrain().name))
                 {
                     return(true);
                 }
             }
         }
     }
     return(false);
 }
Esempio n. 3
0
    public void AddBud(Strain newStrain, float weight)
    {
        Order_Bud newOrderBud = new Order_Bud(this, weight, newStrain);

        if (CheckAgainstList(newOrderBud))
        {
            IncreaseQuantity(newStrain, weight);
        }
        else
        {
            try
            {
                budList.Add(newOrderBud);
            }
            catch (System.NullReferenceException)
            {
                // Order doesnt technically exist yet, so dont add items
            }
        }
    }