Exemplo n.º 1
0
        /// <summary>
        /// This function maps a FSSchedule daily frequency to a DailySchedule in the Scheduler module.
        /// </summary>
        public static Schedule mapDailyFrequency(PXCache cache, FSSchedule fsScheduleRow, DateTime?toDate, string recordType, Period period = null)
        {
            bool applySeasonInSchedule = recordType != ID.RecordType_ServiceContract.EMPLOYEE_SCHEDULE_CONTRACT ? SharedFunctions.GetEnableSeasonSetting(cache.Graph, fsScheduleRow) : false;

            var dailySchedule = new DailySchedule
            {
                Name       = TX.FrecuencySchedule.DAILY,
                EntityID   = fsScheduleRow.EntityID,
                EntityType = fsScheduleRow.EntityType,
                LastGeneratedTimeSlotDate = fsScheduleRow.LastGeneratedElementDate,
                ScheduleID      = (int)fsScheduleRow.ScheduleID,
                SubScheduleID   = 0,
                TimeOfDayBegin  = new TimeSpan(5, 0, 0), //TODO SD-5493
                TimeOfDayEnd    = new TimeSpan(11, 0, 0),
                SchedulingRange = period ?? new Period((DateTime)(fsScheduleRow.StartDate ?? toDate), fsScheduleRow.EndDate),
                Frequency       = (int)fsScheduleRow.DailyFrequency,
                Descr           = fsScheduleRow.ContractDescr,
                ApplySeason     = applySeasonInSchedule,
                SeasonOnJan     = fsScheduleRow.SeasonOnJan,
                SeasonOnFeb     = fsScheduleRow.SeasonOnFeb,
                SeasonOnMar     = fsScheduleRow.SeasonOnMar,
                SeasonOnApr     = fsScheduleRow.SeasonOnApr,
                SeasonOnMay     = fsScheduleRow.SeasonOnMay,
                SeasonOnJun     = fsScheduleRow.SeasonOnJun,
                SeasonOnJul     = fsScheduleRow.SeasonOnJul,
                SeasonOnAug     = fsScheduleRow.SeasonOnAug,
                SeasonOnSep     = fsScheduleRow.SeasonOnSep,
                SeasonOnOct     = fsScheduleRow.SeasonOnOct,
                SeasonOnNov     = fsScheduleRow.SeasonOnNov,
                SeasonOnDec     = fsScheduleRow.SeasonOnDec
            };

            return(dailySchedule);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This function maps a FSServiceCOoract daily frequency to a DailySchedule in the Scheduler module.
        /// </summary>
        public static Schedule mapDailyFrequency(FSServiceContract fsServiceContractRow, DateTime?lastGeneratedElementDate, int frequency, Period period = null)
        {
            var dailySchedule = new DailySchedule
            {
                Name = TX.FrecuencySchedule.DAILY,
                LastGeneratedTimeSlotDate = lastGeneratedElementDate,
                SubScheduleID             = 0,
                TimeOfDayBegin            = new TimeSpan(5, 0, 0), //TODO SD-5493
                TimeOfDayEnd    = new TimeSpan(11, 0, 0),
                SchedulingRange = period ?? new Period((DateTime)fsServiceContractRow.StartDate, fsServiceContractRow.EndDate),
                Frequency       = frequency
            };

            return(dailySchedule);
        }