Exemple #1
0
        public double GetFinalPrice(List <Coating> c, WaterTreatment wtb, DryTreatment dtb, List <ToolType> tt, WaterTreatment wta, DryTreatment dta)
        {
            //bool IsCrosalChosen = false;

            // Price
            double price = 0;

            // Coatings
            foreach (Coating coating in c)
            {
                price += ((BasePrice * coating.factor) * Quantity);

                //if (coating.name.Contains("CROSAL"))
                //    IsCrosalChosen = true;
            }

            /* =============================== Dry og water treatment BEFORE ================================ */
            if (dtb.ToVolume != 0)
            {
                price += GetDryTreatmentPrice(dtb);
            }

            if (wtb.ToVolume != 0)
            {
                price += GetWaterTreatmentPrice(wtb);
            }

            /* =============================== Dry og water treatment AFTER ================================ */

            if (dta.ToVolume != 0)
            {
                price += GetDryTreatmentPrice(dta);
            }

            // Watertreatment BEFORE
            if (wta.ToVolume != 0)
            {
                //if (!IsCrosalChosen)
                price += GetWaterTreatmentPrice(wta);
            }

            // Tooltypes
            foreach (ToolType tooltype in tt)
            {
                price += ((BasePrice * tooltype.AddFactor) * Quantity);
            }

            // Return final price
            return(Math.Round(price, 2));
        }
Exemple #2
0
        private double GetDryTreatmentPrice(DryTreatment dt)
        {
            double treatmentPrice;

            switch (Quantity)
            {
            case 1:
            case 2:
                treatmentPrice = dt.QuantityLow * Quantity;
                break;

            case 3:
            case 4:
            case 5:
                treatmentPrice = dt.QuantityMid * Quantity;
                break;

            default:
                treatmentPrice = dt.QuantityHigh * Quantity;
                break;
            }

            return(treatmentPrice);
        }