49 lines
1.6 KiB
VB.net
49 lines
1.6 KiB
VB.net
Imports EgwProxy.MagMan
|
|
Imports Microsoft.SqlServer
|
|
|
|
Public Class Form1
|
|
|
|
Private restToken As String = "91f4fec6-7e9c-4130-9df2-702d729ccdd3"
|
|
|
|
Private commLib As DataSyncro
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
' esegue test comunicazione server (ping, alive)
|
|
commLib = New DataSyncro(restToken)
|
|
Dim servOk As Boolean
|
|
servOk = commLib.CheckRemote()
|
|
Dim esito As String = ""
|
|
If (servOk) Then
|
|
esito = "Test Ping: OK"
|
|
Else
|
|
esito = "Test Ping: KO"
|
|
End If
|
|
lblServTest.Text = esito
|
|
|
|
End Sub
|
|
|
|
Private Async Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
|
' recupera e mostra dati elenco materiali
|
|
commLib = New DataSyncro(restToken)
|
|
|
|
Dim result As String = ""
|
|
|
|
Dim matList = Await commLib.GetMaterials()
|
|
If matList IsNot Nothing Then
|
|
|
|
For Each item In matList
|
|
result += $"Mat Code: {item.MatExtCode}{Environment.NewLine}"
|
|
result += $"Mat Code: {item.MatExtCode}{Environment.NewLine}"
|
|
result += $"Mat Code: {item.MatExtCode}{Environment.NewLine}"
|
|
result += $"Dtmx Code: {item.MatDtmx}{Environment.NewLine}"
|
|
result += $"descript: {item.MatDesc}{Environment.NewLine}"
|
|
result += $"Dimensions W x T x L: {item.WMm:N3} x {item.TMm:N3} x {item.LMm:N3}{Environment.NewLine}"
|
|
result += $"{Environment.NewLine}"
|
|
Next
|
|
End If
|
|
|
|
txtOut.Text = result
|
|
|
|
End Sub
|
|
End Class
|