Exemple #1
0
        public WA.Standard.IF.Data.v2.Common.Job.JobGetResponse JobGet(WA.Standard.IF.Data.v2.Common.Job.JobGetRequest request)
        {
            WA.Standard.IF.Data.v2.Common.Job.JobGetResponse response = new WA.Standard.IF.Data.v2.Common.Job.JobGetResponse();

            #region v2.WA.v2 - WA.Standard.IF.WebService

            #region JobGet Request Set

            //Create proxy credential
            NetworkCredential proxycredential = new NetworkCredential(request.TransactionHeader.Username, request.TransactionHeader.Password);

            //Create proxy web service from dms web service with credential
            WA.v2.WS_Job.Job proxyws = new WA.v2.WS_Job.Job();
            proxyws.Credentials = proxycredential;

            //Create proxy request with jobget and transaction
            WA.v2.WS_Job.JobGetRequest proxyrequest = new WA.v2.WS_Job.JobGetRequest();

            //Create proxy transaction
            WA.v2.WS_Job.TransactionHeader proxytransactionheader = new WA.v2.WS_Job.TransactionHeader();
            if (request.TransactionHeader != null)
            {
                #region//TransactionHeader Set
                proxytransactionheader.CountryID = request.TransactionHeader.CountryID;
                proxytransactionheader.DealerID = request.TransactionHeader.DealerID;
                proxytransactionheader.DistributorID = request.TransactionHeader.DistributorID;
                proxytransactionheader.DMSCode = request.TransactionHeader.DMSCode;
                proxytransactionheader.DMSServerUrl = request.TransactionHeader.DMSServerUrl;
                proxytransactionheader.DMSVersion = request.TransactionHeader.DMSVersion;
                proxytransactionheader.DocumentVersion = request.TransactionHeader.DocumentVersion;
                proxytransactionheader.GroupID = request.TransactionHeader.GroupID;
                proxytransactionheader.IneterfaceID = request.TransactionHeader.IneterfaceID;
                proxytransactionheader.Password = request.TransactionHeader.Password;
                proxytransactionheader.PollingToken = request.TransactionHeader.PollingToken;
                proxytransactionheader.RequestPollingToken = request.TransactionHeader.RequestPollingToken;
                proxytransactionheader.RequestType = request.TransactionHeader.RequestType;
                proxytransactionheader.TransactionId = request.TransactionHeader.TransactionId;
                proxytransactionheader.TransactionDateTimeLocal = request.TransactionHeader.TransactionDateTimeLocal;
                proxytransactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeUTC;
                proxytransactionheader.TransactionType = request.TransactionHeader.TransactionType;
                proxytransactionheader.Username = request.TransactionHeader.Username;
                proxytransactionheader.VenderTrackingCode = request.TransactionHeader.VenderTrackingCode;
                proxyrequest.TransactionHeader = proxytransactionheader;
                proxyws.Url = string.Format("{0}/rtr-atest/ws/Job.1cws", proxytransactionheader.DMSServerUrl);
                #endregion
            }

            //Create proxy jobget
            WA.v2.WS_Job.JobGet proxyjobget = new WA.v2.WS_Job.JobGet();
            if (request.JobGet != null)
            {
                #region//JobGet Set
                proxyjobget.DMSAppointmentNo = request.JobGet.DMSAppointmentNo;
                proxyjobget.DMSJobNo = request.JobGet.DMSJobNo;
                proxyjobget.DMSJobStatus = Map.SetDMSCodeFromWACode(CodeType.DMSJobStatus, request.JobGet.DMSJobStatus);
                proxyjobget.DMSRONo = request.JobGet.DMSRONo;
                proxyjobget.LastModifiedDateTimeFromUTC = request.JobGet.LastModifiedDateTimeFromUTC;
                proxyjobget.LastModifiedDateTimeToUTC = request.JobGet.LastModifiedDateTimeToUTC;
                proxyjobget.ScheduledDateTimeFromLocal = request.JobGet.ScheduledDateTimeFromLocal;
                proxyjobget.ScheduledDateTimeToLocal = request.JobGet.ScheduledDateTimeToLocal;
                proxyrequest.JobGet = proxyjobget;
                #endregion
            }

            #endregion

            //Run proxy web method with proxy request
            WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "DMS JobGetRequest XML", proxyrequest);

            WA.v2.WS_Job.JobGetResponse proxyresponse = proxyws.JobGet(proxyrequest);

            WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "DMS JobGetResponse XML", proxyresponse);

            //Mapping with Standard Interface Specification Object
            if (proxyresponse != null)
            {
                if (proxyresponse.TransactionHeader != null)
                {
                    #region//TransactionHeader Set
                    WA.Standard.IF.Data.v2.Common.Common.TransactionHeader transactionheader = new WA.Standard.IF.Data.v2.Common.Common.TransactionHeader();
                    transactionheader.CountryID = proxyresponse.TransactionHeader.CountryID;
                    transactionheader.DealerID = proxyresponse.TransactionHeader.DealerID;
                    transactionheader.DistributorID = proxyresponse.TransactionHeader.DistributorID;
                    transactionheader.DMSCode = proxyresponse.TransactionHeader.DMSCode;
                    transactionheader.DMSServerUrl = proxyresponse.TransactionHeader.DMSServerUrl;
                    transactionheader.DMSVersion = proxyresponse.TransactionHeader.DMSVersion;
                    transactionheader.DocumentVersion = proxyresponse.TransactionHeader.DocumentVersion;
                    transactionheader.GroupID = proxyresponse.TransactionHeader.GroupID;
                    transactionheader.IneterfaceID = proxyresponse.TransactionHeader.IneterfaceID;
                    transactionheader.Password = proxyresponse.TransactionHeader.Password;
                    transactionheader.PollingToken = proxyresponse.TransactionHeader.PollingToken;
                    transactionheader.RequestPollingToken = proxyresponse.TransactionHeader.RequestPollingToken;
                    transactionheader.RequestType = proxyresponse.TransactionHeader.RequestType;
                    transactionheader.TransactionId = proxyresponse.TransactionHeader.TransactionId;
                    transactionheader.TransactionDateTimeLocal = proxyresponse.TransactionHeader.TransactionDateTimeLocal;
                    transactionheader.TransactionDateTimeUTC = proxyresponse.TransactionHeader.TransactionDateTimeUTC;
                    transactionheader.TransactionType = proxyresponse.TransactionHeader.TransactionType;
                    transactionheader.Username = proxyresponse.TransactionHeader.Username;
                    transactionheader.VenderTrackingCode = proxyresponse.TransactionHeader.VenderTrackingCode;
                    response.TransactionHeader = transactionheader;
                    #endregion
                }

                //ResultMessage Set
                if (proxyresponse.ResultMessage != null)
                {
                    response.ResultMessage = GetResultMessageData(proxyresponse.ResultMessage.Code, proxyresponse.ResultMessage.Message);
                }

                if (proxyresponse.Errors != null)
                {
                    //Error List Set
                    foreach (WA.v2.WS_Job.Error proxyerror in proxyresponse.Errors)
                    {
                        if (response.Errors != null)
                            response.Errors.Add(GetErrorData(proxyerror.Code, proxyerror.Message));
                        else
                            response.Errors = GetErrorDataList(proxyerror.Code, proxyerror.Message);
                    }
                }
                else
                {
                    #region//JobGetResponse Set

                    if (proxyresponse.Jobs != null && proxyresponse.Jobs.Length > 0)
                    {
                        response.Jobs = new List<WA.Standard.IF.Data.v2.Common.Job.Job>();
                        foreach (WA.v2.WS_Job.Job1 proxyjob in proxyresponse.Jobs)
                        {
                            #region//Job Header
                            WA.Standard.IF.Data.v2.Common.Job.Job job = new WA.Standard.IF.Data.v2.Common.Job.Job();
                            job.ActualHours = proxyjob.ActualHours;
                            job.DMSJobNo = proxyjob.DMSJobNo;
                            job.DMSRONo = proxyjob.DMSRONo;
                            job.DMSAppointmentNo = proxyjob.DMSAppointmentNo;
                            job.ServiceLineNumber = proxyjob.ServiceLineNumber;
                            job.SkillLevel = proxyjob.SkillLevel;
                            job.DMSJobStatus = proxyjob.DMSJobStatus;
                            #endregion

                            #region //Job ManagementFields
                            if (proxyjob.ManagementFields != null)
                            {
                                WA.Standard.IF.Data.v2.Common.Common.ManagementFields managementfields = new WA.Standard.IF.Data.v2.Common.Common.ManagementFields();
                                managementfields.CreateDateTimeUTC = proxyjob.ManagementFields.CreateDateTimeUTC;
                                managementfields.LastModifiedDateTimeUTC = proxyjob.ManagementFields.LastModifiedDateTimeUTC;
                                job.ManagementFields = managementfields;
                            }
                            #endregion

                            #region//Job Comments - Not Used
                            if (proxyjob.Comments != null && proxyjob.Comments.Length > 0)
                            {
                                job.Comments = new List<WA.Standard.IF.Data.v2.Common.Common.Comment>();
                                foreach (WA.v2.WS_Job.Comment proxycomment in proxyjob.Comments)
                                {
                                    WA.Standard.IF.Data.v2.Common.Common.Comment comment = new WA.Standard.IF.Data.v2.Common.Common.Comment();
                                    comment.DescriptionComment = proxycomment.DescriptionComment;
                                    comment.SequenceNumber = proxycomment.SequenceNumber;
                                    job.Comments.Add(comment);
                                }
                            }
                            #endregion

                            #region//Job Descriptions - Not Used
                            if (proxyjob.Descriptions != null && proxyjob.Descriptions.Length > 0)
                            {
                                job.Descriptions = new List<WA.Standard.IF.Data.v2.Common.Common.Description>();
                                foreach (WA.v2.WS_Job.Description proxydescription in proxyjob.Descriptions)
                                {
                                    WA.Standard.IF.Data.v2.Common.Common.Description description = new WA.Standard.IF.Data.v2.Common.Common.Description();
                                    description.DescriptionComment = proxydescription.DescriptionComment;
                                    description.SequenceNumber = proxydescription.SequenceNumber;
                                    job.Descriptions.Add(description);
                                }
                            }
                            #endregion

                            #region//Job Causes - Not Used
                            if (proxyjob.Causes != null && proxyjob.Causes.Length > 0)
                            {
                                job.Causes = new List<WA.Standard.IF.Data.v2.Common.Common.Cause>();
                                foreach (WA.v2.WS_Job.Cause proxycause in proxyjob.Causes)
                                {
                                    WA.Standard.IF.Data.v2.Common.Common.Cause cause = new WA.Standard.IF.Data.v2.Common.Common.Cause();
                                    cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                    cause.Comment = proxycause.Comment;
                                    cause.SequenceNumber = proxycause.SequenceNumber;
                                    job.Causes.Add(cause);
                                }
                            }
                            #endregion

                            #region//Job Corrections - Not Used
                            if (proxyjob.Corrections != null && proxyjob.Corrections.Length > 0)
                            {
                                job.Corrections = new List<WA.Standard.IF.Data.v2.Common.Common.Correction>();
                                foreach (WA.v2.WS_Job.Correction proxycorrection in proxyjob.Corrections)
                                {
                                    WA.Standard.IF.Data.v2.Common.Common.Correction cause = new WA.Standard.IF.Data.v2.Common.Common.Correction();
                                    cause.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                    cause.Comment = proxycorrection.Comment;
                                    cause.SequenceNumber = proxycorrection.SequenceNumber;
                                    job.Corrections.Add(cause);
                                }
                            }
                            #endregion

                            #region//Job OPCodes
                            if (proxyjob.OPCodes != null && proxyjob.OPCodes.Length > 0)
                            {
                                job.OPCodes = new List<WA.Standard.IF.Data.v2.Common.Job.OPCode>();
                                foreach (WA.v2.WS_Job.OPCode proxyopcode in proxyjob.OPCodes)
                                {
                                    #region//Job OPCode Header
                                    WA.Standard.IF.Data.v2.Common.Job.OPCode opcode = new WA.Standard.IF.Data.v2.Common.Job.OPCode();
                                    opcode.ActualHours = proxyopcode.ActualHours;
                                    opcode.Code = proxyopcode.Code;
                                    opcode.Description = proxyopcode.Description;
                                    opcode.EstimatedHours = proxyopcode.EstimatedHours;
                                    opcode.SkillLevel = proxyopcode.SkillLevel;
                                    #endregion

                                    #region//Job OPCode Comments - Not Used
                                    //if (proxyopcode.Comments != null && proxyopcode.Comments.Length > 0)
                                    //{
                                    //    opcode.Comments = new List<WA.Standard.IF.Data.v2.Common.Common.Comment>();
                                    //    foreach (WA.v2.WS_Job.Comment proxycomment in proxyopcode.Comments)
                                    //    {
                                    //        WA.Standard.IF.Data.v2.Common.Common.Comment comment = new WA.Standard.IF.Data.v2.Common.Common.Comment();
                                    //        comment.DescriptionComment = proxycomment.DescriptionComment;
                                    //        comment.SequenceNumber = proxycomment.SequenceNumber;
                                    //        opcode.Comments.Add(comment);
                                    //    }
                                    //}
                                    #endregion

                                    #region//Job OPCode Descriptions - Not Used
                                    //if (proxyopcode.Descriptions != null && proxyopcode.Descriptions.Length > 0)
                                    //{
                                    //    opcode.Descriptions = new List<WA.Standard.IF.Data.v2.Common.Common.Description>();
                                    //    foreach (WA.v2.WS_Job.Description proxydescription in proxyopcode.Descriptions)
                                    //    {
                                    //        WA.Standard.IF.Data.v2.Common.Common.Description description = new WA.Standard.IF.Data.v2.Common.Common.Description();
                                    //        description.DescriptionComment = proxydescription.DescriptionComment;
                                    //        description.SequenceNumber = proxydescription.SequenceNumber;
                                    //        opcode.Descriptions.Add(description);
                                    //    }
                                    //}
                                    #endregion

                                    #region//Job OPCode Causes - Not Used
                                    //if (proxyopcode.Causes != null && proxyopcode.Causes.Length > 0)
                                    //{
                                    //    opcode.Causes = new List<WA.Standard.IF.Data.v2.Common.Common.Cause>();
                                    //    foreach (WA.v2.WS_Job.Cause proxycause in proxyopcode.Causes)
                                    //    {
                                    //        WA.Standard.IF.Data.v2.Common.Common.Cause cause = new WA.Standard.IF.Data.v2.Common.Common.Cause();
                                    //        cause.CauseLaborOpCode = proxycause.CauseLaborOpCode;
                                    //        cause.Comment = proxycause.Comment;
                                    //        cause.SequenceNumber = proxycause.SequenceNumber;
                                    //        opcode.Causes.Add(cause);
                                    //    }
                                    //}
                                    #endregion

                                    #region//Job OPCode Corrections - Not Used
                                    //if (proxyopcode.Corrections != null && proxyopcode.Corrections.Length > 0)
                                    //{
                                    //    opcode.Corrections = new List<WA.Standard.IF.Data.v2.Common.Common.Correction>();
                                    //    foreach (WA.v2.WS_Job.Correction proxycorrection in proxyopcode.Corrections)
                                    //    {
                                    //        WA.Standard.IF.Data.v2.Common.Common.Correction correction = new WA.Standard.IF.Data.v2.Common.Common.Correction();
                                    //        correction.CorrectionLaborOpCode = proxycorrection.CorrectionLaborOpCode;
                                    //        correction.Comment = proxycorrection.Comment;
                                    //        correction.SequenceNumber = proxycorrection.SequenceNumber;
                                    //        opcode.Corrections.Add(correction);
                                    //    }
                                    //}
                                    #endregion

                                    job.OPCodes.Add(opcode);
                                }
                            }
                            #endregion

                            #region//Job Plan
                            if (proxyjob.Plan != null)
                            {
                                #region//Job Plan Header
                                WA.Standard.IF.Data.v2.Common.Job.Plan plan = new WA.Standard.IF.Data.v2.Common.Job.Plan();
                                plan.ScheduledDateTimeFromLocal = proxyjob.Plan.ScheduledDateTimeFromLocal;
                                plan.ScheduledDateTimeToLocal = proxyjob.Plan.ScheduledDateTimeToLocal;
                                plan.StallID = proxyjob.Plan.StallID;
                                plan.StallName = proxyjob.Plan.StallName;
                                #endregion

                                #region//Job Technicians
                                if (proxyjob.Plan.Technicians != null && proxyjob.Plan.Technicians.Length > 0)
                                {
                                    plan.Technicians = new List<WA.Standard.IF.Data.v2.Common.Job.Technician>();
                                    foreach (WA.v2.WS_Job.Technician proxytechnician in proxyjob.Plan.Technicians)
                                    {
                                        WA.Standard.IF.Data.v2.Common.Job.Technician technician = new WA.Standard.IF.Data.v2.Common.Job.Technician();
                                        technician.TCEmployeeID = proxytechnician.TCEmployeeID;
                                        technician.TCEmployeeName = proxytechnician.TCEmployeeName;
                                        plan.Technicians.Add(technician);
                                    }
                                }
                                #endregion

                                job.Plan = plan;
                            }
                            #endregion

                            #region//Job Dispatch
                            if (proxyjob.Dispatch != null)
                            {
                                #region//Job Dispatch Header
                                WA.Standard.IF.Data.v2.Common.Job.Dispatch dispatch = new WA.Standard.IF.Data.v2.Common.Job.Dispatch();
                                dispatch.ScheduledDateTimeFromLocal = proxyjob.Dispatch.ScheduledDateTimeFromLocal;
                                dispatch.ScheduledDateTimeToLocal = proxyjob.Dispatch.ScheduledDateTimeToLocal;
                                dispatch.StallID = proxyjob.Dispatch.StallID;
                                dispatch.StallName = proxyjob.Dispatch.StallName;
                                #endregion

                                #region//Job Technicians
                                if (proxyjob.Dispatch.Technicians != null && proxyjob.Dispatch.Technicians.Length > 0)
                                {
                                    dispatch.Technicians = new List<WA.Standard.IF.Data.v2.Common.Job.Technician>();
                                    foreach (WA.v2.WS_Job.Technician proxytechnician in proxyjob.Dispatch.Technicians)
                                    {
                                        WA.Standard.IF.Data.v2.Common.Job.Technician technician = new WA.Standard.IF.Data.v2.Common.Job.Technician();
                                        technician.TCEmployeeID = proxytechnician.TCEmployeeID;
                                        technician.TCEmployeeName = proxytechnician.TCEmployeeName;
                                        dispatch.Technicians.Add(technician);
                                    }
                                }
                                #endregion

                                job.Dispatch = dispatch;
                            }
                            #endregion

                            #region//Job Actual
                            if (proxyjob.Actual != null)
                            {
                                #region//Job Actual Header
                                WA.Standard.IF.Data.v2.Common.Job.Actual actual = new WA.Standard.IF.Data.v2.Common.Job.Actual();
                                actual.StallID = proxyjob.Actual.StallID;
                                actual.StallName = proxyjob.Actual.StallName;
                                #endregion

                                #region//Job ActualTimeLogs
                                if (proxyjob.Actual.ActualTimeLogs != null && proxyjob.Actual.ActualTimeLogs.Length > 0)
                                {
                                    actual.ActualTimeLogs = new List<WA.Standard.IF.Data.v2.Common.Job.ActualTimeLog>();
                                    foreach (WA.v2.WS_Job.ActualTimeLog proxyactualtimelog in proxyjob.Actual.ActualTimeLogs)
                                    {
                                        WA.Standard.IF.Data.v2.Common.Job.ActualTimeLog actualtimelog = new WA.Standard.IF.Data.v2.Common.Job.ActualTimeLog();
                                        actualtimelog.EndDateTimeLocal = proxyactualtimelog.EndDateTimeLocal;
                                        actualtimelog.PauseReasonCode = Map.GetWACodeFromDMSCode(CodeType.PauseReasonCode, proxyactualtimelog.PauseReasonCode);
                                        actualtimelog.PauseReasonComment = proxyactualtimelog.PauseReasonComment;
                                        actualtimelog.StartDateTimeLocal = proxyactualtimelog.StartDateTimeLocal;
                                        actualtimelog.Status = Map.GetWACodeFromDMSCode(CodeType.ActualJobStatus, proxyactualtimelog.Status);
                                        actualtimelog.TCEmployeeID = proxyactualtimelog.TCEmployeeID;
                                        actualtimelog.TCEmployeeName = proxyactualtimelog.TCEmployeeName;
                                        actual.ActualTimeLogs.Add(actualtimelog);
                                    }
                                }
                                #endregion

                                #region//Job JobComments
                                if (proxyjob.Actual.JobComments != null && proxyjob.Actual.JobComments.Length > 0)
                                {
                                    actual.JobComments = new List<WA.Standard.IF.Data.v2.Common.Job.JobComment>();
                                    foreach (WA.v2.WS_Job.JobComment proxyjobcomment in proxyjob.Actual.JobComments)
                                    {
                                        WA.Standard.IF.Data.v2.Common.Job.JobComment jobcomment = new WA.Standard.IF.Data.v2.Common.Job.JobComment();
                                        jobcomment.ActualWorkHour = proxyjobcomment.ActualWorkHour;
                                        jobcomment.SubStatus = Map.GetWACodeFromDMSCode(CodeType.JobSubStatus, proxyjobcomment.SubStatus);
                                        actual.JobComments.Add(jobcomment);
                                    }
                                }
                                #endregion

                                job.Actual = actual;
                            }
                            #endregion

                            response.Jobs.Add(job);
                        }
                    }
                    else
                    {
                        response.ResultMessage = GetResultMessageData(WA.Standard.IF.Data.v2.Common.Common.ResponseCode.NoResult, WA.Standard.IF.Data.v2.Common.Common.ResponseMessage.NoResult);
                    }
                    #endregion
                }
            }
            #endregion

            return response;
        }
Exemple #2
0
        public WA.Standard.IF.Data.v2.Common.Job.JobChangeResponse JobChange(WA.Standard.IF.Data.v2.Common.Job.JobChangeRequest request)
        {
            WA.Standard.IF.Data.v2.Common.Job.JobChangeResponse response = new WA.Standard.IF.Data.v2.Common.Job.JobChangeResponse();

            #region v2.WA.v2 - WA.Standard.IF.WebService

            #region JobChange Request Set

            //Create proxy credential
            NetworkCredential proxycredential = new NetworkCredential(request.TransactionHeader.Username, request.TransactionHeader.Password);

            //Create proxy web service from dms web service with credential
            WA.v2.WS_Job.Job proxyws = new WA.v2.WS_Job.Job();
            proxyws.Credentials = proxycredential;

            //Create proxy request with jobchange and transaction
            WA.v2.WS_Job.JobChangeRequest proxyrequest = new WA.v2.WS_Job.JobChangeRequest();

            //Create proxy transaction
            WA.v2.WS_Job.TransactionHeader2 proxytransactionheader = new WA.v2.WS_Job.TransactionHeader2();
            if (request.TransactionHeader != null)
            {
                #region//TransactionHeader Set
                proxytransactionheader.CountryID = request.TransactionHeader.CountryID;
                proxytransactionheader.DealerID = request.TransactionHeader.DealerID;
                proxytransactionheader.DistributorID = request.TransactionHeader.DistributorID;
                proxytransactionheader.DMSCode = request.TransactionHeader.DMSCode;
                proxytransactionheader.DMSServerUrl = request.TransactionHeader.DMSServerUrl;
                proxytransactionheader.DMSVersion = request.TransactionHeader.DMSVersion;
                proxytransactionheader.DocumentVersion = request.TransactionHeader.DocumentVersion;
                proxytransactionheader.GroupID = request.TransactionHeader.GroupID;
                proxytransactionheader.IneterfaceID = request.TransactionHeader.IneterfaceID;
                proxytransactionheader.Password = request.TransactionHeader.Password;
                proxytransactionheader.PollingToken = request.TransactionHeader.PollingToken;
                proxytransactionheader.RequestPollingToken = request.TransactionHeader.RequestPollingToken;
                proxytransactionheader.RequestType = request.TransactionHeader.RequestType;
                proxytransactionheader.TransactionId = request.TransactionHeader.TransactionId;
                proxytransactionheader.TransactionDateTimeLocal = request.TransactionHeader.TransactionDateTimeLocal;
                proxytransactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeUTC;
                proxytransactionheader.TransactionType = request.TransactionHeader.TransactionType;
                proxytransactionheader.Username = request.TransactionHeader.Username;
                proxytransactionheader.VenderTrackingCode = request.TransactionHeader.VenderTrackingCode;
                proxyrequest.TransactionHeader = proxytransactionheader;
                proxyws.Url = string.Format("{0}/rtr-atest/ws/Job.1cws", proxytransactionheader.DMSServerUrl);
                #endregion
            }

            //Create proxy jobchange
            WA.v2.WS_Job.JobChange proxyjobchange = new WA.v2.WS_Job.JobChange();
            if (request.JobChange != null)
            {
                #region//JobChange Header
                proxyjobchange.ActualHours = request.JobChange.ActualHours;
                proxyjobchange.DMSJobNo = request.JobChange.DMSJobNo;
                proxyjobchange.DMSRONo = request.JobChange.DMSRONo;
                proxyjobchange.DMSAppointmentNo = request.JobChange.DMSAppointmentNo;
                proxyjobchange.EstimatedHours = request.JobChange.EstimatedHours;
                proxyjobchange.ServiceLineNumber = request.JobChange.ServiceLineNumber;
                proxyjobchange.SkillLevel = request.JobChange.SkillLevel;
                #endregion

                #region//JobChange Comments
                if (request.JobChange.Comments != null && request.JobChange.Comments.Count > 0)
                {
                    int commentscnt = 0;
                    WA.v2.WS_Job.Comment1[] proxycomments = new WA.v2.WS_Job.Comment1[request.JobChange.Comments.Count];
                    foreach (WA.Standard.IF.Data.v2.Common.Common.Comment Comment in request.JobChange.Comments)
                    {
                        WA.v2.WS_Job.Comment1 proxycomment = new WA.v2.WS_Job.Comment1();
                        proxycomment.DescriptionComment = Comment.DescriptionComment;
                        proxycomment.SequenceNumber = Comment.SequenceNumber;
                        proxycomments[commentscnt] = proxycomment;
                        commentscnt++;
                    }
                    proxyjobchange.Comments = proxycomments;
                }
                #endregion

                #region//JobChange Descriptions
                if (request.JobChange.Descriptions != null && request.JobChange.Descriptions.Count > 0)
                {
                    int descriptionscnt = 0;
                    WA.v2.WS_Job.Description1[] proxydescriptions = new WA.v2.WS_Job.Description1[request.JobChange.Descriptions.Count];
                    foreach (WA.Standard.IF.Data.v2.Common.Common.Description description in request.JobChange.Descriptions)
                    {
                        WA.v2.WS_Job.Description1 proxydescription = new WA.v2.WS_Job.Description1();
                        proxydescription.DescriptionComment = description.DescriptionComment;
                        proxydescription.SequenceNumber = description.SequenceNumber;
                        proxydescriptions[descriptionscnt] = proxydescription;
                        descriptionscnt++;
                    }
                    proxyjobchange.Descriptions = proxydescriptions;
                }
                #endregion

                #region//JobChange Causes
                if (request.JobChange.Causes != null && request.JobChange.Causes.Count > 0)
                {
                    int causescnt = 0;
                    WA.v2.WS_Job.Cause1[] proxycauses = new WA.v2.WS_Job.Cause1[request.JobChange.Causes.Count];
                    foreach (WA.Standard.IF.Data.v2.Common.Common.Cause cause in request.JobChange.Causes)
                    {
                        WA.v2.WS_Job.Cause1 proxycause = new WA.v2.WS_Job.Cause1();
                        proxycause.CauseLaborOpCode = cause.CauseLaborOpCode;
                        proxycause.Comment = cause.Comment;
                        proxycause.SequenceNumber = cause.SequenceNumber;
                        proxycauses[causescnt] = proxycause;
                        causescnt++;
                    }
                    proxyjobchange.Causes = proxycauses;
                }
                #endregion

                #region//JobChange Corrections
                if (request.JobChange.Corrections != null && request.JobChange.Corrections.Count > 0)
                {
                    int correctionscnt = 0;
                    WA.v2.WS_Job.Correction1[] proxycorrections = new WA.v2.WS_Job.Correction1[request.JobChange.Corrections.Count];
                    foreach (WA.Standard.IF.Data.v2.Common.Common.Correction correction in request.JobChange.Corrections)
                    {
                        WA.v2.WS_Job.Correction1 proxycorrection = new WA.v2.WS_Job.Correction1();
                        proxycorrection.CorrectionLaborOpCode = correction.CorrectionLaborOpCode;
                        proxycorrection.Comment = correction.Comment;
                        proxycorrection.SequenceNumber = correction.SequenceNumber;
                        proxycorrections[correctionscnt] = proxycorrection;
                        correctionscnt++;
                    }
                    proxyjobchange.Corrections = proxycorrections;
                }
                #endregion

                #region//JobChange OPCodes
                if (request.JobChange.OPCodes != null && request.JobChange.OPCodes.Count > 0)
                {
                    int opcodescnt = 0;
                    WA.v2.WS_Job.OPCode1[] proxyopcodes = new WA.v2.WS_Job.OPCode1[request.JobChange.OPCodes.Count];
                    foreach (WA.Standard.IF.Data.v2.Common.Job.OPCode opcode in request.JobChange.OPCodes)
                    {
                        #region//JobChange OPCode Header
                        WA.v2.WS_Job.OPCode1 proxyopcode = new WA.v2.WS_Job.OPCode1();
                        proxyopcode.ActualHours = opcode.ActualHours;
                        proxyopcode.Code = opcode.Code;
                        proxyopcode.Description = opcode.Description;
                        proxyopcode.EstimatedHours = opcode.EstimatedHours;
                        proxyopcode.SkillLevel = opcode.SkillLevel;
                        #endregion

                        #region//JobChange OPCode Comments
                        //if (opcode.Comments != null && opcode.Comments.Count > 0)
                        //{
                        //    int commentscnt = 0;
                        //    WA.v2.WS_Job.Comment1[] proxycomments = new WA.v2.WS_Job.Comment1[opcode.Comments.Count];
                        //    foreach (WA.Standard.IF.Data.v2.Common.Common.Comment comment in opcode.Comments)
                        //    {
                        //        WA.v2.WS_Job.Comment1 proxycomment = new WA.v2.WS_Job.Comment1();
                        //        proxycomment.DescriptionComment = comment.DescriptionComment;
                        //        proxycomment.SequenceNumber = comment.SequenceNumber;
                        //        proxycomments[commentscnt] = proxycomment;
                        //        commentscnt++;
                        //    }
                        //    proxyopcode.Comments = proxycomments;
                        //}
                        #endregion

                        #region//JobChange OPCode Descriptions
                        //if (opcode.Descriptions != null && opcode.Descriptions.Count > 0)
                        //{
                        //    int descriptionscnt = 0;
                        //    WA.v2.WS_Job.Description1[] proxydescriptions = new WA.v2.WS_Job.Description1[opcode.Descriptions.Count];
                        //    foreach (WA.Standard.IF.Data.v2.Common.Common.Description description in opcode.Descriptions)
                        //    {
                        //        WA.v2.WS_Job.Description1 proxydescription = new WA.v2.WS_Job.Description1();
                        //        proxydescription.DescriptionComment = description.DescriptionComment;
                        //        proxydescription.SequenceNumber = description.SequenceNumber;
                        //        proxydescriptions[descriptionscnt] = proxydescription;
                        //        descriptionscnt++;
                        //    }
                        //    proxyopcode.Descriptions = proxydescriptions;
                        //}
                        #endregion

                        #region//JobChange OPCode Causes
                        //if (opcode.Causes != null && opcode.Causes.Count > 0)
                        //{
                        //    int causescnt = 0;
                        //    WA.v2.WS_Job.Cause1[] proxycauses = new WA.v2.WS_Job.Cause1[opcode.Causes.Count];
                        //    foreach (WA.Standard.IF.Data.v2.Common.Common.Cause cause in opcode.Causes)
                        //    {
                        //        WA.v2.WS_Job.Cause1 proxycause = new WA.v2.WS_Job.Cause1();
                        //        proxycause.CauseLaborOpCode = cause.CauseLaborOpCode;
                        //        proxycause.Comment = cause.Comment;
                        //        proxycause.SequenceNumber = cause.SequenceNumber;
                        //        proxycauses[causescnt] = proxycause;
                        //        causescnt++;
                        //    }
                        //    proxyopcode.Causes = proxycauses;
                        //}
                        #endregion

                        #region//JobChange OPCode Corrections
                        //if (opcode.Corrections != null && opcode.Corrections.Count > 0)
                        //{
                        //    int correctionscnt = 0;
                        //    WA.v2.WS_Job.Correction1[] proxycorrections = new WA.v2.WS_Job.Correction1[opcode.Corrections.Count];
                        //    foreach (WA.Standard.IF.Data.v2.Common.Common.Correction correction in opcode.Corrections)
                        //    {
                        //        WA.v2.WS_Job.Correction1 proxycorrection = new WA.v2.WS_Job.Correction1();
                        //        proxycorrection.CorrectionLaborOpCode = correction.CorrectionLaborOpCode;
                        //        proxycorrection.Comment = correction.Comment;
                        //        proxycorrection.SequenceNumber = correction.SequenceNumber;
                        //        proxycorrections[correctionscnt] = proxycorrection;
                        //        correctionscnt++;
                        //    }
                        //    proxyopcode.Corrections = proxycorrections;
                        //}
                        #endregion

                        proxyopcodes[opcodescnt] = proxyopcode;
                        opcodescnt++;
                    }
                    proxyjobchange.OPCodes = proxyopcodes;
                }
                #endregion

                #region//JobChange Plan
                if (request.JobChange.Plan != null)
                {
                    WA.v2.WS_Job.Plan1 proxyplan = new WA.v2.WS_Job.Plan1();
                    proxyplan.ScheduledDateTimeFromLocal = request.JobChange.Plan.ScheduledDateTimeFromLocal;
                    proxyplan.ScheduledDateTimeToLocal = request.JobChange.Plan.ScheduledDateTimeToLocal;
                    proxyplan.StallID = request.JobChange.Plan.StallID;
                    proxyplan.StallName = request.JobChange.Plan.StallName;

                    #region//Technicians
                    if (request.JobChange.Plan.Technicians != null && request.JobChange.Plan.Technicians.Count > 0)
                    {
                        int technicianscnt = 0;
                        WA.v2.WS_Job.Technician1[] proxytechnicians = new WA.v2.WS_Job.Technician1[request.JobChange.Plan.Technicians.Count];
                        foreach (WA.Standard.IF.Data.v2.Common.Job.Technician technician in request.JobChange.Plan.Technicians)
                        {
                            WA.v2.WS_Job.Technician1 proxytechnician = new WA.v2.WS_Job.Technician1();
                            proxytechnician.TCEmployeeID = technician.TCEmployeeID;
                            proxytechnician.TCEmployeeName = technician.TCEmployeeName;
                            proxytechnicians[technicianscnt] = proxytechnician;
                            technicianscnt++;
                        }
                        proxyplan.Technicians = proxytechnicians;
                    }
                    #endregion

                    proxyjobchange.Plan = proxyplan;
                }
                #endregion

                #region//JobChange Dispatch
                if (request.JobChange.Dispatch != null)
                {
                    WA.v2.WS_Job.Dispatch1 proxydispatch = new WA.v2.WS_Job.Dispatch1();
                    proxydispatch.ScheduledDateTimeFromLocal = request.JobChange.Dispatch.ScheduledDateTimeFromLocal;
                    proxydispatch.ScheduledDateTimeToLocal = request.JobChange.Dispatch.ScheduledDateTimeToLocal;
                    proxydispatch.StallID = request.JobChange.Dispatch.StallID;
                    proxydispatch.StallName = request.JobChange.Dispatch.StallName;

                    #region//Technicians
                    if (request.JobChange.Dispatch.Technicians != null && request.JobChange.Dispatch.Technicians.Count > 0)
                    {
                        int technicianscnt = 0;
                        WA.v2.WS_Job.Technician1[] proxytechnicians = new WA.v2.WS_Job.Technician1[request.JobChange.Dispatch.Technicians.Count];
                        foreach (WA.Standard.IF.Data.v2.Common.Job.Technician technician in request.JobChange.Dispatch.Technicians)
                        {
                            WA.v2.WS_Job.Technician1 proxytechnician = new WA.v2.WS_Job.Technician1();
                            proxytechnician.TCEmployeeID = technician.TCEmployeeID;
                            proxytechnician.TCEmployeeName = technician.TCEmployeeName;
                            proxytechnicians[technicianscnt] = proxytechnician;
                            technicianscnt++;
                        }
                        proxydispatch.Technicians = proxytechnicians;
                    }
                    #endregion

                    proxyjobchange.Dispatch = proxydispatch;
                }
                #endregion

                #region//JobChange Actual
                if (request.JobChange.Actual != null)
                {
                    WA.v2.WS_Job.Actual1 proxyactual = new WA.v2.WS_Job.Actual1();
                    proxyactual.StallID = request.JobChange.Actual.StallID;
                    proxyactual.StallName = request.JobChange.Actual.StallName;

                    #region//ActualTimeLogs
                    if (request.JobChange.Actual.ActualTimeLogs != null && request.JobChange.Actual.ActualTimeLogs.Count > 0)
                    {
                        int actualtimelogcnt = 0;
                        WA.v2.WS_Job.ActualTimeLog1[] proxytechnicians = new WA.v2.WS_Job.ActualTimeLog1[request.JobChange.Actual.ActualTimeLogs.Count];
                        foreach (WA.Standard.IF.Data.v2.Common.Job.ActualTimeLog actualtimelog in request.JobChange.Actual.ActualTimeLogs)
                        {
                            WA.v2.WS_Job.ActualTimeLog1 proxyactualtimelog = new WA.v2.WS_Job.ActualTimeLog1();
                            proxyactualtimelog.EndDateTimeLocal = actualtimelog.EndDateTimeLocal;
                            proxyactualtimelog.PauseReasonCode = Map.SetDMSCodeFromWACode(CodeType.PauseReasonCode, actualtimelog.PauseReasonCode);
                            proxyactualtimelog.PauseReasonComment = actualtimelog.PauseReasonComment;
                            proxyactualtimelog.StartDateTimeLocal = actualtimelog.StartDateTimeLocal;
                            proxyactualtimelog.Status = Map.SetDMSCodeFromWACode(CodeType.ActualJobStatus, actualtimelog.Status);
                            proxyactualtimelog.TCEmployeeID = actualtimelog.TCEmployeeID;
                            proxyactualtimelog.TCEmployeeName = actualtimelog.TCEmployeeName;
                            proxytechnicians[actualtimelogcnt] = proxyactualtimelog;
                            actualtimelogcnt++;
                        }
                        proxyactual.ActualTimeLogs = proxytechnicians;
                    }
                    #endregion

                    #region//JobChange JobLogs JobComments
                    if (request.JobChange.Actual.JobComments != null && request.JobChange.Actual.JobComments.Count > 0)
                    {
                        int jobcommentscnt = 0;
                        WA.v2.WS_Job.JobComment1[] proxyjobcomments = new WA.v2.WS_Job.JobComment1[request.JobChange.Actual.JobComments.Count];
                        foreach (WA.Standard.IF.Data.v2.Common.Job.JobComment jobcomment in request.JobChange.Actual.JobComments)
                        {
                            WA.v2.WS_Job.JobComment1 proxyjobcomment = new WA.v2.WS_Job.JobComment1();
                            proxyjobcomment.ActualWorkHour = jobcomment.ActualWorkHour;
                            proxyjobcomment.SubStatus = Map.SetDMSCodeFromWACode(CodeType.JobSubStatus, jobcomment.SubStatus);
                            proxyjobcomments[jobcommentscnt] = proxyjobcomment;
                            jobcommentscnt++;
                        }
                        proxyactual.JobComments = proxyjobcomments;
                    }
                    #endregion

                    proxyjobchange.Actual = proxyactual;
                }
                #endregion
            }
            #endregion

            //Run proxy web method with proxy request
            WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "DMS JobChangeRequest XML", proxyrequest);

            WA.v2.WS_Job.JobChangeResponse proxyresponse = proxyws.JobChange(proxyrequest);

            WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "DMS JobChangeResponse XML", proxyresponse);

            //Mapping with Standard Interface Specification Object
            if (proxyresponse != null)
            {
                if (proxyresponse.TransactionHeader != null)
                {
                    #region//TransactionHeader Set
                    WA.Standard.IF.Data.v2.Common.Common.TransactionHeader transactionheader = new WA.Standard.IF.Data.v2.Common.Common.TransactionHeader();
                    transactionheader.CountryID = proxyresponse.TransactionHeader.CountryID;
                    transactionheader.DealerID = proxyresponse.TransactionHeader.DealerID;
                    transactionheader.DistributorID = proxyresponse.TransactionHeader.DistributorID;
                    transactionheader.DMSCode = proxyresponse.TransactionHeader.DMSCode;
                    transactionheader.DMSServerUrl = proxyresponse.TransactionHeader.DMSServerUrl;
                    transactionheader.DMSVersion = proxyresponse.TransactionHeader.DMSVersion;
                    transactionheader.DocumentVersion = proxyresponse.TransactionHeader.DocumentVersion;
                    transactionheader.GroupID = proxyresponse.TransactionHeader.GroupID;
                    transactionheader.IneterfaceID = proxyresponse.TransactionHeader.IneterfaceID;
                    transactionheader.Password = proxyresponse.TransactionHeader.Password;
                    transactionheader.PollingToken = proxyresponse.TransactionHeader.PollingToken;
                    transactionheader.RequestPollingToken = proxyresponse.TransactionHeader.RequestPollingToken;
                    transactionheader.RequestType = proxyresponse.TransactionHeader.RequestType;
                    transactionheader.TransactionId = proxyresponse.TransactionHeader.TransactionId;
                    transactionheader.TransactionDateTimeLocal = proxyresponse.TransactionHeader.TransactionDateTimeLocal;
                    transactionheader.TransactionDateTimeUTC = proxyresponse.TransactionHeader.TransactionDateTimeUTC;
                    transactionheader.TransactionType = proxyresponse.TransactionHeader.TransactionType;
                    transactionheader.Username = proxyresponse.TransactionHeader.Username;
                    transactionheader.VenderTrackingCode = proxyresponse.TransactionHeader.VenderTrackingCode;
                    response.TransactionHeader = transactionheader;
                    #endregion
                }

                //ResultMessage Set
                if (proxyresponse.ResultMessage != null)
                {
                    response.ResultMessage = GetResultMessageData(proxyresponse.ResultMessage.Code, proxyresponse.ResultMessage.Message);
                }

                if (proxyresponse.Errors != null)
                {
                    //Error List Set
                    foreach (WA.v2.WS_Job.Error1 proxyerror in proxyresponse.Errors)
                    {
                        if (response.Errors != null)
                            response.Errors.Add(GetErrorData(proxyerror.Code, proxyerror.Message));
                        else
                            response.Errors = GetErrorDataList(proxyerror.Code, proxyerror.Message);
                    }
                }
            }
            #endregion

            return response;
        }