private static ServiceClientModel.DailyRetentionFormat GetServiceClientLTRDailyRetentionFormat(
            DailyRetentionFormat psFormat)
        {
            if (psFormat == null)
            {
                return(null);
            }

            ServiceClientModel.DailyRetentionFormat serviceClientFormat = new ServiceClientModel.DailyRetentionFormat();

            if (psFormat.DaysOfTheMonth != null)
            {
                serviceClientFormat.DaysOfTheMonth = new List <ServiceClientModel.Day>();

                foreach (Day psDay in psFormat.DaysOfTheMonth)
                {
                    ServiceClientModel.Day serviceClientDay = new ServiceClientModel.Day()
                    {
                        Date   = psDay.Date,
                        IsLast = psDay.IsLast
                    };

                    serviceClientFormat.DaysOfTheMonth.Add(serviceClientDay);
                }
            }

            return(serviceClientFormat);
        }
        private static DailyRetentionFormat GetPSLTRDailyRetentionFormat(
            ServiceClientModel.DailyRetentionFormat serviceClientFormat)
        {
            if (serviceClientFormat == null)
            {
                return(null);
            }

            DailyRetentionFormat psFormat = new DailyRetentionFormat();

            if (serviceClientFormat.DaysOfTheMonth != null)
            {
                psFormat.DaysOfTheMonth = new List <Day>();

                foreach (ServiceClientModel.Day serviceClientDay in serviceClientFormat.DaysOfTheMonth)
                {
                    Day psDay = new Day()
                    {
                        Date   = GetIntegerFromNullableIntgerValue(serviceClientDay.Date),
                        IsLast = serviceClientDay.IsLast.HasValue ?
                                 (bool)serviceClientDay.IsLast : default(bool)
                    };

                    psFormat.DaysOfTheMonth.Add(psDay);
                }
            }

            return(psFormat);
        }
Exemplo n.º 3
0
        private static DailyRetentionFormat GetPSLTRDailyRetentionFormat(
            ServiceClientModel.DailyRetentionFormat serviceClientFormat)
        {
            if (serviceClientFormat == null)
            {
                return(null);
            }

            DailyRetentionFormat psFormat = new DailyRetentionFormat();

            if (serviceClientFormat.DaysOfTheMonth != null)
            {
                psFormat.DaysOfTheMonth = new List <Day>();

                foreach (ServiceClientModel.Day serviceClientDay in serviceClientFormat.DaysOfTheMonth)
                {
                    Day psDay = new Day()
                    {
                        Date   = serviceClientDay.Date,
                        IsLast = serviceClientDay.IsLast
                    };

                    psFormat.DaysOfTheMonth.Add(psDay);
                }
            }

            return(psFormat);
        }
 /// <summary>
 /// Initializes a new instance of the MonthlyRetentionSchedule class.
 /// </summary>
 /// <param name="retentionScheduleFormatType">Retention schedule format
 /// type for monthly retention policy. Possible values include:
 /// 'Invalid', 'Daily', 'Weekly'</param>
 /// <param name="retentionScheduleDaily">Daily retention format for
 /// monthly retention policy.</param>
 /// <param name="retentionScheduleWeekly">Weekly retention format for
 /// monthly retention policy.</param>
 /// <param name="retentionTimes">Retention times of retention
 /// policy.</param>
 /// <param name="retentionDuration">Retention duration of retention
 /// Policy.</param>
 public MonthlyRetentionSchedule(string retentionScheduleFormatType = default(string), DailyRetentionFormat retentionScheduleDaily = default(DailyRetentionFormat), WeeklyRetentionFormat retentionScheduleWeekly = default(WeeklyRetentionFormat), IList <System.DateTime?> retentionTimes = default(IList <System.DateTime?>), RetentionDuration retentionDuration = default(RetentionDuration))
 {
     RetentionScheduleFormatType = retentionScheduleFormatType;
     RetentionScheduleDaily      = retentionScheduleDaily;
     RetentionScheduleWeekly     = retentionScheduleWeekly;
     RetentionTimes    = retentionTimes;
     RetentionDuration = retentionDuration;
     CustomInit();
 }
        private static ServiceClientModel.DailyRetentionFormat GetServiceClientLTRDailyRetentionFormat(
                                             DailyRetentionFormat psFormat)
        {
            if (psFormat == null)
            {
                return null;
            }

            ServiceClientModel.DailyRetentionFormat serviceClientFormat = new ServiceClientModel.DailyRetentionFormat();

            if (psFormat.DaysOfTheMonth != null)
            {
                serviceClientFormat.DaysOfTheMonth = new List<ServiceClientModel.Day>();

                foreach (Day psDay in psFormat.DaysOfTheMonth)
                {
                    ServiceClientModel.Day serviceClientDay = new ServiceClientModel.Day()
                    {
                        Date = psDay.Date,
                        IsLast = psDay.IsLast
                    };

                    serviceClientFormat.DaysOfTheMonth.Add(serviceClientDay);
                }
            }

            return serviceClientFormat;
        }