private static InvokeReporstServicesCallResponse GetShipmentInformation(PXGraph graph, SOTrackingReportFilter currentFilter, SOAmazonSetup objSOAmazonSetupDetails)
        {
            InvokeReporstServicesCallResponse liShipmentResponse = new InvokeReporstServicesCallResponse();

            liShipmentResponse = new AMShipmentTrackingNumberServiceCall(clientReports).InvokeReportsServiceCalls(graph, objSOAmazonSetupDetails, currentFilter.FromDate, currentFilter.TODate);
            return(liShipmentResponse);
        }
コード例 #2
0
        public virtual InvokeReporstServicesCallResponse InvokeReportsServiceCalls(PXGraph graph, SOAmazonSetup objSOAmazonSetup, DateTime?fromDate, DateTime?toDate)
        {
            InvokeReporstServicesCallResponse objShipInfo = new InvokeReporstServicesCallResponse();

            MarketplaceWebService.MarketplaceWebService serviceConfig = this.Configurations(objSOAmazonSetup.IntegrationType.Trim(), objSOAmazonSetup.AccessKey, objSOAmazonSetup.SecretKey);
            if (serviceConfig == null)
            {
                return(objShipInfo);
            }
            ReportRequestInfo          reportInfo     = new ReportRequestInfo();
            List <ShipmentInformarion> liShipmentInfo = new List <ShipmentInformarion>();

            reportParams = new ReportParameters();
            reportParams.objSOAmazonSetup = objSOAmazonSetup;
            reportParams.reportRequestId  = string.Empty;
            reportParams.reportInfo       = reportInfo;
            reportParams.liShipmentInfo   = liShipmentInfo;
            reportParams.serviceConfig    = serviceConfig;
            reportInfo            = new AMShipmentTrackingNumberServiceCall(reportParams.serviceConfig).InvokeGetReportRequestList(graph, reportParams);
            reportParams.fromDate = fromDate;
            reportParams.toDate   = toDate;

            try
            {
                if (reportInfo != null && reportInfo.GeneratedReportId != null)
                {
                    if (Convert.ToInt32((TimeZoneInfo.ConvertTimeToUtc(DateTime.Now) - TimeZoneInfo.ConvertTimeToUtc(reportInfo.CompletedDate)).TotalMinutes) <= SOConstants.limitForReports)
                    {
                        throw new PXException(SOMessages.errorReportInfo);
                    }
                    else
                    {
                        liShipmentInfo = RequestAndGetReportData(graph, reportParams);
                    }
                    objShipInfo.objShipmentResponse = liShipmentInfo;
                }
                else
                {
                    liShipmentInfo = RequestAndGetReportData(graph, reportParams);
                }
            }
            catch (Exception ex)
            {
                throw new PXException(!string.IsNullOrEmpty(ex.Message) ? ex.Message :
                                      ex.InnerException != null && ex.InnerException.InnerException != null ? ex.InnerException.InnerException.Message : SOConstants.exceptionIsEmpty);
            }
            return(objShipInfo);
        }
コード例 #3
0
        private static List <ShipmentInformarion> RequestAndGetReportData(PXGraph graph, ReportParameters reportParams)
        {
            RequestReportResponse requestReportResponse = new AMShipmentTrackingNumberServiceCall(reportParams.serviceConfig).InvokeRequestReport(graph, reportParams);

            if (requestReportResponse != null && requestReportResponse.RequestReportResult != null && requestReportResponse.RequestReportResult.ReportRequestInfo != null && requestReportResponse.RequestReportResult.ReportRequestInfo.ReportRequestId != null)
            {
                reportParams.reportRequestId = requestReportResponse.RequestReportResult.ReportRequestInfo.ReportRequestId;
                reportParams.reportInfo      = new AMShipmentTrackingNumberServiceCall(reportParams.serviceConfig).InvokeGetReportRequestList(graph, reportParams);
                if (reportParams.reportInfo != null && reportParams.reportInfo.GeneratedReportId != null)
                {
                    reportParams.generatedReportId = reportParams.reportInfo.GeneratedReportId;
                    reportParams.liShipmentInfo    = GetShipmentReportData(graph, reportParams);
                }
            }
            return(reportParams.liShipmentInfo);
        }