Exemplo n.º 1
0
        public float getReducedCarbonValue(RecycleQuantity recycleQty)
        {
            float reducedCarbonValue = 0;

            float reducedGlassQty     = calculateReducedRecycle(recycleQty.glassQty, "Glass");
            float reducedAluminiumQty = calculateReducedRecycle(recycleQty.aluminiumQty, "Aluminium");
            float reducedSteelQty     = calculateReducedRecycle(recycleQty.steelQty, "Steel");
            float reducedPlasticsQty  = calculateReducedRecycle(recycleQty.plasticsQty, "Plastics");
            float reducedPcQty        = calculateReducedRecycle(recycleQty.pcQty, "Paper and Cardboard");
            float reducedOwcQty       = calculateReducedRecycle(recycleQty.owcQty, "Organic Waste(composting)");
            float reducedOwdQty       = calculateReducedRecycle(recycleQty.owdQty, "Organic Waste(digestion)");

            reducedCarbonValue = (reducedAluminiumQty + reducedGlassQty + reducedSteelQty + reducedPlasticsQty + reducedPcQty + reducedOwcQty + reducedOwdQty);

            return(reducedCarbonValue);
        }
Exemplo n.º 2
0
        public float getTotalCarbonValue(RecycleQuantity recycleQty)
        {
            float productionCarbonValue = 0;

            float totalGlassQty     = calculateTotalRecycle(recycleQty.glassQty, "Glass");
            float totalAluminiumQty = calculateTotalRecycle(recycleQty.aluminiumQty, "Aluminium");
            float totalSteelQty     = calculateTotalRecycle(recycleQty.steelQty, "Steel");
            float totalPlasticsQty  = calculateTotalRecycle(recycleQty.plasticsQty, "Plastics");
            float totalPcQty        = calculateTotalRecycle(recycleQty.pcQty, "Paper and Cardboard");
            float totalOwcQty       = calculateTotalRecycle(recycleQty.owcQty, "Organic Waste(composting)");
            float totalOwdQty       = calculateTotalRecycle(recycleQty.owdQty, "Organic Waste(digestion)");

            productionCarbonValue = (totalGlassQty + totalAluminiumQty + totalSteelQty + totalPlasticsQty + totalPcQty + totalOwcQty + totalOwdQty);

            return(productionCarbonValue);
        }
Exemplo n.º 3
0
        // [ValidateAntiForgeryToken]
        public ActionResult RecycleMain(RecycleQuantity recycleQty)
        {
            RecycleCalculate recycleCalc = new RecycleCalculate();


            //Reduced Recycle
            float finalReducedQty = recycleCalc.getReducedCarbonValue(recycleQty);


            //TotalRecycle
            float   finalTotalQty = recycleCalc.getTotalCarbonValue(recycleQty);
            double  reducedCO     = finalTotalQty - finalReducedQty;
            decimal decimalValue  = Math.Round((decimal)reducedCO, 2);


            ViewBag.finalTotalQty   = finalTotalQty;
            ViewBag.finalReducedQty = finalReducedQty;
            ViewBag.reducedCO       = decimalValue;



            return(View());
        }