Exemplo n.º 1
0
        void UpdateAppointment()
        {
            if (!ModelState.IsValid)
            {
                return;
            }

            ValidationSchedule[] schedules = SchedulerDataHelper.GetAppointmentsToUpdate <ValidationSchedule>(
                SchedulerDataHelper.CustomDataObject, SchedulerDemoHelper.CustomAppointmentStorage);
            foreach (var schedule in schedules)
            {
                if (!TryValidateModel(schedule))
                {
                    ViewData["EditableSchedule"] = schedule;
                    break;
                }
                CarsDataProvider.UpdateSchedule <ValidationSchedule>(schedule);
            }
        }