Ejemplo n.º 1
0
 public void Save(OnDemandQueryRequest reportRequest)
 {
     if (reportRequest == null)
     {
         throw new ArgumentNullException("reportRequest");
     }
     reportRequest[ADObjectSchema.OrganizationalUnitRoot] = GlobalConfigSession.onDemandReportsFixedTenantId;
     this.WebStoreDataProvider.Save(reportRequest);
 }
 public void Save(IConfigurable obj)
 {
     if (obj == null)
     {
         throw new ArgumentNullException(obj.GetType().Name);
     }
     if (obj is OnDemandQueryRequest)
     {
         OnDemandQueryRequest reportRequest = obj as OnDemandQueryRequest;
         this.Save(reportRequest);
     }
     else
     {
         if (!(obj is ReportSchedule))
         {
             throw new NotSupportedException("This object type cannot be saved through this session object");
         }
         ReportSchedule reportSchedule = obj as ReportSchedule;
         this.Save(reportSchedule);
     }
     this.dataProviderDirectory.Save(obj);
 }
 private void Save(OnDemandQueryRequest reportRequest)
 {
     if (!reportRequest.GetPropertyDefinitions(true).Any((PropertyDefinition r) => r.Name == OnDemandQueryRequestSchema.Container.Name))
     {
         if (reportRequest.GetPropertyDefinitions(true).Any((PropertyDefinition r) => r.Name == OnDemandQueryRequestSchema.RequestStatus.Name))
         {
             reportRequest[OnDemandQueryRequestSchema.Container] = reportRequest[OnDemandQueryRequestSchema.RequestStatus].ToString();
         }
         else
         {
             OnDemandQueryRequest onDemandQueryRequest = this.FindOnDemandReportRequests(reportRequest.TenantId, new Guid?(reportRequest.RequestId), null, null, 100).FirstOrDefault <OnDemandQueryRequest>();
             if (onDemandQueryRequest != null)
             {
                 reportRequest[OnDemandQueryRequestSchema.Container] = onDemandQueryRequest[OnDemandQueryRequestSchema.Container];
             }
             else
             {
                 reportRequest[OnDemandQueryRequestSchema.Container] = OnDemandQueryRequest.DefaultContainer;
             }
         }
     }
     this.dataProviderDirectory.Save(reportRequest);
 }