public GetIncidentResponse GetIncident(GetIncidentRequest objGetIncidentRequest) { LogHelper.LogTextDebug("", "Enter"); LogHelper.LogObjectPropertiesDebug(objGetIncidentRequest, "IncidentRequest"); Incident objIncident = null; try { GetIncidentResponse objGetIncidentResponse = null; if (string.IsNullOrEmpty(objGetIncidentRequest.IncidentNumber)) { throw new CustomError("NullData", "Incident Number is null"); } else { objIncident = new IncidentController().GetIncident(objIncident.IncidentNumber); objGetIncidentResponse = new TranslateIncident().TranslateIncidenttoGetIncidentResponse(objIncident); } LogHelper.LogTextDebug("Success", "Returning Incident Response"); return(objGetIncidentResponse); } catch (ITSM_WebserviceException ex) { LogHelper.LogTextWarn(string.Format("Message : {0}\nError : {1}\nStack Trace : {2}", ex.Message, ex.ErrorCode, ex.StackTrace), "Exception"); throw ITSMExceptionManager.GetCustomSoapException(ex); } catch (Exception ex) { LogHelper.LogTextWarn(string.Format("Message : {0}\nStack Trace : {2}", ex.Message, ex.StackTrace), "Exception"); throw ITSMExceptionManager.GetCustomSoapException("Unknown Error", ex.Message); } }
public GetIncidentResponse TranslateIncidenttoGetIncidentResponse(Incident objIncident) { LogHelper.LogTextDebug(string.Empty, "Enter"); LogHelper.LogObjectPropertiesDebug(objIncident, "IncidentDetails"); GetIncidentResponse objGetIncidentResponse = new GetIncidentResponse(); try { if (objIncident != null) { objGetIncidentResponse.IncidentNumber = objIncident.IncidentNumber; objGetIncidentResponse.Impact = objIncident.Impact; objGetIncidentResponse.Customer = objIncident.Customer; objGetIncidentResponse.AssignedGroup = objIncident.AssignedGroup; objGetIncidentResponse.Summary = objIncident.Summary; objGetIncidentResponse.Urgency = objIncident.Urgency; } } catch (Exception ex) { LogHelper.LogTextWarn(ex.Message, "Exception"); throw; } LogHelper.LogTextDebug(string.Empty, "Exit"); return(objGetIncidentResponse); }