コード例 #1
0
        //
        // GET: /Counter/
        public ActionResult Index(int prmCounter = 0, bool prmButtonClicked = false)
        {
            try
            {
                if (prmButtonClicked)
                {
                    prmCounter++;
                }

                CounterModels.Counter = prmCounter;
                this.CounterModels.CounterInsert(CounterModels);

                return(View(CounterModels));
            }
            catch (Exception e)
            {
                var viewModelError = new CounterModels
                {
                    Counter = CounterModels.CounterLimit,
                    Message = e.Message
                };
                return(View(viewModelError));
            }
        }
コード例 #2
0
 public CounterController()
 {
     CounterModels = new CounterModels();
 }