internal static dynamic GetScheduleItems(string serverName = "")
        {
            dynamic Result = new ExpandoObject();

            IEnumerable <ScheduleItem> scheduleviews = _controller.GetScheduleItems(null, serverName);

            ScheduleItem[] arrSchedule = scheduleviews.ToArray();

            Result = arrSchedule.Select(v => new
            {
                v.ScheduleID,
                v.FriendlyName,
                v.Enabled,
                RetryTimeLapse = _controller.GetTimeLapse(v.RetryTimeLapse, v.RetryTimeLapseMeasurement),
                NextStart      = (v.Enabled && !Null.IsNull(v.NextStart)) ? v.NextStart.ToString() : "",
                Frequency      = _controller.GetTimeLapse(v.TimeLapse, v.TimeLapseMeasurement)
            });

            return(Result);
        }
Example #2
0
        public override ConsoleResultModel Run()
        {
            var controller     = new TaskSchedulerController();
            var tasks          = new List <TaskModelBase>();
            var schedulerItems = controller.GetScheduleItems(this.Enabled, "", this.TaskName?.Replace("*", ""));

            tasks.AddRange(schedulerItems.Select(x => new TaskModelBase(x)));
            return(new ConsoleResultModel(string.Format(this.LocalizeString("Prompt_TasksFound"), tasks.Count))
            {
                Data = tasks,
                Records = tasks.Count,
            });
        }