Ejemplo n.º 1
0
        public static int GetItemCost <T>(T item, int defaultCost, IsItemInSaleDelegate <T> isItemInSale)
        {
            int num = defaultCost;
            int itemDiscountPercentage = GetItemDiscountPercentage(item, isItemInSale);

            if (itemDiscountPercentage != 0)
            {
                num = (int)((double)(float)num - Math.Ceiling((float)num * ((float)itemDiscountPercentage / 100f)));
            }
            return(num);
        }
Ejemplo n.º 2
0
        public static int GetItemDiscountPercentage <T>(T item, IsItemInSaleDelegate <T> isItemInSale)
        {
            List <CellPhoneSaleActivityDefinition> currentSales = GetCurrentSales();

            for (int i = 0; i < currentSales.Count; i++)
            {
                if (isItemInSale(currentSales[i], item))
                {
                    return(currentSales[i].DiscountPercentage);
                }
            }
            return(0);
        }