コード例 #1
0
 /// <remarks/>
 public void PROCESS_ORDERAsync(InputParameters InputParameters, object userState) {
     if ((this.PROCESS_ORDEROperationCompleted == null)) {
         this.PROCESS_ORDEROperationCompleted = new System.Threading.SendOrPostCallback(this.OnPROCESS_ORDEROperationCompleted);
     }
     this.InvokeAsync("PROCESS_ORDER", new object[] {
                 InputParameters}, this.PROCESS_ORDEROperationCompleted, userState);
 }
コード例 #2
0
ファイル: Order.cs プロジェクト: thollu/accelerators
        public Order Save()
        {
            string request = "";
            string response = "";
            string logMessage, logNote;
            var    provider = _provider as LiveEBSProvider;

            if (String.IsNullOrWhiteSpace(provider.OrderInboundURL))
            {
                throw new Exception("Provider's InitForOrder not run.");
            }

            PROCESS_ORDER.OE_INBOUND_INT_Service client = EBSProxyFactory.GetOrderInboundServiceInstance(provider.OrderInboundURL, ConfigurationSetting.username, ConfigurationSetting.password, ConfigurationSetting.EBSServiceTimeout);
            PROCESS_ORDER.SOAHeader hdr = new PROCESS_ORDER.SOAHeader();
            hdr.Responsibility  = "ORDER_MGMT_SUPER_USER";
            hdr.RespApplication = "ONT";
            hdr.Org_Id          = "204";
            hdr.SecurityGroup   = "STANDARD";
            hdr.NLSLanguage     = "AMERICAN";

            client.SOAHeaderValue = hdr;

            var ip = new PROCESS_ORDER.InputParameters();

            ip.P_API_VERSION_NUMBER          = 1;
            ip.P_API_VERSION_NUMBERSpecified = true;
            ip.P_INIT_MSG_LIST = "T";
            ip.P_RETURN_VALUES = "T";
            ip.P_ACTION_COMMIT = "T";
            ip.P_RTRIM_DATA    = "T";

            ip.P_HEADER_REC                        = new PROCESS_ORDER.APPSOE_ORDER_PUB_HEADER_REC_TYPE();
            ip.P_HEADER_REC.ATTRIBUTE15            = ATTRIBUTE15;
            ip.P_HEADER_REC.BOOKED_FLAG            = "N";
            ip.P_HEADER_REC.ORDER_TYPE_ID          = 1430;
            ip.P_HEADER_REC.ORDER_TYPE_IDSpecified = true;
            ip.P_HEADER_REC.OPERATION              = "CREATE";

            ip.P_LINE_TBL = new PROCESS_ORDER.APPSOE_ORDER_PUB_LINE_REC_TYPE[Items.Count];
            var items = Items.ToArray();

            for (int i = 0; i < Items.Count; i++)
            {
                var src  = items[i];
                var dest = ip.P_LINE_TBL[i] = new PROCESS_ORDER.APPSOE_ORDER_PUB_LINE_REC_TYPE();
                dest.INVENTORY_ITEM_ID           = src.INVENTORY_ITEM_ID;
                dest.INVENTORY_ITEM_IDSpecified  = true;
                dest.ORDERED_QUANTITY            = src.ORDERED_QUANTITY;
                dest.ORDERED_QUANTITYSpecified   = true;
                dest.UNIT_SELLING_PRICE          = src.UNIT_SELLING_PRICE;
                dest.UNIT_SELLING_PRICESpecified = true;
                dest.OPERATION = "CREATE";
            }
            PROCESS_ORDER.OutputParameters op = null;
            Stopwatch stopwatch = new Stopwatch();

            try
            {
                var serializer = LiveEBSProvider.serializer;
                request = serializer.Serialize(ip);

                logMessage = "Request of saving Order (PROCESS_ORDER). ";
                logNote    = "Request Payload: " + request;
                provider.log.DebugLog(IncidentId, ContactId, logMessage, logNote);
                // call the web service, catch the exception right away
                stopwatch.Start();
                op = client.PROCESS_ORDER(ip);
                stopwatch.Stop();
                response         = serializer.Serialize(op);
                HEADER_ID        = op.X_HEADER_REC.HEADER_ID;
                CREATION_DATE    = op.X_HEADER_REC.CREATION_DATE;
                LAST_UPDATE_DATE = op.X_HEADER_REC.LAST_UPDATE_DATE;
                FLOW_STATUS_CODE = op.X_HEADER_REC.FLOW_STATUS_CODE;
            }
            catch (Exception ex)
            {
                provider.handleEBSException(ex, "PROCESS_ORDER", IncidentId, ContactId);
                // will throw the new exception (either timeout or error communicating ...)
                throw;
            }

            if (op.X_RETURN_STATUS == "S")
            {
                logMessage = "Response of saving Order(PROCESS_ORDER). ";
                logNote    = "Response Payload: " + response;
                provider.log.DebugLog(IncidentId, ContactId, logMessage, logNote, (int)stopwatch.ElapsedMilliseconds);
            }
            else
            {
                logMessage = "Response of saving Order (PROCESS_ORDER (Failure). ";
                logNote    = "Response Payload: " + response;
                provider.log.ErrorLog(IncidentId, ContactId, logMessage, logNote);
            }
            return(this);
        }
コード例 #3
0
 /// <remarks/>
 public System.IAsyncResult BeginPROCESS_ORDER(InputParameters InputParameters, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("PROCESS_ORDER", new object[] {
                 InputParameters}, callback, asyncState);
 }
コード例 #4
0
 /// <remarks/>
 public void PROCESS_ORDERAsync(InputParameters InputParameters) {
     this.PROCESS_ORDERAsync(InputParameters, null);
 }
コード例 #5
0
ファイル: Order.cs プロジェクト: oo00spy00oo/Accelerators
        public Order Save()
        {
            string request = "";
            string response = "";
            string logMessage, logNote;
            var provider = _provider as LiveEBSProvider;
            if (String.IsNullOrWhiteSpace(provider.OrderInboundURL))
            {
                throw new Exception("Provider's InitForOrder not run.");
            }

            PROCESS_ORDER.OE_INBOUND_INT_Service client = EBSProxyFactory.GetOrderInboundServiceInstance(provider.OrderInboundURL, ConfigurationSetting.username, ConfigurationSetting.password, ConfigurationSetting.EBSServiceTimeout);
            PROCESS_ORDER.SOAHeader hdr = new PROCESS_ORDER.SOAHeader();
            hdr.Responsibility = "ORDER_MGMT_SUPER_USER";
            hdr.RespApplication = "ONT";
            hdr.Org_Id = "204";
            hdr.SecurityGroup = "STANDARD";
            hdr.NLSLanguage = "AMERICAN";

            client.SOAHeaderValue = hdr;

            var ip = new PROCESS_ORDER.InputParameters();

            ip.P_API_VERSION_NUMBER = 1;
            ip.P_API_VERSION_NUMBERSpecified = true;
            ip.P_INIT_MSG_LIST = "T";
            ip.P_RETURN_VALUES = "T";
            ip.P_ACTION_COMMIT = "T";
            ip.P_RTRIM_DATA = "T";

            ip.P_HEADER_REC = new PROCESS_ORDER.APPSOE_ORDER_PUB_HEADER_REC_TYPE();
            ip.P_HEADER_REC.ATTRIBUTE15 = ATTRIBUTE15;
            ip.P_HEADER_REC.BOOKED_FLAG = "N";
            ip.P_HEADER_REC.ORDER_TYPE_ID = 1430;
            ip.P_HEADER_REC.ORDER_TYPE_IDSpecified = true;
            ip.P_HEADER_REC.OPERATION = "CREATE";

            ip.P_LINE_TBL = new PROCESS_ORDER.APPSOE_ORDER_PUB_LINE_REC_TYPE[Items.Count];
            var items = Items.ToArray();
            for (int i = 0; i < Items.Count; i++)
            {
                var src = items[i];
                var dest = ip.P_LINE_TBL[i] = new PROCESS_ORDER.APPSOE_ORDER_PUB_LINE_REC_TYPE();
                dest.INVENTORY_ITEM_ID = src.INVENTORY_ITEM_ID;
                dest.INVENTORY_ITEM_IDSpecified = true;
                dest.ORDERED_QUANTITY = src.ORDERED_QUANTITY;
                dest.ORDERED_QUANTITYSpecified = true;
                dest.UNIT_SELLING_PRICE = src.UNIT_SELLING_PRICE;
                dest.UNIT_SELLING_PRICESpecified = true;
                dest.OPERATION = "CREATE";
            }
            PROCESS_ORDER.OutputParameters op = null;
            Stopwatch stopwatch = new Stopwatch();
            try
            {
                var serializer = LiveEBSProvider.serializer;
                request = serializer.Serialize(ip);

                logMessage = "Request of saving Order (PROCESS_ORDER). ";
                logNote = "Request Payload: " + request;
                provider.log.DebugLog(IncidentId, ContactId, logMessage, logNote);
                // call the web service, catch the exception right away
                stopwatch.Start();
                op = client.PROCESS_ORDER(ip);
                stopwatch.Stop();
                response = serializer.Serialize(op);
                HEADER_ID = op.X_HEADER_REC.HEADER_ID;
                CREATION_DATE = op.X_HEADER_REC.CREATION_DATE;
                LAST_UPDATE_DATE = op.X_HEADER_REC.LAST_UPDATE_DATE;
                FLOW_STATUS_CODE = op.X_HEADER_REC.FLOW_STATUS_CODE;
            }
            catch (Exception ex)
            {
                provider.handleEBSException(ex, "PROCESS_ORDER", IncidentId, ContactId);
                // will throw the new exception (either timeout or error communicating ...)
                throw;
            }

            if (op.X_RETURN_STATUS == "S")
            {
                logMessage = "Response of saving Order(PROCESS_ORDER). ";
                logNote = "Response Payload: " + response;
                provider.log.DebugLog(IncidentId, ContactId, logMessage, logNote, (int)stopwatch.ElapsedMilliseconds);
            }
            else
            {
                logMessage = "Response of saving Order (PROCESS_ORDER (Failure). ";
                logNote = "Response Payload: " + response;
                provider.log.ErrorLog(IncidentId, ContactId, logMessage, logNote);
            }
            return this;
        }