コード例 #1
0
        public ActionResult LeapYearInput(LeapYearCalculatorModel request)
        {
            if (ModelState.IsValid)
            {
                var leapCalc = new LeapYearCalculator();
                var leapData = new LeapYearRequest();
                leapData.StartYear = request.StartYear.Value;
                leapData.EndYear   = request.EndYear.Value;

                var result = leapCalc.FindLeapYear(leapData);
                return(View("LeapYearOutput", result));
            }
            else
            {
                return(View(request));
            }
        }
コード例 #2
0
        public ActionResult LeapYearInput()
        {
            var model = new LeapYearCalculatorModel();

            return(View(model));
        }