private EventDetails CreateIncidentDetail(XmlNode node, IncidentDetail incident) { incident.Status = new IncidentStatus(); incident.Status.SecondaryStatus = new List <AltStatus>(0); incident.OwningOrg = new IncidentOrganization(); XmlNodeList incidentChildNodes = node.ChildNodes; foreach (XmlNode childNode in incidentChildNodes) { XmlNodeList statusNodes = childNode.ChildNodes; if (string.IsNullOrEmpty(childNode.InnerText)) { continue; } switch (childNode.LocalName) { case "IncidentStatus": foreach (XmlNode statusNode in statusNodes) { if (string.IsNullOrEmpty(statusNode.InnerText)) { continue; } switch (statusNode.LocalName) { case "IncidentPrimaryStatus": IncidentPrimaryStatusCodeList outputPrim = GetCode <IncidentPrimaryStatusCodeList>(statusNode.InnerText); incident.Status.PrimaryStatus = outputPrim; break; case "IncidentEIDDStatus": IncidentEIDDStatusCodeList outputEEID = GetCode <IncidentEIDDStatusCodeList>(statusNode.InnerText); incident.AddEIDDStatus(outputEEID); break; case "IncidentPulsePointStatus": IncidentPulsePointStatusCodeList outputPulsePoint = GetCode <IncidentPulsePointStatusCodeList>(statusNode.InnerText); incident.AddPulsePointStatus(outputPulsePoint); break; case "IncidentSecondaryStatusText": incident.AddSecondaryStatusText(statusNode.InnerText, "Freetext"); break; default: throw new ArgumentException("Unexpected Node Name: " + statusNode.Name + " in NIEM Incident Status"); } } break; case "IncidentOwningOrganization": foreach (XmlNode orgNode in childNode.ChildNodes) { switch (orgNode.LocalName) { case "OrganizationIdentification": incident.OwningOrg.OrgID = orgNode.InnerText; break; case "ResourceIdentifier": incident.OwningOrg.IncidentID = orgNode.InnerText; break; default: throw new ArgumentException("Unexpected Node Name: " + childNode.Name + " in NIEM Owning Organization"); } } break; default: throw new ArgumentException("Unexpected Node Name: " + childNode.Name + " in NIEM Event"); } } return(incident); }
/// <summary> /// Sets primary status code /// <see cref="EDXLSharp.NIEMEMLCLib.Incident.IncidentStatus"/>. /// <seealso cref="EDXLSharp.NIEMEMLCLib.Incident.IncidentPrimaryStatusCodeList"/> /// </summary> public void setPrimaryStatus(IncidentPrimaryStatusCodeList value) { Status.PrimaryStatus = value; }
/// <summary> /// Sets primary status code /// <see cref="IncidentStatus"/>. /// <seealso cref="IncidentPrimaryStatusCodeList"/> /// </summary> public void AddPrimaryStatus(IncidentPrimaryStatusCodeList value) { this.status.PrimaryStatus = value; }