Beispiel #1
0
 public void Fill()
 {
     for (int i = 0; i < quantity; i++)
     {
         Console.WriteLine($"-> Producto {i} <-");
         list[i] = new ProductSellList();
     }
 }
Beispiel #2
0
        // Fill restand properties
        public void SetData()
        {
            for (int i = 0; i < list.Length; i++)
            {
                ProductSellList product = list[i]; // total current product
                total += product.GetTotal();       // add to total list
                averaguePriceProducts += product.GetProduct().GetPrice();
                if (product.GetQuantity() > list[bestSellingProductIndex].GetQuantity())
                {
                    bestSellingProductIndex = i;
                }
            }

            averaguePriceProducts /= quantity;
        }
Beispiel #3
0
        // Fill restand properties
        public void SetData()
        {
            total = Math.Round(list.Select(product => product.GetTotal()).ToList().Sum(), 2);
            bestSellingProduct    = list.OrderBy(product => product.GetProduct().GetPrice()).ToList().First();
            averaguePriceProducts = list.Average(product => product.GetProduct().GetPrice());

            /*for (int i = 0; i < list.Length; i++)
             * {
             *  ProductSellList product = list[i]; // total current product
             *  total += product.GetTotal(); // add to total list
             *  averaguePriceProducts += product.GetProduct().GetPrice();
             *  if (product.GetQuantity() > list[bestSellingProductIndex].GetQuantity())
             *      bestSellingProductIndex = i;
             * }
             *
             * averaguePriceProducts /= quantity;*/
        }