Пример #1
0
 public static void SetRequestStatus(HubRequest request, HubRequestStatus status, IDictionary <string, string> requestProperties, NetWorkSetting ns)
 {
     try
     {
         using (var web = new Lpp.Dns.DataMart.Client.Lib.DnsApiClient(ns, FindCert(ns)))
         {
             Task.Run(() => web.SetRequestStatus(request.Source.ID, request.DataMartId, status.Code, status.Message, requestProperties.EmptyIfNull().Select(p => new DTO.DataMartClient.RoutingProperty {
                 Name = p.Key, Value = p.Value
             }).ToArray())).Wait();
         }
     }
     catch (Exception ex)
     {
         _log.Error(string.Format("Unable to set request status for requestID: {0}.", request.Source.ID), ex);
         throw new SetRequestStatusFailed(ex);
     }
 }
Пример #2
0
        public static void SetRequestStatus(HubRequest request, HubRequestStatus status, IDictionary <string, string> requestProperties, NetWorkSetting ns)
        {
            // BMS: Don't report inprocess or awaitingresponseapproval until portal can display status in routings.
            //if (status.Code == DTO.DataMartClient.Enums.DMCRoutingStatus.AwaitingResponseApproval)
            //{
            //    return;
            //}

            try
            {
                using (var web = new Lpp.Dns.DataMart.Client.Lib.DnsApiClient(ns, FindCert(ns)))
                {
                    AsyncHelpers.RunSync(() => web.SetRequestStatus(request.Source.ID, request.DataMartId, status.Code, status.Message, requestProperties.EmptyIfNull().Select(p => new DTO.DataMartClient.RoutingProperty {
                        Name = p.Key, Value = p.Value
                    }).ToArray()));
                }
            }
            catch (Exception ex)
            {
                throw new SetRequestStatusFailed(ex);
            }
        }