예제 #1
0
        public ActionResult Edit()
        {
            ProductMaintenanceViewModel vm = new ProductMaintenanceViewModel();

            vm.HandleRequest();

            return(View(vm));
        }
예제 #2
0
        public ActionResult Edit(ProductMaintenanceViewModel 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));
        }