Exemplo n.º 1
0
        protected override void updateMaterialCost()
        {
            double stairCost      = 0;
            double normCost       = 0;
            double nl             = Nails / 100;
            double addOnMetalCost = 0;

            if (Metals.Count > 0 && MiscMetals.Count > 0)
            {
                IEnumerable <Metal> stairMetals = Metals.Where(x => x.IsStairMetalChecked == true);
                if (stairMetals.Count() > 0)
                {
                    stairCost = stairMetals.Select(x => x.MaterialExtension).Sum();
                }
                IEnumerable <AddOnMetal> selectedAddOnMetals = AddOnMetals.Where(x => x.IsMetalChecked == true);
                if (selectedAddOnMetals.Count() > 0)
                {
                    addOnMetalCost = selectedAddOnMetals.Select(x => x.MaterialExtension).Sum();
                }

                //IEnumerable<Metal> normMetals = Metals.Where(x => x.Name.Contains("STAIR") == false);
                //if (normMetals.Count() > 0)
                //{
                //    normCost = normMetals.Select(x => x.MaterialExtension).Sum();
                //}

                //double misSum = Metals.Select(x => x.MaterialExtension).Sum() * nl;

                TotalMaterialCost = Math.Round((normCost + stairCost) * (1 + nl) + addOnMetalCost * (1 + nl) + MiscMetals.Select(x => x.MaterialExtension).Sum(), 2);
            }
        }
Exemplo n.º 2
0
        public override void updateLaborCost()
        {
            double stairCost                = 0;
            double addOnMetalCost           = 0;
            double normCost                 = 0;
            IEnumerable <Metal> stairMetals = Metals.Where(x => x.IsStairMetalChecked == true);

            if (stairMetals.Count() > 0)
            {
                stairCost = stairMetals.Select(x => x.LaborExtension).Sum();
            }

            //IEnumerable<Metal> normMetals = Metals.Where(x => x.Name.Contains("STAIR") == false);
            //if (normMetals.Count() > 0)
            //{
            //    normCost = normMetals.Select(x => x.LaborExtension).Sum();
            //}

            //New Changes for Addon Metals
            IEnumerable <AddOnMetal> selectedAddOnMetals = AddOnMetals.Where(x => x.IsMetalChecked);

            if (selectedAddOnMetals.Count() > 0)
            {
                addOnMetalCost = selectedAddOnMetals.Select(x => x.LaborExtension).Sum();
            }

            normCost = Math.Round(normCost + stairCost + addOnMetalCost + MiscMetals.Select(x => x.LaborExtension).Sum(), 2);

            if (isPrevailingWage)
            {
                if (isDiscount)
                {
                    TotalLaborCost = Math.Round(normCost * (1 + prevailingWage + deductionOnLargeJob), 2);
                }
                else
                {
                    TotalLaborCost = Math.Round(normCost * (1 + prevailingWage), 2);
                }
            }
            else
            {
                if (isDiscount)
                {
                    TotalLaborCost = Math.Round(normCost * (1 + deductionOnLargeJob), 2);
                }
                else
                {
                    TotalLaborCost = Math.Round(normCost, 2);
                }
            }
        }