コード例 #1
0
        public ActionResult Index(Calculator calc, string calculate)
        {
            SimpleCalc simpleCalc = new SimpleCalc();

            if (calculate == "divide" && calc.number2 == 0)
            {
                calc.message = "Division By Zero!!!";
            }
            else
            {
                calc.total = simpleCalc.OpertorSwitch(calculate, calc.number1, calc.number2);
            }
            return(View(calc));
        }