public ActionResult UpdateScheduleItem(ScheduleDto scheduleDto)
        {
            ActionResult ActionResult = new ActionResult();
            dynamic      Result       = new ExpandoObject();

            try
            {
                if (scheduleDto.RetryTimeLapse == 0)
                {
                    scheduleDto.RetryTimeLapse = Null.NullInteger;
                }

                if (!SchedulerManager.VerifyValidTimeLapseRetry(scheduleDto.TimeLapse, scheduleDto.TimeLapseMeasurement, scheduleDto.RetryTimeLapse, scheduleDto.RetryTimeLapseMeasurement))
                {
                    ActionResult.AddError("InvalidFrequencyAndRetry", Localization.GetString("InvalidFrequencyAndRetry", Components.Constants.TaskSchedulerResourcesFile));
                }
                else
                {
                    ScheduleItem existingItem = SchedulingProvider.Instance().GetSchedule(scheduleDto.ScheduleID);

                    ScheduleItem updatedItem = _controller.CreateScheduleItem(scheduleDto.TypeFullName, scheduleDto.FriendlyName, scheduleDto.TimeLapse, scheduleDto.TimeLapseMeasurement,
                                                                              scheduleDto.RetryTimeLapse, scheduleDto.RetryTimeLapseMeasurement, scheduleDto.RetainHistoryNum, scheduleDto.AttachToEvent, scheduleDto.CatchUpEnabled,
                                                                              scheduleDto.Enabled, scheduleDto.ObjectDependencies, scheduleDto.ScheduleStartDate, scheduleDto.Servers);
                    updatedItem.ScheduleID = scheduleDto.ScheduleID;


                    if (updatedItem.ScheduleStartDate != existingItem.ScheduleStartDate ||
                        updatedItem.Enabled ||
                        updatedItem.Enabled != existingItem.Enabled ||
                        updatedItem.TimeLapse != existingItem.TimeLapse ||
                        updatedItem.RetryTimeLapse != existingItem.RetryTimeLapse ||
                        updatedItem.RetryTimeLapseMeasurement != existingItem.RetryTimeLapseMeasurement ||
                        updatedItem.TimeLapseMeasurement != existingItem.TimeLapseMeasurement)
                    {
                        SchedulingProvider.Instance().UpdateSchedule(updatedItem);
                        ActionResult.Message = Localization.GetString("ScheduleItemUpdateSuccess", Components.Constants.TaskSchedulerResourcesFile);
                    }
                    else
                    {
                        ActionResult.Message = Localization.GetString("ScheduleItemUpdateSuccess", Components.Constants.TaskSchedulerResourcesFile);
                        SchedulingProvider.Instance().UpdateScheduleWithoutExecution(updatedItem);
                    }
                    Result.Status        = "Success";
                    Result.ScheduleItems = SchedulerManager.GetScheduleItems(0, 14);
                    ActionResult.Data    = Result;
                }
            }
            catch (Exception exc)
            {
                Exceptions.LogException(exc);
                Result.Status = exc.Message.ToString();
                ActionResult.AddError("ScheduleItemUpdateError", Localization.GetString("ScheduleItemUpdateError", Components.Constants.TaskSchedulerResourcesFile));
            }
            return(ActionResult);
        }