/// <remarks/>
 public void GET_LOGISTICS_LINES_WEBSRVCAsync(InputParameters InputParameters, object userState) {
     if ((this.GET_LOGISTICS_LINES_WEBSRVCOperationCompleted == null)) {
         this.GET_LOGISTICS_LINES_WEBSRVCOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGET_LOGISTICS_LINES_WEBSRVCOperationCompleted);
     }
     this.InvokeAsync("GET_LOGISTICS_LINES_WEBSRVC", new object[] {
                 InputParameters}, this.GET_LOGISTICS_LINES_WEBSRVCOperationCompleted, userState);
 }
 /// <remarks/>
 public System.IAsyncResult BeginGET_LOGISTICS_LINES_WEBSRVC(InputParameters InputParameters, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("GET_LOGISTICS_LINES_WEBSRVC", new object[] {
                 InputParameters}, callback, asyncState);
 }
 /// <remarks/>
 public void GET_LOGISTICS_LINES_WEBSRVCAsync(InputParameters InputParameters) {
     this.GET_LOGISTICS_LINES_WEBSRVCAsync(InputParameters, null);
 }
Ejemplo n.º 4
0
        public RepairLogistics[] LookupRepairLogisticsList(decimal repair_order_id)
        {
            RepairLogistics[] retvals = new RepairLogistics[0];
            string logMessage, logNote;

            if (String.IsNullOrWhiteSpace(RepairLogisticsListURL) ||
                String.IsNullOrWhiteSpace(RepairLogisticsListServiceUsername) ||
                String.IsNullOrWhiteSpace(RepairLogisticsListServicePassword))
            {
                throw new Exception("Provider's InitForRepairLogisticsList not run.");
            }
            REPAIR_LOGISTICS.CSD_LOGISTICS_WEB_Service client = EBSProxyFactory.GetRepairLogisticsInstance(RepairLogisticsListURL, RepairLogisticsListServiceUsername, RepairLogisticsListServicePassword, RepairLogisticsListServiceTimeout);
            REPAIR_LOGISTICS.SOAHeader hdr = new REPAIR_LOGISTICS.SOAHeader();
            hdr.Responsibility = "DEPOT REPAIR";
            hdr.RespApplication = "CSD";
            hdr.SecurityGroup = "STANDARD";
            hdr.NLSLanguage = "AMERICAN";
            hdr.Org_Id = "204";

            client.SOAHeaderValue = hdr;

            REPAIR_LOGISTICS.InputParameters ip = new REPAIR_LOGISTICS.InputParameters();
            ip.P_RECORD_LIMIT = 101;
            ip.P_RECORD_LIMITSpecified = true;
            string parameters = String.Format("GET_LOGISTICS_LINES_WEBSRVC for repair_order_id {0}",
                Convert.ToString(repair_order_id));
            if (repair_order_id <= 0)
            {
                logMessage = parameters + ". No valid parameters found. No search performed.";
                logNote = null;
                ConfigurationSetting.logWrap.DebugLog(logMessage: logMessage, logNote: logNote);
                return retvals;
            }
            ip.P_REPAIR_LINE_ID = repair_order_id;
            ip.P_REPAIR_LINE_IDSpecified = true;
            ip.P_REPAIR_NUMBER = "";

            logMessage = parameters + ". Request payload.";
            logNote = serializer.Serialize(ip);
            ConfigurationSetting.logWrap.DebugLog(logMessage: logMessage, logNote: logNote);
            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();

            StringBuilder response = new StringBuilder("[{}");
            try
            {
                REPAIR_LOGISTICS.OutputParameters opList = client.GET_LOGISTICS_LINES_WEBSRVC(ip);
                List<RepairLogistics> items = new List<RepairLogistics>();

                foreach (REPAIR_LOGISTICS_LIST op in opList.X_PROD_TXN_TBL)
                {
                    RepairLogistics ro = new RepairLogistics(getPropertyValues(op), repair_order_id);
                    items.Add(ro);
                    response.Append(",").Append(ro.ToJSON());
                }
                retvals = items.ToArray();
            }

            catch (Exception ex)
            {
                handleEBSException(ex, parameters);
                throw;
            }

            stopwatch.Stop();
            int timeElapsed = stopwatch.Elapsed.Milliseconds;
            logMessage = new StringBuilder(parameters)
                .Append(" returned ").Append(retvals.Count()).Append(" records in ")
                .Append(timeElapsed).Append("ms")
                .ToString(); 
            logNote = response.Append(",{\"Count\":").Append("\"")
                .Append(retvals.Count()).Append("\"}]").ToString();
            ConfigurationSetting.logWrap.DebugLog(logMessage: logMessage, logNote: logNote, timeElapsed: timeElapsed);
            return retvals;
        }