Esempio n. 1
0
            /// <summary>
            /// Changes the refunds
            /// </summary>
            /// <param name="product">The product which refunds should be changed</param>
            /// <param name="amount">The amount of sales</param>
            public static void Refunds(SoftwareProduct product, int amount)
            {
                int effectVal  = amount;
                int totalsales = 0;

                for (int i = 0; i < product.GetUnitSales(false).Count; i++)
                {
                    totalsales += product.GetUnitSales(false)[i];
                }
                if (totalsales < effectVal)
                {
                    effectVal = totalsales;
                }
                float refundcost = product.Price * effectVal;

                product.AddToCashflow(0, 0, effectVal, -refundcost, 0, TimeOfDay.Instance.GetDate());
            }
Esempio n. 2
0
            /// <summary>
            /// Changes the online sales
            /// </summary>
            /// <param name="product">The product which sales should be changed</param>
            /// <param name="amount">The amount of sales</param>
            public static void Online(SoftwareProduct product, int amount)
            {
                float price = product.Price;

                product.AddToCashflow(amount, 0, 0, amount * price, 0, TimeOfDay.Instance.GetDate());
            }