Exemplo n.º 1
0
        public ActionResult FlooringCalculator(FloorInputs inputs)
        {
            if (ModelState.IsValid)
            {
                var calc = new FlooringCalculator();
                var floorData = new FloorCalculation();
                floorData.Width = inputs.Width.Value;
                //what does .Value do here?  allows nullabe decimal to convert to target type decimal?
                floorData.Length = inputs.Length.Value;
                floorData.CostPerUnit = inputs.CostPerUnit.Value;

                var result = calc.CalculateFloor(floorData);
                inputs.FlooringCost = result.FlooringCost;
                inputs.Area = result.Area;
                inputs.LaborCost = result.LaborCost;
                inputs.TotalCostEstimate = result.TotalCostEstimate;
                return View("FlooringCalculator", inputs);
            }
            else
            {
                return View("FlooringCalculator");
            }
        }
Exemplo n.º 2
0
 public ActionResult FlooringCalculator()
 {
     var model = new FloorInputs();
     return View(model);
 }