Private Sub LoadVendorInfo()
Dim sPTH As String = "", sVendorList As String = ""
Dim arVendors1() As String
Dim arVendors2() As String
Dim i As Long, nd As TreeNode
Try
oVendor = New EHL7_mc2005.HL7Vendor
With VendorsTREE
.Nodes.Clear()
.Visible = False
End With
'Make other buttons invisible
Button2.Visible = False
btnCreateNewVendors.Visible = False
btnShowReport.Visible = False
btnEditVendor.Visible = False
With oVendor
lblVersion.Text = .APIVersionMajor & "." & .APIVersionMinor & "." & .APIRevision
lblFolder.Text = .EasyInstallationFolder
lblProductID.Text = .ProductID
If Not oVendor.IsRegistered Then
lblRegistration.Text = "Unregistered (There is no license file in the invocation folder)"
Else
If oVendor.IsDemo Then
lblRegistration.Text = "DEMO - Expires on " & .LicenseExpiresOn.ToString
Else
If oVendor.LicenseIsRuntime Then
lblRegistration.Text = "RUNTIME"
Else
lblRegistration.Text = "DEVELOPMENT"
End If
End If
End If
'Now let's test the vendorpath. The VendorPath property is THE MOST IMPORTANT property in the object.
sPTH = .EasyInstallationFolder & "HL7Vendors"
lblVendorPath.Text = sPTH
If Not IsFolder(sPTH) Then
lblVendorsInstalled.Text = "No"
btnInstallVendors.Visible = True
Exit Sub
Else
.VendorPath = sPTH
sVendorList = .ListVendors
If sVendorList = "" Then
lblVendorsInstalled.Text = "No"
btnInstallVendors.Visible = True
Exit Sub
End If
btnInstallVendors.Visible = False
lblVendorsInstalled.Text = "Yes"
End If
'Now load the vendors into the tree
VendorsTREE.Visible = True
arVendors1 = sVendorList.Split(vbLf)
For i = 0 To UBound(arVendors1)
arVendors2 = arVendors1(i).Split("|")
'arVendors2 is now a 2 element array.
'0 is the vendor name/version
'1 is the VendorID
With VendorsTREE
nd = .Nodes.Add(arVendors2(0))
nd.Tag = arVendors2(1)
If .Nodes.Count = 1 Then
.SelectedNode = nd
End If
End With
Next
'Enable all of the appropriate buttons
Button2.Visible = True
btnCreateNewVendors.Visible = True
btnShowReport.Visible = True
btnEditVendor.Visible = True
End With
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
|