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 1C.v8241.v2 - RTR.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 _1C.v8241.Job.Job proxyws = new _1C.v8241.Job.Job(); proxyws.Credentials = proxycredential; //Create proxy request with jobget and transaction _1C.v8241.Job.JobGetRequest proxyrequest = new _1C.v8241.Job.JobGetRequest(); //Create proxy transaction _1C.v8241.Job.TransactionHeader proxytransactionheader = new _1C.v8241.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.TransactionDateTimeLocalSpecified = request.TransactionHeader.TransactionDateTimeLocal != null;//수정필요 proxytransactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeLocal; proxytransactionheader.TransactionDateTimeUTCSpecified = request.TransactionHeader.TransactionDateTimeLocal != null;//수정필요 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 _1C.v8241.Job.JobGet proxyjobget = new _1C.v8241.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.LastModifiedDateTimeFromUTCSpecified = request.JobGet.LastModifiedDateTimeFromUTC != null;//수정필요 proxyjobget.LastModifiedDateTimeToUTC = request.JobGet.LastModifiedDateTimeToUTC; proxyjobget.LastModifiedDateTimeToUTCSpecified = request.JobGet.LastModifiedDateTimeToUTC != null;//수정필요 proxyjobget.ScheduledDateTimeFromLocal = request.JobGet.ScheduledDateTimeFromLocal; proxyjobget.ScheduledDateTimeFromLocalSpecified = request.JobGet.ScheduledDateTimeFromLocal != null;//수정필요 proxyjobget.ScheduledDateTimeToLocal = request.JobGet.ScheduledDateTimeToLocal; proxyjobget.ScheduledDateTimeToLocalSpecified = request.JobGet.ScheduledDateTimeToLocal != null;//수정필요 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); _1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 = Map.GetWACodeFromDMSCode(CodeType.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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 (_1C.v8241.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; }
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 1C.v8241.v2 - RTR.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 _1C.v8241.Job.Job proxyws = new _1C.v8241.Job.Job(); proxyws.Credentials = proxycredential; //Create proxy request with jobchange and transaction _1C.v8241.Job.JobChangeRequest proxyrequest = new _1C.v8241.Job.JobChangeRequest(); //Create proxy transaction _1C.v8241.Job.TransactionHeader proxytransactionheader = new _1C.v8241.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.TransactionDateTimeLocalSpecified = request.TransactionHeader.TransactionDateTimeLocal != null;//수정필요 proxytransactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeLocal; proxytransactionheader.TransactionDateTimeUTCSpecified = request.TransactionHeader.TransactionDateTimeLocal != null;//수정필요 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 _1C.v8241.Job.JobChange proxyjobchange = new _1C.v8241.Job.JobChange(); if (request.JobChange != null) { #region//JobChange Header proxyjobchange.ActualHours = request.JobChange.ActualHours; proxyjobchange.DMSJobNo = string.IsNullOrEmpty(request.JobChange.DMSJobNo) ? string.Empty : 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; _1C.v8241.Job.Comment[] proxycomments = new _1C.v8241.Job.Comment[request.JobChange.Comments.Count]; foreach (WA.Standard.IF.Data.v2.Common.Common.Comment Comment in request.JobChange.Comments) { _1C.v8241.Job.Comment proxycomment = new _1C.v8241.Job.Comment(); 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; _1C.v8241.Job.Description[] proxydescriptions = new _1C.v8241.Job.Description[request.JobChange.Descriptions.Count]; foreach (WA.Standard.IF.Data.v2.Common.Common.Description description in request.JobChange.Descriptions) { _1C.v8241.Job.Description proxydescription = new _1C.v8241.Job.Description(); 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; _1C.v8241.Job.Cause[] proxycauses = new _1C.v8241.Job.Cause[request.JobChange.Causes.Count]; foreach (WA.Standard.IF.Data.v2.Common.Common.Cause cause in request.JobChange.Causes) { _1C.v8241.Job.Cause proxycause = new _1C.v8241.Job.Cause(); 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; _1C.v8241.Job.Correction[] proxycorrections = new _1C.v8241.Job.Correction[request.JobChange.Corrections.Count]; foreach (WA.Standard.IF.Data.v2.Common.Common.Correction correction in request.JobChange.Corrections) { _1C.v8241.Job.Correction proxycorrection = new _1C.v8241.Job.Correction(); 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; _1C.v8241.Job.OPCode[] proxyopcodes = new _1C.v8241.Job.OPCode[request.JobChange.OPCodes.Count]; foreach (WA.Standard.IF.Data.v2.Common.Job.OPCode opcode in request.JobChange.OPCodes) { #region//JobChange OPCode Header _1C.v8241.Job.OPCode proxyopcode = new _1C.v8241.Job.OPCode(); 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; // _1C.v8241.Job.Comment1[] proxycomments = new _1C.v8241.Job.Comment1[opcode.Comments.Count]; // foreach (WA.Standard.IF.Data.v2.Common.Common.Comment comment in opcode.Comments) // { // _1C.v8241.Job.Comment1 proxycomment = new _1C.v8241.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; // _1C.v8241.Job.Description1[] proxydescriptions = new _1C.v8241.Job.Description1[opcode.Descriptions.Count]; // foreach (WA.Standard.IF.Data.v2.Common.Common.Description description in opcode.Descriptions) // { // _1C.v8241.Job.Description1 proxydescription = new _1C.v8241.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; // _1C.v8241.Job.Cause1[] proxycauses = new _1C.v8241.Job.Cause1[opcode.Causes.Count]; // foreach (WA.Standard.IF.Data.v2.Common.Common.Cause cause in opcode.Causes) // { // _1C.v8241.Job.Cause1 proxycause = new _1C.v8241.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; // _1C.v8241.Job.Correction1[] proxycorrections = new _1C.v8241.Job.Correction1[opcode.Corrections.Count]; // foreach (WA.Standard.IF.Data.v2.Common.Common.Correction correction in opcode.Corrections) // { // _1C.v8241.Job.Correction1 proxycorrection = new _1C.v8241.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) { _1C.v8241.Job.Plan proxyplan = new _1C.v8241.Job.Plan(); proxyplan.ScheduledDateTimeFromLocal = request.JobChange.Plan.ScheduledDateTimeFromLocal != null ? Convert.ToDateTime(request.JobChange.Plan.ScheduledDateTimeFromLocal) : DateTime.MinValue;//수정필요 proxyplan.ScheduledDateTimeToLocal = request.JobChange.Plan.ScheduledDateTimeToLocal != null ? Convert.ToDateTime(request.JobChange.Plan.ScheduledDateTimeToLocal) : DateTime.MinValue;//수정필요 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; _1C.v8241.Job.Technician[] proxytechnicians = new _1C.v8241.Job.Technician[request.JobChange.Plan.Technicians.Count]; foreach (WA.Standard.IF.Data.v2.Common.Job.Technician technician in request.JobChange.Plan.Technicians) { _1C.v8241.Job.Technician proxytechnician = new _1C.v8241.Job.Technician(); 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) { _1C.v8241.Job.Dispatch proxydispatch = new _1C.v8241.Job.Dispatch(); proxydispatch.ScheduledDateTimeFromLocal = request.JobChange.Dispatch.ScheduledDateTimeFromLocal != null ? Convert.ToDateTime(request.JobChange.Dispatch.ScheduledDateTimeFromLocal) : DateTime.MinValue;//수정필요 proxydispatch.ScheduledDateTimeToLocal = request.JobChange.Dispatch.ScheduledDateTimeToLocal != null ? Convert.ToDateTime(request.JobChange.Dispatch.ScheduledDateTimeToLocal) : DateTime.MinValue;//수정필요 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; _1C.v8241.Job.Technician[] proxytechnicians = new _1C.v8241.Job.Technician[request.JobChange.Dispatch.Technicians.Count]; foreach (WA.Standard.IF.Data.v2.Common.Job.Technician technician in request.JobChange.Dispatch.Technicians) { _1C.v8241.Job.Technician proxytechnician = new _1C.v8241.Job.Technician(); 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) { _1C.v8241.Job.Actual proxyactual = new _1C.v8241.Job.Actual(); 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; _1C.v8241.Job.ActualTimeLog[] proxytechnicians = new _1C.v8241.Job.ActualTimeLog[request.JobChange.Actual.ActualTimeLogs.Count]; foreach (WA.Standard.IF.Data.v2.Common.Job.ActualTimeLog actualtimelog in request.JobChange.Actual.ActualTimeLogs) { _1C.v8241.Job.ActualTimeLog proxyactualtimelog = new _1C.v8241.Job.ActualTimeLog(); proxyactualtimelog.EndDateTimeLocal = actualtimelog.EndDateTimeLocal != null ? Convert.ToDateTime(actualtimelog.EndDateTimeLocal) : DateTime.MinValue;//수정필요 proxyactualtimelog.EndDateTimeLocalSpecified = actualtimelog.EndDateTimeLocal != null;//수정필요 proxyactualtimelog.PauseReasonCode = Map.SetDMSCodeFromWACode(CodeType.PauseReasonCode, actualtimelog.PauseReasonCode); proxyactualtimelog.PauseReasonComment = actualtimelog.PauseReasonComment; proxyactualtimelog.StartDateTimeLocal = actualtimelog.StartDateTimeLocal != null ? Convert.ToDateTime(actualtimelog.StartDateTimeLocal) : DateTime.MinValue;//수정필요 proxyactualtimelog.StartDateTimeLocalSpecified = actualtimelog.StartDateTimeLocal != null;//수정필요 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; _1C.v8241.Job.JobComment[] proxyjobcomments = new _1C.v8241.Job.JobComment[request.JobChange.Actual.JobComments.Count]; foreach (WA.Standard.IF.Data.v2.Common.Job.JobComment jobcomment in request.JobChange.Actual.JobComments) { _1C.v8241.Job.JobComment proxyjobcomment = new _1C.v8241.Job.JobComment(); proxyjobcomment.ActualWorkHour = jobcomment.ActualWorkHour; proxyjobcomment.SubStatus = Map.SetDMSCodeFromWACode(CodeType.JobSubStatus, jobcomment.SubStatus); proxyjobcomments[jobcommentscnt] = proxyjobcomment; jobcommentscnt++; } proxyactual.JobComments = proxyjobcomments; } #endregion proxyjobchange.Actual = proxyactual; } #endregion proxyrequest.JobChange = proxyjobchange; } #endregion //Run proxy web method with proxy request WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "DMS JobChangeRequest XML", proxyrequest); _1C.v8241.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 (_1C.v8241.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); } } } #endregion return response; }