Пример #1
0
 public void Export(List<Solution> lstExportSolution, ExportSettings settings)
 {
     foreach (var item in lstExportSolution)
     {
         Export(item.Id, settings);
     }
 }
Пример #2
0
 public void Export(Guid solutionid, ExportSettings settings)
 {
     Entity sol = CrmService.Retrieve("solution", solutionid, new ColumnSet(true));
     ExportSolutionRequest request = new ExportSolutionRequest();
     request.ExportAutoNumberingSettings = settings.ExportAutoNumberingSettings;
     request.ExportCalendarSettings = settings.ExportCalendarSettings;
     request.ExportCustomizationSettings = settings.ExportCustomizationSettings;
     request.ExportEmailTrackingSettings = settings.ExportEmailTrackingSettings;
     request.ExportGeneralSettings = settings.ExportGeneralSettings;
     request.ExportIsvConfig = settings.ExportIsvConfig;
     request.ExportMarketingSettings = settings.ExportMarketingSettings;
     request.ExportOutlookSynchronizationSettings = settings.ExportOutlookSynchronizationSettings;
     request.ExportRelationshipRoles = settings.ExportRelationshipRoles;
     request.Managed = settings.IsManaged;
     request.SolutionName = sol["uniquename"] as string;
     ExportSolutionResponse response = (ExportSolutionResponse)CrmService.Execute(request);
     File.WriteAllBytes(settings.Path+"\\"+request.SolutionName+"_"+(sol["version"] as string).Replace(".","_")+"_"+((settings.IsManaged)?"managed":"unmanaged")+".zip", response.ExportSolutionFile);
 }
 private DataModel.ExportSettings GetSettings()
 {
     DataModel.ExportSettings settings = new DataModel.ExportSettings();
     settings.ExportAutoNumberingSettings = cbExportAutoNumberingSettings.Checked;
     settings.ExportCalendarSettings = cbExportCalendarSettings.Checked;
     settings.ExportCustomizationSettings = cbExportCustomizationSettings.Checked;
     settings.ExportEmailTrackingSettings = cbExportEmailTrackingSettings.Checked;
     settings.ExportGeneralSettings = cbExportGeneralSettings.Checked;
     settings.ExportIsvConfig = cbExportIsvConfig.Checked;
     settings.ExportMarketingSettings = cbExportMarketingSettings.Checked;
     settings.ExportOutlookSynchronizationSettings = cbExportOutlookSynchronizationSettings.Checked;
     settings.ExportRelationshipRoles = cbExportRelationshipRoles.Checked;
     settings.Path = txtPath.Text;
     return settings;
 }