Esempio n. 1
0
 public void Count()
 {
     Cost           = Thing.PriceOfProduct.GetGross();
     Cost.Value    *= Volume;
     Value          = Cost.Value;
     NameOfCurrency = Cost.NameOfCurrency;
 }
Esempio n. 2
0
 public Item(Product.Product product, int vol)
 {
     this.Thing = product;
     ChangeVolume(vol);
     Cost           = new Product.Money(0.0f, Product.Waluta.PLN);
     Value          = Cost.Value;
     NameOfCurrency = Cost.NameOfCurrency;
     IdProdukt      = Thing.IDProduct;
 }
Esempio n. 3
0
        public Item()
        {
            Random rand = new Random();

            Cost           = new Product.Money();
            Thing          = new Product.Product();
            Volume         = rand.Next(1, 100);
            IdProdukt      = rand.Next(1, 100);
            Value          = Cost.Value;
            NameOfCurrency = Cost.NameOfCurrency;
        }
Esempio n. 4
0
        private void Dodaj(List <Product.Money> lista, Product.Money cost)
        {
            bool flag = true;

            foreach (Product.Money a in lista)
            {
                if (a.NameOfCurrency.Equals(cost.NameOfCurrency))
                {
                    a.Value += cost.Value;
                    flag     = false;
                }
            }
            if (flag)
            {
                lista.Add(cost);
            }
        }
Esempio n. 5
0
 public void Count(Client.Discount dis)
 {
     if (Thing.IDProduct == dis.IdProduct)
     {
         if (dis.Type == Client.Bonus.Netto)
         {
             Cost        = Thing.PriceOfProduct.NetPrice;
             Cost.Value *= Volume;
         }
         if (dis.Type == Client.Bonus.Zniżka)
         {
             Cost        = Thing.PriceOfProduct.NetPrice;
             Cost.Value *= Volume;
             Cost.Value *= (float)(1.0f - dis.ValueOfBonus);
         }
         Value          = Cost.Value;
         NameOfCurrency = Cost.NameOfCurrency;
     }
     else
     {
         throw new Exception("Nie ta zniżka.\n");
     }
 }