Exemplo n.º 1
0
 private static void LoadModelWithFileShareValues(ReportSchedulerModel model, FileShareDeliverySettings ds)
 {
     string location;
     string userName;
     ds.TryGetPathValue(out location);
     ds.TryGetUserNameValue(out userName);
     model.Location = location;
     model.UserName = userName;
 }
Exemplo n.º 2
0
        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;
        }