Repository.XFRACAS.ImportXFRACASXML

Uploads an import byte array for processing and returns the system ID

Parameters
entityID

ImportType

byteData

fileTitle

fileDescription

Usage Example
' ' Success= Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName") ' ListOfXFRACASEntities  NameIdPair ListOfXFRACASEntities = MyRepository.GetAllXFRACASEntities ' DesiredEntityID For Each Entity NameIdPair In ListOfXFRACASEntities If Entity.Name = "DesiredEntityName" DesiredEntityID = Entity.ID              Exit For End If       Next ' xmlObject  = '{{APIComment|populate the xmlObject with values to import '{{APIComment|Define the byte array.}} Dim byteArray As Byte = Nothing

'{{APIComment|Serialize the xmlObject into the byteArray.}} Dim SerializeSuccess As Boolean SerializeSuccess = MyRepository.SerializeXMLObjectToByteArray(byteArray, xmlObject) '{{APIComment|Import the XML byte array into the entity desired. In this example, we assume the XML object type describes an Incident.}} Dim ImportXMLSystemID As Integer ImportXMLSystemID = MyRepository.ImportXFRACASXML(DesiredEntityID, XFRACASImportType.Incident, byteArray, "XMLFileTitle", "XMLFileDescription")

Reformatted Usage Example
Private WithEvents MyRepository As New Repository

Dim Success As Boolean = False Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")

Dim ListOfXFRACASEntities As NameIdPair ListOfXFRACASEntities = MyRepository.GetAllXFRACASEntities

Dim DesiredEntityID As Integer For Each Entity As NameIdPair In ListOfXFRACASEntities If Entity.Name = "DesiredEntityName" DesiredEntityID = Entity.ID              Exit For End If       Next

Dim xmlObject As Object = Nothing 'populate the xmlObject with values to import

Dim byteArray As Byte = Nothing

Dim SerializeSuccess As Boolean SerializeSuccess = MyRepository.SerializeXMLObjectToByteArray(byteArray, xmlObject)

Dim ImportXMLSystemID As Integer ImportXMLSystemID = MyRepository.ImportXFRACASXML(DesiredEntityID, XFRACASImportType.Incident, byteArray, "XMLFileTitle", "XMLFileDescription")