private static ServiceClientModel.YearlyRetentionSchedule GetServiceClientLTRYearlySchedule(YearlyRetentionSchedule psYearly) { if (psYearly == null) { return(null); } ServiceClientModel.YearlyRetentionSchedule serviceClientYearly = new ServiceClientModel.YearlyRetentionSchedule(); serviceClientYearly.RetentionDuration = new ServiceClientModel.RetentionDuration() { Count = psYearly.DurationCountInYears, DurationType = ServiceClientModel.RetentionDurationType.Years }; serviceClientYearly.RetentionTimes = GetNullableDateTimeListFromDateTimeList( psYearly.RetentionTimes); serviceClientYearly.RetentionScheduleFormatType = ServiceClientHelpers.GetServiceClientRetentionScheduleFormat( psYearly.RetentionScheduleFormatType); if (psYearly.RetentionScheduleFormatType == RetentionScheduleFormat.Daily) { serviceClientYearly.RetentionScheduleDaily = GetServiceClientLTRDailyRetentionFormat(psYearly.RetentionScheduleDaily); } else if (psYearly.RetentionScheduleFormatType == RetentionScheduleFormat.Weekly) { serviceClientYearly.RetentionScheduleWeekly = GetServiceClientLTRWeeklyRetentionFormat(psYearly.RetentionScheduleWeekly); } serviceClientYearly.MonthsOfYear = HelperUtils.EnumListConverter <Month, ServiceClientModel.MonthOfYear>( psYearly.MonthsOfYear).Cast <ServiceClientModel.MonthOfYear?>().ToList(); return(serviceClientYearly); }
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); }