public EntryFieldValueList GetFormData(string formName, string qualification, EntryListFieldList fieldList) { EntryFieldValueList fvFormData = new EntryFieldValueList(); LogHelper.LogTextDebug(formName, "Data Returned"); try { if (_arserver.LastReturnCode == 0) { fvFormData = _arserver.GetListEntryWithFields(formName, qualification, fieldList, 0, 1000); if (fvFormData.Count == 0) { throw new CustomError("NoDataFound", "No data is found for given Incident"); } } } catch (ARException objARException) { LogHelper.LogTextFatal(objARException.Message.ToString(), "Exception"); throw new CustomError("RemedyAPIError", objARException.Message); } LogHelper.LogTextDebug(formName, "Data Returned"); return(fvFormData); }
private Incident FillIncident(string incidentNumber) { LogHelper.LogTextDebug(incidentNumber, "Enter"); Incident objIncident = null; try { objIncident = new Incident(); objIncident.IncidentNumber = incidentNumber; EntryFieldValueList fvIncident = new EntryFieldValueList(); fvIncident = new IncidentDataProvider().GetIncident(incidentNumber); if (fvIncident != null) { objIncident.IncidentNumber = fvIncident[0].FieldValues[1000000161].ToString(); objIncident.Customer = fvIncident[0].FieldValues[1000000019].ToString() + " " + fvIncident[0].FieldValues[1000000018].ToString(); objIncident.AssignedGroup = fvIncident[0].FieldValues[1000000217].ToString(); objIncident.Impact = fvIncident[0].FieldValues[1000000163].ToString(); objIncident.Summary = fvIncident[0].FieldValues[1000000000].ToString(); objIncident.Urgency = fvIncident[0].FieldValues[1000000162].ToString(); } else { throw new CustomError("InvalidID", "Incident Number not found"); } } catch (System.NullReferenceException ex) { LogHelper.LogTextWarn(ex.Message, "Exception"); throw; } catch (CustomError ex) { LogHelper.LogTextWarn(ex.Message, "Exception"); throw; } return(objIncident); }