/// <remarks/>
 public void CREATE_REPAIR_ORDERAsync(InputParameters InputParameters, object userState) {
     if ((this.CREATE_REPAIR_ORDEROperationCompleted == null)) {
         this.CREATE_REPAIR_ORDEROperationCompleted = new System.Threading.SendOrPostCallback(this.OnCREATE_REPAIR_ORDEROperationCompleted);
     }
     this.InvokeAsync("CREATE_REPAIR_ORDER", new object[] {
                 InputParameters}, this.CREATE_REPAIR_ORDEROperationCompleted, userState);
 }
 /// <remarks/>
 public System.IAsyncResult BeginCREATE_REPAIR_ORDER(InputParameters InputParameters, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("CREATE_REPAIR_ORDER", new object[] {
                 InputParameters}, callback, asyncState);
 }
 /// <remarks/>
 public void CREATE_REPAIR_ORDERAsync(InputParameters InputParameters) {
     this.CREATE_REPAIR_ORDERAsync(InputParameters, null);
 }
Пример #4
0
        public RepairOrder CreateRO(RepairOrder ro, int _logIncidentId = 0, int _logContactId = 0)
        {
            RepairOrder result = ro;
            string request = "";
            string response = "";
            string logMessage, logNote;

            if (String.IsNullOrWhiteSpace(ROCreateURL) || String.IsNullOrWhiteSpace(ROServiceUsername) || String.IsNullOrWhiteSpace(ROServicePassword))
            {
                throw new Exception("Provider's InitForRO not run.");
            }

            RO.CSD_REPAIRS_PUB_Service client = EBSProxyFactory.GetDepotInstance(ROCreateURL, ROServiceUsername, ROServicePassword, ROServiceTimeout);
            RO.SOAHeader hdr = new RO.SOAHeader();
            hdr.Responsibility = "ORACLE_SUPPORT";
            hdr.RespApplication = "CSS";
            hdr.Org_Id = "204";
            hdr.SecurityGroup = "STANDARD";
            hdr.NLSLanguage = "AMERICAN";

            client.SOAHeaderValue = hdr;

            if (ro.RepairNumber == null)
            {
                RO.InputParameters ip_create_ro = new RO.InputParameters();
                ip_create_ro.P_API_VERSION_NUMBER = 1.0M;
                ip_create_ro.P_API_VERSION_NUMBERSpecified = true;
                ip_create_ro.P_INIT_MSG_LIST = "T";
                ip_create_ro.P_COMMIT = "F";
                ip_create_ro.P_CREATE_DEFAULT_LOGISTICS = "N";

                RO.APPSCSD_REPAIRS_PUB_RX220752X1X6 ro_info = new RO.APPSCSD_REPAIRS_PUB_RX220752X1X6();
                ro_info.INCIDENT_ID = ro.ServiceRequestID;
                ro_info.INCIDENT_IDSpecified = true;
                ro_info.UNIT_OF_MEASURE = ro.UnitOfMeasure;
                ro_info.REPAIR_TYPE_ID = ro.RepairTypeID;
                ro_info.REPAIR_TYPE_IDSpecified = true;
                ro_info.QUANTITY = ro.Quantity;
                ro_info.QUANTITYSpecified = true;
                ro_info.INVENTORY_ITEM_ID = ro.InventoryItemID;
                ro_info.INVENTORY_ITEM_IDSpecified = true;
                ro_info.APPROVAL_REQUIRED_FLAG = ro.ApprovalRequired;
                ro_info.CURRENCY_CODE = ro.Currency;
                ro_info.PROBLEM_DESCRIPTION = ro.ProblemDescription;
                ro_info.RESOURCE_ID = ro.ResourceID;
                ro_info.RESOURCE_IDSpecified = true;
                ro_info.AUTO_PROCESS_RMA = String.Empty;
                ro_info.SERIAL_NUMBER = ro.SerialNumber;
                if (!string.IsNullOrWhiteSpace(ro.HasValidSerialNumber))
                    ro_info.ATTRIBUTE15 = ro.HasValidSerialNumber;

                ip_create_ro.P_REPLN_REC = ro_info;
                Stopwatch stopwatch = new Stopwatch();
                try
                {
                    request = serializer.Serialize(ip_create_ro);
                    stopwatch.Start();
                    RO.OutputParameters op_create_ro = client.CREATE_REPAIR_ORDER(ip_create_ro);
                    stopwatch.Stop();
                    response = serializer.Serialize(op_create_ro);

                    if (op_create_ro.X_RETURN_STATUS == "S")
                    {
                        result.RepairNumber = op_create_ro.X_REPAIR_NUMBER;
                        result.RepairLineID = Convert.ToDecimal(op_create_ro.X_REPAIR_LINE_ID);

                        logMessage = "Request of creating Repair Order (Success). Created RO Number: " + result.RepairNumber;
                        logNote = "Request Payload: " + request;
                        log.DebugLog(_logIncidentId, _logContactId, logMessage, logNote);

                        logMessage = "Response of creating Repair Order (Success). Created RO Number: " + result.RepairNumber;
                        logNote = "Response Payload: " + response;

                        log.DebugLog(_logIncidentId, _logContactId, logMessage, logNote, (int)stopwatch.ElapsedMilliseconds);
                    }
                    else
                    {
                        result.ErrorMessage = "There has been an error communicating with EBS. Please check log for detail.";

                        logMessage = "Request of creating Repair Order (Failure). " + op_create_ro.X_MSG_DATA;
                        logNote = "Request Payload: " + request;
                        log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote);

                        logMessage = "Response of creating Repair Order (Failure). " + op_create_ro.X_MSG_DATA;
                        logNote = "Response Payload: " + response;
                        log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote);
                    }
                }
                catch (Exception ex)
                {
                    result.ErrorMessage = "There has been an error communicating with EBS. Please check log for detail.";

                    logMessage = "Request of creating Repair Order (Failure). " + ex.Message;
                    logNote = "Request Payload: " + request;
                    log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote);

                    logMessage = "Response of creating Repair Order (Failure). " + ex.Message;
                    logNote = "Response Payload: " + response;
                    log.ErrorLog(_logIncidentId, _logContactId, logMessage, logNote);

                    handleEBSException(ex, "Create Repair Order", _logIncidentId, _logContactId);
                }

            }

            return result;
        }