diff --git a/TestWinFormVB/App.config b/TestWinFormVB/App.config index ffaf540..65cbb66 100644 --- a/TestWinFormVB/App.config +++ b/TestWinFormVB/App.config @@ -1,6 +1,14 @@ - + + + + + + + + + \ No newline at end of file diff --git a/TestWinFormVB/Form1.Designer.vb b/TestWinFormVB/Form1.Designer.vb index a418df0..c872beb 100644 --- a/TestWinFormVB/Form1.Designer.vb +++ b/TestWinFormVB/Form1.Designer.vb @@ -22,10 +22,67 @@ Partial Class Form1 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - components = New System.ComponentModel.Container() + Me.Button1 = New System.Windows.Forms.Button() + Me.lblServTest = New System.Windows.Forms.Label() + Me.Button2 = New System.Windows.Forms.Button() + Me.txtOut = New System.Windows.Forms.TextBox() + Me.SuspendLayout() + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(12, 12) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(75, 23) + Me.Button1.TabIndex = 0 + Me.Button1.Text = "Server Test" + Me.Button1.UseVisualStyleBackColor = True + ' + 'lblServTest + ' + Me.lblServTest.AutoSize = True + Me.lblServTest.Location = New System.Drawing.Point(117, 17) + Me.lblServTest.Name = "lblServTest" + Me.lblServTest.Size = New System.Drawing.Size(16, 13) + Me.lblServTest.TabIndex = 1 + Me.lblServTest.Text = "..." + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(12, 51) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(75, 23) + Me.Button2.TabIndex = 2 + Me.Button2.Text = "Get Mater." + Me.Button2.UseVisualStyleBackColor = True + ' + 'txtOut + ' + Me.txtOut.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txtOut.Location = New System.Drawing.Point(103, 53) + Me.txtOut.Multiline = True + Me.txtOut.Name = "txtOut" + Me.txtOut.Size = New System.Drawing.Size(685, 184) + Me.txtOut.TabIndex = 3 + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(800, 450) + Me.Controls.Add(Me.txtOut) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.lblServTest) + Me.Controls.Add(Me.Button1) + Me.Name = "Form1" Me.Text = "Form1" + Me.ResumeLayout(False) + Me.PerformLayout() + End Sub + Friend WithEvents Button1 As Button + Friend WithEvents lblServTest As Label + Friend WithEvents Button2 As Button + Friend WithEvents txtOut As TextBox End Class diff --git a/TestWinFormVB/Form1.resx b/TestWinFormVB/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TestWinFormVB/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TestWinFormVB/Form1.vb b/TestWinFormVB/Form1.vb index 17d6595..7b3fd50 100644 --- a/TestWinFormVB/Form1.vb +++ b/TestWinFormVB/Form1.vb @@ -1,3 +1,48 @@ -Public Class Form1 +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 diff --git a/TestWinFormVB/TestWinFormVB.vbproj b/TestWinFormVB/TestWinFormVB.vbproj index c989c2c..8e1fca0 100644 --- a/TestWinFormVB/TestWinFormVB.vbproj +++ b/TestWinFormVB/TestWinFormVB.vbproj @@ -48,10 +48,48 @@ On + + ..\packages\EgwProxy.MagMan.0.9.2401-beta.1718\lib\EgwProxy.MagMan.dll + + + ..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll + + + ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + + + ..\packages\RestSharp.110.2.0\lib\net471\RestSharp.dll + + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll + + + ..\packages\System.Text.Json.7.0.2\lib\net462\System.Text.Json.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + @@ -97,6 +135,9 @@ + + Form1.vb + VbMyResourcesResXFileCodeGenerator Resources.Designer.vb @@ -115,6 +156,7 @@ Settings.Designer.vb + \ No newline at end of file diff --git a/TestWinFormVB/packages.config b/TestWinFormVB/packages.config new file mode 100644 index 0000000..bded6e6 --- /dev/null +++ b/TestWinFormVB/packages.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file