Пример #1
0
        public override int AddSchedule(ScheduleItem objScheduleItem)
        {
            Scheduler.CoreScheduler.RemoveFromScheduleQueue(objScheduleItem);

            SchedulingController s = new SchedulingController();
            int i = s.AddSchedule(objScheduleItem.TypeFullName, objScheduleItem.TimeLapse, objScheduleItem.TimeLapseMeasurement, objScheduleItem.RetryTimeLapse, objScheduleItem.RetryTimeLapseMeasurement, objScheduleItem.RetainHistoryNum, objScheduleItem.AttachToEvent, objScheduleItem.CatchUpEnabled, objScheduleItem.Enabled, objScheduleItem.ObjectDependencies, objScheduleItem.Servers);

            ScheduleHistoryItem objScheduleHistoryItem = new ScheduleHistoryItem(objScheduleItem);

            objScheduleHistoryItem.NextStart  = DateTime.Now;
            objScheduleHistoryItem.ScheduleID = i;

            if (objScheduleHistoryItem.TimeLapse != Null.NullInteger && objScheduleHistoryItem.TimeLapseMeasurement != Null.NullString && objScheduleHistoryItem.Enabled)
            {
                objScheduleHistoryItem.ScheduleSource = ScheduleSource.STARTED_FROM_SCHEDULE_CHANGE;
                Scheduler.CoreScheduler.AddToScheduleQueue(objScheduleHistoryItem);
            }
            DataCache.RemoveCache("ScheduleLastPolled");
            return(i);
        }
Пример #2
0
        public override int AddSchedule(ScheduleItem scheduleItem)
        {
            //Remove item from queue
            Scheduler.CoreScheduler.RemoveFromScheduleQueue(scheduleItem);
            //save item
            scheduleItem.ScheduleID = SchedulingController.AddSchedule(scheduleItem.TypeFullName,
                                                                       scheduleItem.TimeLapse,
                                                                       scheduleItem.TimeLapseMeasurement,
                                                                       scheduleItem.RetryTimeLapse,
                                                                       scheduleItem.RetryTimeLapseMeasurement,
                                                                       scheduleItem.RetainHistoryNum,
                                                                       scheduleItem.AttachToEvent,
                                                                       scheduleItem.CatchUpEnabled,
                                                                       scheduleItem.Enabled,
                                                                       scheduleItem.ObjectDependencies,
                                                                       scheduleItem.Servers,
                                                                       scheduleItem.FriendlyName);
            //Add schedule to queue
            RunScheduleItemNow(scheduleItem);

            //Return Id
            return(scheduleItem.ScheduleID);
        }
        public override int AddSchedule( ScheduleItem objScheduleItem )
        {
            Scheduler.CoreScheduler.RemoveFromScheduleQueue( objScheduleItem );

            SchedulingController s = new SchedulingController();
            int i = s.AddSchedule( objScheduleItem.TypeFullName, objScheduleItem.TimeLapse, objScheduleItem.TimeLapseMeasurement, objScheduleItem.RetryTimeLapse, objScheduleItem.RetryTimeLapseMeasurement, objScheduleItem.RetainHistoryNum, objScheduleItem.AttachToEvent, objScheduleItem.CatchUpEnabled, objScheduleItem.Enabled, objScheduleItem.ObjectDependencies, objScheduleItem.Servers );

            ScheduleHistoryItem objScheduleHistoryItem = new ScheduleHistoryItem( objScheduleItem );
            objScheduleHistoryItem.NextStart = DateTime.Now;
            objScheduleHistoryItem.ScheduleID = i;

            if( objScheduleHistoryItem.TimeLapse != Null.NullInteger && objScheduleHistoryItem.TimeLapseMeasurement != Null.NullString && objScheduleHistoryItem.Enabled )
            {
                objScheduleHistoryItem.ScheduleSource = ScheduleSource.STARTED_FROM_SCHEDULE_CHANGE;
                Scheduler.CoreScheduler.AddToScheduleQueue( objScheduleHistoryItem );
            }
            DataCache.RemoveCache( "ScheduleLastPolled" );
            return i;
        }