private static void LoadModelWithEmailValues(ReportSchedulerModel model, EmailDeliverySettings ds) { string addresses; string subject; string comment; ds.TryGetToValue(out addresses); ds.TryGetSubjectValue(out subject); ds.TryGetCommentValue(out comment); model.EmailAddresses = addresses; model.Subject = subject; model.Comment = comment; }
private static DeliverySettings DeliverySettingsFromReportSchedulerModel(ReportSchedulerModel model) { DeliverySettings deliverySettings; Debug.Assert(model.ReportOutputType != null, "model.ReportOutputType Should not be null"); ReportOutputType reportOutputType = model.ReportOutputType.Value; if (model.ReportDestination == ReportDestination.Email) { deliverySettings = new EmailDeliverySettings(FormatEmailAddresses(model.EmailAddresses), null, null, null, reportOutputType, IncludeReport.Yes, EmailPriority.Normal, model.Subject, model.Comment, IncludeLink.No); } else { deliverySettings = new FileShareDeliverySettings(model.ReportName, true, model.Location, reportOutputType, model.UserName, model.Password, WriteMode.AutoIncrement); } return deliverySettings; }