Ejemplo n.º 1
0
        private static MonthlyRetentionSchedule GetPSLTRMonthlySchedule(ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly)
        {
            if (serviceClientMonthly == null)
            {
                return(null);
            }

            MonthlyRetentionSchedule psMonthly = new MonthlyRetentionSchedule();

            psMonthly.DurationCountInMonths       = GetRetentionDurationInMonths(serviceClientMonthly.RetentionDuration);
            psMonthly.RetentionTimes              = ParseDateTimesToUTC(serviceClientMonthly.RetentionTimes);
            psMonthly.RetentionScheduleFormatType = (RetentionScheduleFormat)Enum.Parse(typeof(RetentionScheduleFormat),
                                                                                        serviceClientMonthly.RetentionScheduleFormatType);
            psMonthly.RetentionScheduleDaily  = GetPSLTRDailyRetentionFormat(serviceClientMonthly.RetentionScheduleDaily);
            psMonthly.RetentionScheduleWeekly = GetPSLTRWeeklyRetentionFormat(serviceClientMonthly.RetentionScheduleWeekly);

            return(psMonthly);
        }
        private static MonthlyRetentionSchedule GetPSLTRMonthlySchedule(ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly,
                                                                        string timeZone)
        {
            if (serviceClientMonthly == null)
            {
                return(null);
            }

            MonthlyRetentionSchedule psMonthly = new MonthlyRetentionSchedule();

            psMonthly.DurationCountInMonths       = GetRetentionDurationInMonths(serviceClientMonthly.RetentionDuration);
            psMonthly.RetentionTimes              = ParseDateTimesToUTC(serviceClientMonthly.RetentionTimes, timeZone);
            psMonthly.RetentionScheduleFormatType =
                serviceClientMonthly.RetentionScheduleFormatType.ToEnum <RetentionScheduleFormat>();
            psMonthly.RetentionScheduleDaily  = GetPSLTRDailyRetentionFormat(serviceClientMonthly.RetentionScheduleDaily);
            psMonthly.RetentionScheduleWeekly = GetPSLTRWeeklyRetentionFormat(serviceClientMonthly.RetentionScheduleWeekly);

            return(psMonthly);
        }
        private static ServiceClientModel.MonthlyRetentionSchedule GetServiceClientLTRMonthlySchedule(MonthlyRetentionSchedule psMonthly)
        {
            if (psMonthly == null)
            {
                return null;
            }

            ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly = new ServiceClientModel.MonthlyRetentionSchedule();

            serviceClientMonthly.RetentionDuration = new ServiceClientModel.RetentionDuration()
            {
                Count = psMonthly.DurationCountInMonths,
                DurationType = ServiceClientModel.RetentionDurationType.Months
            };
            serviceClientMonthly.RetentionTimes = psMonthly.RetentionTimes;

            serviceClientMonthly.RetentionScheduleFormatType = psMonthly.RetentionScheduleFormatType.ToString();
            if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Daily)
            {
                serviceClientMonthly.RetentionScheduleDaily = GetServiceClientLTRDailyRetentionFormat(psMonthly.RetentionScheduleDaily);
            }
            else if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Weekly)
            {
                serviceClientMonthly.RetentionScheduleWeekly = GetServiceClientLTRWeeklyRetentionFormat(psMonthly.RetentionScheduleWeekly);
            }

            return serviceClientMonthly;
        }
        private static MonthlyRetentionSchedule GetPSLTRMonthlySchedule(ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly)
        {
            if (serviceClientMonthly == null)
            {
                return null;
            }

            MonthlyRetentionSchedule psMonthly = new MonthlyRetentionSchedule();

            psMonthly.DurationCountInMonths = GetRetentionDurationInMonths(serviceClientMonthly.RetentionDuration);
            psMonthly.RetentionTimes = ParseDateTimesToUTC(serviceClientMonthly.RetentionTimes);
            psMonthly.RetentionScheduleFormatType = (RetentionScheduleFormat)Enum.Parse(typeof(RetentionScheduleFormat),
                                                                                   serviceClientMonthly.RetentionScheduleFormatType);
            psMonthly.RetentionScheduleDaily = GetPSLTRDailyRetentionFormat(serviceClientMonthly.RetentionScheduleDaily);
            psMonthly.RetentionScheduleWeekly = GetPSLTRWeeklyRetentionFormat(serviceClientMonthly.RetentionScheduleWeekly);

            return psMonthly;
        }
        private static ServiceClientModel.MonthlyRetentionSchedule GetServiceClientLTRMonthlySchedule(MonthlyRetentionSchedule psMonthly)
        {
            if (psMonthly == null)
            {
                return(null);
            }

            ServiceClientModel.MonthlyRetentionSchedule serviceClientMonthly = new ServiceClientModel.MonthlyRetentionSchedule();

            serviceClientMonthly.RetentionDuration = new ServiceClientModel.RetentionDuration()
            {
                Count        = psMonthly.DurationCountInMonths,
                DurationType = ServiceClientModel.RetentionDurationType.Months
            };
            serviceClientMonthly.RetentionTimes = GetNullableDateTimeListFromDateTimeList(
                psMonthly.RetentionTimes);

            serviceClientMonthly.RetentionScheduleFormatType =
                ServiceClientHelpers.GetServiceClientRetentionScheduleFormat(
                    psMonthly.RetentionScheduleFormatType);

            if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Daily)
            {
                serviceClientMonthly.RetentionScheduleDaily = GetServiceClientLTRDailyRetentionFormat(psMonthly.RetentionScheduleDaily);
            }
            else if (psMonthly.RetentionScheduleFormatType == RetentionScheduleFormat.Weekly)
            {
                serviceClientMonthly.RetentionScheduleWeekly = GetServiceClientLTRWeeklyRetentionFormat(psMonthly.RetentionScheduleWeekly);
            }

            return(serviceClientMonthly);
        }