Exemplo n.º 1
0
        /// <summary>
        /// Delete delivery point reference from route activity table.
        /// </summary>
        /// <param name="deliveryPointId">Delivery point unique id</param>
        /// <returns>boolean</returns>
        public async Task <bool> DeleteDeliveryPointRouteMapping(Guid deliveryPointId)
        {
            using (loggingHelper.RMTraceManager.StartTrace("Integration.DeleteDeliveryPointRouteMapping"))
            {
                string methodName = typeof(DeliveryPointIntegrationService) + "." + nameof(DeleteDeliveryPointRouteMapping);
                loggingHelper.LogMethodEntry(methodName, priority, entryEventId);

                HttpResponseMessage result = await httpHandler.DeleteAsync(deliveryRouteManagerWebAPIName + "deliveryroute/deliverypoint/delete/" + deliveryPointId);

                if (!result.IsSuccessStatusCode)
                {
                    // LOG ERROR WITH Statuscode
                    var responseContent = result.ReasonPhrase;
                    throw new ServiceException(responseContent);
                }

                bool isDeleted = JsonConvert.DeserializeObject <bool>(result.Content.ReadAsStringAsync().Result);

                loggingHelper.LogMethodExit(methodName, priority, exitEventId);
                return(isDeleted);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Delete the Postal Addresses with Pending Delete status and having no reference.
 /// </summary>
 public void BatchDelete()
 {
     using (loggingHelper.RMTraceManager.StartTrace("EXE.BatchDelete"))
     {
         try
         {
             string methodName = typeof(DataBatchDelete) + "." + nameof(BatchDelete);
             loggingHelper.LogMethodEntry(methodName, LoggerTraceConstants.DeliveryRouteAPIPriority, LoggerTraceConstants.DeliveryRouteControllerMethodEntryEventId);
             string pafDeleteHousekeepingUrl = configurationHelper.ReadAppSettingsConfigurationValues(DELETEPAFHOUSEKEEPING);
             httpHandler.DeleteAsync(pafDeleteHousekeepingUrl, true);
             loggingHelper.LogMethodExit(methodName, LoggerTraceConstants.DeliveryRouteAPIPriority, LoggerTraceConstants.DeliveryRouteControllerMethodExitEventId);
         }
         catch (Exception ex)
         {
             loggingHelper.Log(ex, TraceEventType.Error);
         }
     }
 }