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;
}