Example #1
0
        public ActionResult Detail()
        {
            MaintenanceViewModel02 vm = new MaintenanceViewModel02();

            vm.HandleRequest();

            return(View(vm));
        }
Example #2
0
        public ActionResult Detail(MaintenanceViewModel02 vm)
        {
            if (!ModelState.IsValid && vm.EventCommand == "save")
            {
                vm.IsValid = false;
                vm.SetModeAfterValidation();
            }
            else
            {
                vm.HandleRequest();

                // NOTE: Must clear the model state in order to bind
                //       the @Html helpers to the new model values
                ModelState.Clear();
            }

            return(View(vm));
        }