Пример #1
0
        public static void Activate(List <Schedule> list)
        {
            WZScheduleProcess graph = PXGraph.CreateInstance <WZScheduleProcess>();

            foreach (Schedule schedule in list)
            {
                graph.GenerateProc(schedule);
            }
            PXSiteMap.Provider.Clear();
        }
        public static void Activate(List <Schedule> list)
        {
            WZScheduleProcess graph = PXGraph.CreateInstance <WZScheduleProcess>();

            foreach (Schedule schedule in list)
            {
                graph.GenerateProc(schedule);
            }
            PXSiteMap.Provider.Clear();
            throw new PXRedirectToUrlException(@"~\Main.aspx$target=_top", PXBaseRedirectException.WindowMode.Same, "Refresh SiteMap");
        }
Пример #3
0
        public virtual IEnumerable runNow(PXAdapter adapter)
        {
            this.Save.Press();

            Schedule schedule = Schedule_Header.Current;

            if (schedule.NextRunDate > Accessinfo.BusinessDate)
            {
                throw new PXException(GL.Messages.SheduleNextExecutionDateExceeded);
            }
            else
            {
                if (schedule.NoRunLimit == false && schedule.RunCntr >= schedule.RunLimit)
                {
                    throw new PXException(GL.Messages.SheduleExecutionLimitExceeded);
                }
                else
                {
                    if (schedule.NoEndDate == false && schedule.EndDate < Accessinfo.BusinessDate)
                    {
                        throw new PXException(GL.Messages.SheduleHasExpired);
                    }
                    else
                    {
                        PXLongOperation.StartOperation(this,
                                                       delegate()
                        {
                            WZScheduleProcess sp = PXGraph.CreateInstance <WZScheduleProcess>();
                            sp.GenerateProc(schedule);
                            PXSiteMap.Provider.Clear();
                            throw new PXRefreshException();
                        }
                                                       );
                    }
                }
            }

            return(adapter.Get());
        }