Пример #1
0
        public string CreateSubscription(SubscritionValues subscrition)
        {
            ReportingService2010 rs = new ReportingService2010();
            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
            string report = subscrition.Report;
            string desc = System.Net.CredentialCache.DefaultCredentials +
                            " subscribed " + subscrition.Report + " to EMAIL";
            string eventType = "TimedSubscription";
            string scheduleXml = getScheduleXML(subscrition);

            ParameterValue[] extensionParams = new ParameterValue[7];

            extensionParams[0] = new ParameterValue();
            extensionParams[0].Name = "RenderFormat";
            extensionParams[0].Value = "PDF";

            extensionParams[1] = new ParameterValue();
            extensionParams[1].Name = "TO";
            extensionParams[1].Value = subscrition.TO;

            extensionParams[2] = new ParameterValue();
            extensionParams[2].Name = "IncludeReport";
            extensionParams[2].Value = "true";

            extensionParams[3] = new ParameterValue();
            extensionParams[3].Name = "Subject";
            extensionParams[3].Value = subscrition.Subject;

            extensionParams[4] = new ParameterValue();
            extensionParams[4].Name = "IncludeLink";
            extensionParams[4].Value = "true";

            extensionParams[5] = new ParameterValue();
            extensionParams[5].Name = "CC";
            extensionParams[5].Value = subscrition.CC;

            extensionParams[6] = new ParameterValue();
            extensionParams[6].Name = "BCC";
            extensionParams[6].Value = subscrition.BCC;

            string matchData = scheduleXml;
            ExtensionSettings extSettings = new ExtensionSettings();
            extSettings.ParameterValues = extensionParams;
            extSettings.Extension = "Report Server Email";

            ParameterValue[] parameters = new ParameterValue[subscrition.Parameters.Length];
            for (int i = 0; i < subscrition.Parameters.Length;i++ )
            {
                ParameterValue parameter = new ParameterValue();
                parameter.Name = subscrition.Parameters[i].ParameterName;
                parameter.Value = subscrition.Parameters[i].ParameterValue;
                parameters[i] = parameter;

            }
            try
            {
               string subscriptionID =rs.CreateSubscription(report, extSettings, desc,
                    eventType, matchData, parameters);
               Dips_progression_subscription ps = new Dips_progression_subscription();
               ps.indicator = subscrition.ConditionIndicator;
               ps.location = subscrition.ConditionLocation;
               ps.operand = subscrition.ConditionOperand;
               if (subscrition.ConditionValue!=null && subscrition.ConditionValue != "")
                ps.value = Double.Parse(subscrition.ConditionValue);
               ps.subscription_id = subscriptionID;
               ps.last_updated_date = DateTime.Now;
               ps.status = "Added";
               if (ps.indicator != null)
               {
                   db.Dips_progression_subscription.Add(ps);
                   db.SaveChanges();
               }
               return subscriptionID;
            }

            catch (SoapException e)
            {
                Console.WriteLine(e.Message);
                return "Subscribe failed "+e.Message;
            }
        }
Пример #2
0
 /// <remarks/>
 public void SetCacheRefreshPlanPropertiesAsync(string CacheRefreshPlanID, string Description, string EventType, string MatchData, ParameterValue[] Parameters, object userState) {
     if ((this.SetCacheRefreshPlanPropertiesOperationCompleted == null)) {
         this.SetCacheRefreshPlanPropertiesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetCacheRefreshPlanPropertiesOperationCompleted);
     }
     this.InvokeAsync("SetCacheRefreshPlanProperties", new object[] {
                 CacheRefreshPlanID,
                 Description,
                 EventType,
                 MatchData,
                 Parameters}, this.SetCacheRefreshPlanPropertiesOperationCompleted, userState);
 }
Пример #3
0
 public string GetCacheRefreshPlanProperties(string CacheRefreshPlanID, out string LastRunStatus, out CacheRefreshPlanState State, out string EventType, out string MatchData, out ParameterValue[] Parameters) {
     object[] results = this.Invoke("GetCacheRefreshPlanProperties", new object[] {
                 CacheRefreshPlanID});
     LastRunStatus = ((string)(results[1]));
     State = ((CacheRefreshPlanState)(results[2]));
     EventType = ((string)(results[3]));
     MatchData = ((string)(results[4]));
     Parameters = ((ParameterValue[])(results[5]));
     return ((string)(results[0]));
 }
Пример #4
0
 public void SetCacheRefreshPlanProperties(string CacheRefreshPlanID, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.Invoke("SetCacheRefreshPlanProperties", new object[] {
                 CacheRefreshPlanID,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
 }
Пример #5
0
 /// <remarks/>
 public void SetCacheRefreshPlanPropertiesAsync(string CacheRefreshPlanID, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.SetCacheRefreshPlanPropertiesAsync(CacheRefreshPlanID, Description, EventType, MatchData, Parameters, null);
 }
Пример #6
0
 /// <remarks/>
 public void CreateCacheRefreshPlanAsync(string ItemPath, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.CreateCacheRefreshPlanAsync(ItemPath, Description, EventType, MatchData, Parameters, null);
 }
Пример #7
0
 /// <remarks/>
 public void CreateCacheRefreshPlanAsync(string ItemPath, string Description, string EventType, string MatchData, ParameterValue[] Parameters, object userState) {
     if ((this.CreateCacheRefreshPlanOperationCompleted == null)) {
         this.CreateCacheRefreshPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCacheRefreshPlanOperationCompleted);
     }
     this.InvokeAsync("CreateCacheRefreshPlan", new object[] {
                 ItemPath,
                 Description,
                 EventType,
                 MatchData,
                 Parameters}, this.CreateCacheRefreshPlanOperationCompleted, userState);
 }
Пример #8
0
 /// <remarks/>
 public void GetItemParametersAsync(string ItemPath, string HistoryID, bool ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials, object userState) {
     if ((this.GetItemParametersOperationCompleted == null)) {
         this.GetItemParametersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetItemParametersOperationCompleted);
     }
     this.InvokeAsync("GetItemParameters", new object[] {
                 ItemPath,
                 HistoryID,
                 ForRendering,
                 Values,
                 Credentials}, this.GetItemParametersOperationCompleted, userState);
 }
Пример #9
0
 public string CreateCacheRefreshPlan(string ItemPath, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     object[] results = this.Invoke("CreateCacheRefreshPlan", new object[] {
                 ItemPath,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
     return ((string)(results[0]));
 }
Пример #10
0
 public ItemParameter[] GetItemParameters(string ItemPath, string HistoryID, bool ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials) {
     object[] results = this.Invoke("GetItemParameters", new object[] {
                 ItemPath,
                 HistoryID,
                 ForRendering,
                 Values,
                 Credentials});
     return ((ItemParameter[])(results[0]));
 }
Пример #11
0
 /// <remarks/>
 public void GetItemParametersAsync(string ItemPath, string HistoryID, bool ForRendering, ParameterValue[] Values, DataSourceCredentials[] Credentials) {
     this.GetItemParametersAsync(ItemPath, HistoryID, ForRendering, Values, Credentials, null);
 }
Пример #12
0
 /// <remarks/>
 public void CreateSubscriptionAsync(string ItemPath, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.CreateSubscriptionAsync(ItemPath, ExtensionSettings, Description, EventType, MatchData, Parameters, null);
 }
Пример #13
0
 public string CreateSubscription(string ItemPath, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     object[] results = this.Invoke("CreateSubscription", new object[] {
                 ItemPath,
                 ExtensionSettings,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
     return ((string)(results[0]));
 }
Пример #14
0
 public string GetSubscriptionProperties(string SubscriptionID, out ExtensionSettings ExtensionSettings, out string Description, out ActiveState Active, out string Status, out string EventType, out string MatchData, out ParameterValue[] Parameters) {
     object[] results = this.Invoke("GetSubscriptionProperties", new object[] {
                 SubscriptionID});
     ExtensionSettings = ((ExtensionSettings)(results[1]));
     Description = ((string)(results[2]));
     Active = ((ActiveState)(results[3]));
     Status = ((string)(results[4]));
     EventType = ((string)(results[5]));
     MatchData = ((string)(results[6]));
     Parameters = ((ParameterValue[])(results[7]));
     return ((string)(results[0]));
 }
Пример #15
0
 /// <remarks/>
 public void SetSubscriptionPropertiesAsync(string SubscriptionID, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.SetSubscriptionPropertiesAsync(SubscriptionID, ExtensionSettings, Description, EventType, MatchData, Parameters, null);
 }
Пример #16
0
 public void SetSubscriptionProperties(string SubscriptionID, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) {
     this.Invoke("SetSubscriptionProperties", new object[] {
                 SubscriptionID,
                 ExtensionSettings,
                 Description,
                 EventType,
                 MatchData,
                 Parameters});
 }