diff --git a/NKC_SDK/NKC.cs b/NKC_SDK/NKC.cs index a73cc1f..6153ef0 100644 --- a/NKC_SDK/NKC.cs +++ b/NKC_SDK/NKC.cs @@ -1,6 +1,7 @@ using Newtonsoft.Json; using System; using System.Net; +using System.Net.NetworkInformation; namespace NKC_SDK { @@ -110,18 +111,35 @@ namespace NKC_SDK /// protected string _baseUrl { get; set; } = @"http://seriate.steamware.net:8083/NKC/"; + protected string _baseIp { get; set; } = "seriate.steamware.net"; + /// /// Classe per effettuare comunicazioni con NKC /// + /// /// - public NKC(string baseUrl) + public NKC(string baseIp, string baseUrl) { _baseUrl = baseUrl; } + /// + /// Effettua test ping all'indirizzo del server + /// + public PingReply testPing + { + get + { + Ping myPing = new Ping(); + // timeout a 1 sec! + PingReply answ = myPing.Send(_baseIp, 1000); + // rendo! + return answ; + } + } /// /// Recupera il PRIMO BUNK - /// - effettua chaimata tramite REST API HTTP + /// - effettua chiamata tramite REST API HTTP /// - il risutlato viene deserializzato nell'oggetto richiesto /// /// diff --git a/NKC_SDK/Properties/AssemblyInfo.cs b/NKC_SDK/Properties/AssemblyInfo.cs index c7a5b16..19a4561 100644 --- a/NKC_SDK/Properties/AssemblyInfo.cs +++ b/NKC_SDK/Properties/AssemblyInfo.cs @@ -7,9 +7,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("NKC_SDK")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -//[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("NKC_SDK")] -//[assembly: AssemblyCopyright("Copyright © 2019")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/RedisExample.sln b/RedisExample.sln index 2b82933..86a3533 100644 --- a/RedisExample.sln +++ b/RedisExample.sln @@ -1,12 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.902 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "RedisExample", "RedisExample\RedisExample.vbproj", "{9694C356-E431-4861-A120-ADEE2AAD6345}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NKC_SDK", "NKC_SDK\NKC_SDK.csproj", "{5A0B6E45-169B-44D4-9E24-13718B8EB7CC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VersGen", "VersGen\VersGen.csproj", "{175AF851-9AED-4D5F-8571-9CEC8B2D2320}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,6 +28,12 @@ Global {5A0B6E45-169B-44D4-9E24-13718B8EB7CC}.Debug-LELE|Any CPU.Build.0 = Debug|Any CPU {5A0B6E45-169B-44D4-9E24-13718B8EB7CC}.Release|Any CPU.ActiveCfg = Release|Any CPU {5A0B6E45-169B-44D4-9E24-13718B8EB7CC}.Release|Any CPU.Build.0 = Release|Any CPU + {175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Debug|Any CPU.Build.0 = Debug|Any CPU + {175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Debug-LELE|Any CPU.ActiveCfg = Debug|Any CPU + {175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Debug-LELE|Any CPU.Build.0 = Debug|Any CPU + {175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Release|Any CPU.ActiveCfg = Release|Any CPU + {175AF851-9AED-4D5F-8571-9CEC8B2D2320}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/RedisExample/App.config b/RedisExample/App.config index 2a6563a..0b3efb3 100644 --- a/RedisExample/App.config +++ b/RedisExample/App.config @@ -4,15 +4,8 @@ - - - - - - - - + + - - - - - - - - - - - - \ No newline at end of file diff --git a/RedisExample/App_Readme/SteamWare_demo/example-app.config b/RedisExample/App_Readme/SteamWare_demo/example-app.config deleted file mode 100644 index fb42165..0000000 --- a/RedisExample/App_Readme/SteamWare_demo/example-app.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/RedisExample/App_Readme/SteamWare_demo/example-config-table.txt b/RedisExample/App_Readme/SteamWare_demo/example-config-table.txt deleted file mode 100644 index dd0ab8e..0000000 --- a/RedisExample/App_Readme/SteamWare_demo/example-config-table.txt +++ /dev/null @@ -1,30 +0,0 @@ -# chiave valore valoreStd note -_adminEmail samuele@steamware.net,info@steamware.net samuele@steamware.net,info@steamware.net info@steamware.net -_allowForceUser true true abilita login forzato -_commonPages menu menu pagina comune -_emailPwd drmfsls16 drmfsls16 drmfsls16 -_emailUser steamwarebot@gmail.com steamwarebot@gmail.com steamwarebot@gmail.com -_enableSSL true true true -_fromEmail webmaster@admodelling.org webmaster@admodelling.org email mittente eventuali msg -_righeDataGrid 30 30 Num righe datagrid std -_righeDataGridAnagr 20 20 Num righe datagrid anagrafiche -_righeDataGridLong 30 30 Num righe datagrid long -_righeDataGridMed 15 15 Num righe datagrid med -_righeDataGridShort 10 10 Num righe datagrid short -_smtpCli smtp.gmail.com smtp.gmail.com smtp.gmail.com -_useAIMSmtp false false impiego client posta elettronica alternativo -_useAuthSmtp true true true -AuthCookieName admodellingAuth admodellingAuth Cookie applicativo -autoConfCmd true true Conferma automatica comandi barcode -baseUrl http://site_name http://iis02/site_name URL base del sito -cacheValSec 60 60 Validità cache dati in gestore Barcode -cookieDayExp 365 365 Periodo validità cookie -cookieUsed admodellingAuth admodellingAuth,CTrack_CodOpr,CTrack_CodPost Elenco dei cookie impiegati -enableCookie true true Abilitazione uso cookie -enableLogOut true false Abilita button logout COMPLETO in alto a sx -enablePlain true true Abilitazione decode plain -maxAuth 1000 1000 num auth minimo per NON consumare tokens -serializeSession true true Serializzazione valori in sessione (REDIS) -SiteName iis02/site_name iis02/site_name Nome sito -enableDumpDiag false false abilitazione dumb diagnostico x eccezioni di default -doShrinkFolder true true Imposta compressione area LOGS \ No newline at end of file diff --git a/RedisExample/App_Readme/SteamWare_demo/example-favicon.ico b/RedisExample/App_Readme/SteamWare_demo/example-favicon.ico deleted file mode 100644 index 4f0e0ad..0000000 Binary files a/RedisExample/App_Readme/SteamWare_demo/example-favicon.ico and /dev/null differ diff --git a/RedisExample/Form1.Designer.vb b/RedisExample/Form1.Designer.vb index 8f38bfc..127ea09 100644 --- a/RedisExample/Form1.Designer.vb +++ b/RedisExample/Form1.Designer.vb @@ -43,219 +43,265 @@ Partial Class Form1 Me.txtWorkEnd = New System.Windows.Forms.TextBox() Me.txtPrintEnd = New System.Windows.Forms.TextBox() Me.btnSaveAll = New System.Windows.Forms.Button() - Me.SuspendLayout() - ' - 'btnReset - ' - Me.btnReset.Location = New System.Drawing.Point(64, 398) - Me.btnReset.Name = "btnReset" - Me.btnReset.Size = New System.Drawing.Size(75, 23) - Me.btnReset.TabIndex = 0 - Me.btnReset.Text = "reset Date" - Me.btnReset.UseVisualStyleBackColor = True - ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(262, 403) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(39, 13) - Me.Label1.TabIndex = 1 - Me.Label1.Text = "Label1" - ' - 'btnLoadBunk - ' - Me.btnLoadBunk.Location = New System.Drawing.Point(64, 36) - Me.btnLoadBunk.Name = "btnLoadBunk" - Me.btnLoadBunk.Size = New System.Drawing.Size(75, 23) - Me.btnLoadBunk.TabIndex = 2 - Me.btnLoadBunk.Text = "Load BUNK" - Me.btnLoadBunk.UseVisualStyleBackColor = True - ' - 'btnPrintStart - ' - Me.btnPrintStart.Location = New System.Drawing.Point(64, 165) - Me.btnPrintStart.Name = "btnPrintStart" - Me.btnPrintStart.Size = New System.Drawing.Size(75, 23) - Me.btnPrintStart.TabIndex = 3 - Me.btnPrintStart.Text = "Start Paint" - Me.btnPrintStart.UseVisualStyleBackColor = True - ' - 'cmbSheet - ' - Me.cmbSheet.DisplayMember = "SheetId" - Me.cmbSheet.FormattingEnabled = True - Me.cmbSheet.Location = New System.Drawing.Point(423, 38) - Me.cmbSheet.Name = "cmbSheet" - Me.cmbSheet.Size = New System.Drawing.Size(121, 21) - Me.cmbSheet.TabIndex = 4 - ' - 'Label2 - ' - Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(337, 45) - Me.Label2.Name = "Label2" - Me.Label2.Size = New System.Drawing.Size(69, 13) - Me.Label2.TabIndex = 5 - Me.Label2.Text = "current sheet" - ' - 'btnPrintEnd - ' - Me.btnPrintEnd.Location = New System.Drawing.Point(423, 165) - Me.btnPrintEnd.Name = "btnPrintEnd" - Me.btnPrintEnd.Size = New System.Drawing.Size(75, 23) - Me.btnPrintEnd.TabIndex = 6 - Me.btnPrintEnd.Text = "End Paint" - Me.btnPrintEnd.UseVisualStyleBackColor = True - ' - 'btnWorkStart - ' - Me.btnWorkStart.Location = New System.Drawing.Point(64, 209) - Me.btnWorkStart.Name = "btnWorkStart" - Me.btnWorkStart.Size = New System.Drawing.Size(75, 23) - Me.btnWorkStart.TabIndex = 7 - Me.btnWorkStart.Text = "Start Cut" - Me.btnWorkStart.UseVisualStyleBackColor = True - ' - 'btnWorkEnd - ' - Me.btnWorkEnd.Location = New System.Drawing.Point(423, 209) - Me.btnWorkEnd.Name = "btnWorkEnd" - Me.btnWorkEnd.Size = New System.Drawing.Size(75, 23) - Me.btnWorkEnd.TabIndex = 8 - Me.btnWorkEnd.Text = "End Cut" - Me.btnWorkEnd.UseVisualStyleBackColor = True - ' - 'btnUnlStart - ' - Me.btnUnlStart.Location = New System.Drawing.Point(64, 251) - Me.btnUnlStart.Name = "btnUnlStart" - Me.btnUnlStart.Size = New System.Drawing.Size(75, 23) - Me.btnUnlStart.TabIndex = 9 - Me.btnUnlStart.Text = "Start Unload" - Me.btnUnlStart.UseVisualStyleBackColor = True - ' - 'btnUnlEnd - ' - Me.btnUnlEnd.Location = New System.Drawing.Point(423, 251) - Me.btnUnlEnd.Name = "btnUnlEnd" - Me.btnUnlEnd.Size = New System.Drawing.Size(75, 23) - Me.btnUnlEnd.TabIndex = 10 - Me.btnUnlEnd.Text = "End Unload" - Me.btnUnlEnd.UseVisualStyleBackColor = True - ' - 'btnNextBunk - ' - Me.btnNextBunk.Location = New System.Drawing.Point(64, 86) - Me.btnNextBunk.Name = "btnNextBunk" - Me.btnNextBunk.Size = New System.Drawing.Size(75, 23) - Me.btnNextBunk.TabIndex = 11 - Me.btnNextBunk.Text = "Next BUNK" - Me.btnNextBunk.UseVisualStyleBackColor = True - Me.btnNextBunk.Visible = False - ' - 'txtCurrBunk - ' - Me.txtCurrBunk.Location = New System.Drawing.Point(159, 37) - Me.txtCurrBunk.Name = "txtCurrBunk" - Me.txtCurrBunk.Size = New System.Drawing.Size(100, 20) - Me.txtCurrBunk.TabIndex = 12 - ' - 'lblNextBunk - ' - Me.lblNextBunk.AutoSize = True - Me.lblNextBunk.Location = New System.Drawing.Point(159, 95) - Me.lblNextBunk.Name = "lblNextBunk" - Me.lblNextBunk.Size = New System.Drawing.Size(16, 13) - Me.lblNextBunk.TabIndex = 13 - Me.lblNextBunk.Text = "---" - Me.lblNextBunk.Visible = False - ' - 'txtPrintStart - ' - Me.txtPrintStart.Location = New System.Drawing.Point(159, 168) - Me.txtPrintStart.Name = "txtPrintStart" - Me.txtPrintStart.Size = New System.Drawing.Size(142, 20) - Me.txtPrintStart.TabIndex = 14 - ' - 'txtWorkStart - ' - Me.txtWorkStart.Location = New System.Drawing.Point(159, 211) - Me.txtWorkStart.Name = "txtWorkStart" - Me.txtWorkStart.Size = New System.Drawing.Size(142, 20) - Me.txtWorkStart.TabIndex = 15 - ' - 'txtUnlStart - ' - Me.txtUnlStart.Location = New System.Drawing.Point(159, 253) - Me.txtUnlStart.Name = "txtUnlStart" - Me.txtUnlStart.Size = New System.Drawing.Size(142, 20) - Me.txtUnlStart.TabIndex = 16 - ' - 'txtUnlEnd - ' - Me.txtUnlEnd.Location = New System.Drawing.Point(526, 252) - Me.txtUnlEnd.Name = "txtUnlEnd" - Me.txtUnlEnd.Size = New System.Drawing.Size(142, 20) - Me.txtUnlEnd.TabIndex = 19 - ' - 'txtWorkEnd - ' - Me.txtWorkEnd.Location = New System.Drawing.Point(526, 210) - Me.txtWorkEnd.Name = "txtWorkEnd" - Me.txtWorkEnd.Size = New System.Drawing.Size(142, 20) - Me.txtWorkEnd.TabIndex = 18 - ' - 'txtPrintEnd - ' - Me.txtPrintEnd.Location = New System.Drawing.Point(526, 167) - Me.txtPrintEnd.Name = "txtPrintEnd" - Me.txtPrintEnd.Size = New System.Drawing.Size(142, 20) - Me.txtPrintEnd.TabIndex = 17 - ' - 'btnSaveAll - ' - Me.btnSaveAll.Location = New System.Drawing.Point(58, 307) - Me.btnSaveAll.Name = "btnSaveAll" - Me.btnSaveAll.Size = New System.Drawing.Size(610, 23) - Me.btnSaveAll.TabIndex = 20 - Me.btnSaveAll.Text = "Save All Data" - Me.btnSaveAll.UseVisualStyleBackColor = True - ' - '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.btnSaveAll) - Me.Controls.Add(Me.txtUnlEnd) - Me.Controls.Add(Me.txtWorkEnd) - Me.Controls.Add(Me.txtPrintEnd) - Me.Controls.Add(Me.txtUnlStart) - Me.Controls.Add(Me.txtWorkStart) - Me.Controls.Add(Me.txtPrintStart) - Me.Controls.Add(Me.lblNextBunk) - Me.Controls.Add(Me.txtCurrBunk) - Me.Controls.Add(Me.btnNextBunk) - Me.Controls.Add(Me.btnUnlEnd) - Me.Controls.Add(Me.btnUnlStart) - Me.Controls.Add(Me.btnWorkEnd) - Me.Controls.Add(Me.btnWorkStart) - Me.Controls.Add(Me.btnPrintEnd) - Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.cmbSheet) - Me.Controls.Add(Me.btnPrintStart) - Me.Controls.Add(Me.btnLoadBunk) - Me.Controls.Add(Me.Label1) - Me.Controls.Add(Me.btnReset) - Me.Name = "Form1" - Me.Text = "Form1" - Me.ResumeLayout(False) - Me.PerformLayout() + Me.btnPing = New System.Windows.Forms.Button() + Me.lblPing = New System.Windows.Forms.Label() + Me.SuspendLayout() + ' + 'btnReset + ' + Me.btnReset.Location = New System.Drawing.Point(85, 490) + Me.btnReset.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnReset.Name = "btnReset" + Me.btnReset.Size = New System.Drawing.Size(100, 28) + Me.btnReset.TabIndex = 0 + Me.btnReset.Text = "reset Date" + Me.btnReset.UseVisualStyleBackColor = True + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(349, 496) + Me.Label1.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(51, 17) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "Label1" + ' + 'btnLoadBunk + ' + Me.btnLoadBunk.Location = New System.Drawing.Point(85, 44) + Me.btnLoadBunk.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnLoadBunk.Name = "btnLoadBunk" + Me.btnLoadBunk.Size = New System.Drawing.Size(100, 28) + Me.btnLoadBunk.TabIndex = 2 + Me.btnLoadBunk.Text = "Load BUNK" + Me.btnLoadBunk.UseVisualStyleBackColor = True + ' + 'btnPrintStart + ' + Me.btnPrintStart.Location = New System.Drawing.Point(85, 203) + Me.btnPrintStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnPrintStart.Name = "btnPrintStart" + Me.btnPrintStart.Size = New System.Drawing.Size(100, 28) + Me.btnPrintStart.TabIndex = 3 + Me.btnPrintStart.Text = "Start Paint" + Me.btnPrintStart.UseVisualStyleBackColor = True + ' + 'cmbSheet + ' + Me.cmbSheet.DisplayMember = "SheetId" + Me.cmbSheet.FormattingEnabled = True + Me.cmbSheet.Location = New System.Drawing.Point(701, 48) + Me.cmbSheet.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.cmbSheet.Name = "cmbSheet" + Me.cmbSheet.Size = New System.Drawing.Size(160, 24) + Me.cmbSheet.TabIndex = 4 + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(586, 56) + Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(92, 17) + Me.Label2.TabIndex = 5 + Me.Label2.Text = "current sheet" + ' + 'btnPrintEnd + ' + Me.btnPrintEnd.Location = New System.Drawing.Point(564, 203) + Me.btnPrintEnd.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnPrintEnd.Name = "btnPrintEnd" + Me.btnPrintEnd.Size = New System.Drawing.Size(100, 28) + Me.btnPrintEnd.TabIndex = 6 + Me.btnPrintEnd.Text = "End Paint" + Me.btnPrintEnd.UseVisualStyleBackColor = True + ' + 'btnWorkStart + ' + Me.btnWorkStart.Location = New System.Drawing.Point(85, 257) + Me.btnWorkStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnWorkStart.Name = "btnWorkStart" + Me.btnWorkStart.Size = New System.Drawing.Size(100, 28) + Me.btnWorkStart.TabIndex = 7 + Me.btnWorkStart.Text = "Start Cut" + Me.btnWorkStart.UseVisualStyleBackColor = True + ' + 'btnWorkEnd + ' + Me.btnWorkEnd.Location = New System.Drawing.Point(564, 257) + Me.btnWorkEnd.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnWorkEnd.Name = "btnWorkEnd" + Me.btnWorkEnd.Size = New System.Drawing.Size(100, 28) + Me.btnWorkEnd.TabIndex = 8 + Me.btnWorkEnd.Text = "End Cut" + Me.btnWorkEnd.UseVisualStyleBackColor = True + ' + 'btnUnlStart + ' + Me.btnUnlStart.Location = New System.Drawing.Point(85, 309) + Me.btnUnlStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnUnlStart.Name = "btnUnlStart" + Me.btnUnlStart.Size = New System.Drawing.Size(100, 28) + Me.btnUnlStart.TabIndex = 9 + Me.btnUnlStart.Text = "Start Unload" + Me.btnUnlStart.UseVisualStyleBackColor = True + ' + 'btnUnlEnd + ' + Me.btnUnlEnd.Location = New System.Drawing.Point(564, 309) + Me.btnUnlEnd.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnUnlEnd.Name = "btnUnlEnd" + Me.btnUnlEnd.Size = New System.Drawing.Size(100, 28) + Me.btnUnlEnd.TabIndex = 10 + Me.btnUnlEnd.Text = "End Unload" + Me.btnUnlEnd.UseVisualStyleBackColor = True + ' + 'btnNextBunk + ' + Me.btnNextBunk.Location = New System.Drawing.Point(85, 106) + Me.btnNextBunk.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnNextBunk.Name = "btnNextBunk" + Me.btnNextBunk.Size = New System.Drawing.Size(100, 28) + Me.btnNextBunk.TabIndex = 11 + Me.btnNextBunk.Text = "Next BUNK" + Me.btnNextBunk.UseVisualStyleBackColor = True + Me.btnNextBunk.Visible = False + ' + 'txtCurrBunk + ' + Me.txtCurrBunk.Location = New System.Drawing.Point(212, 46) + Me.txtCurrBunk.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtCurrBunk.Name = "txtCurrBunk" + Me.txtCurrBunk.Size = New System.Drawing.Size(132, 22) + Me.txtCurrBunk.TabIndex = 12 + ' + 'lblNextBunk + ' + Me.lblNextBunk.AutoSize = True + Me.lblNextBunk.Location = New System.Drawing.Point(212, 117) + Me.lblNextBunk.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblNextBunk.Name = "lblNextBunk" + Me.lblNextBunk.Size = New System.Drawing.Size(23, 17) + Me.lblNextBunk.TabIndex = 13 + Me.lblNextBunk.Text = "---" + Me.lblNextBunk.Visible = False + ' + 'txtPrintStart + ' + Me.txtPrintStart.Location = New System.Drawing.Point(212, 207) + Me.txtPrintStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtPrintStart.Name = "txtPrintStart" + Me.txtPrintStart.Size = New System.Drawing.Size(188, 22) + Me.txtPrintStart.TabIndex = 14 + ' + 'txtWorkStart + ' + Me.txtWorkStart.Location = New System.Drawing.Point(212, 260) + Me.txtWorkStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtWorkStart.Name = "txtWorkStart" + Me.txtWorkStart.Size = New System.Drawing.Size(188, 22) + Me.txtWorkStart.TabIndex = 15 + ' + 'txtUnlStart + ' + Me.txtUnlStart.Location = New System.Drawing.Point(212, 311) + Me.txtUnlStart.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtUnlStart.Name = "txtUnlStart" + Me.txtUnlStart.Size = New System.Drawing.Size(188, 22) + Me.txtUnlStart.TabIndex = 16 + ' + 'txtUnlEnd + ' + Me.txtUnlEnd.Location = New System.Drawing.Point(701, 310) + Me.txtUnlEnd.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtUnlEnd.Name = "txtUnlEnd" + Me.txtUnlEnd.Size = New System.Drawing.Size(188, 22) + Me.txtUnlEnd.TabIndex = 19 + ' + 'txtWorkEnd + ' + Me.txtWorkEnd.Location = New System.Drawing.Point(701, 258) + Me.txtWorkEnd.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtWorkEnd.Name = "txtWorkEnd" + Me.txtWorkEnd.Size = New System.Drawing.Size(188, 22) + Me.txtWorkEnd.TabIndex = 18 + ' + 'txtPrintEnd + ' + Me.txtPrintEnd.Location = New System.Drawing.Point(701, 206) + Me.txtPrintEnd.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.txtPrintEnd.Name = "txtPrintEnd" + Me.txtPrintEnd.Size = New System.Drawing.Size(188, 22) + Me.txtPrintEnd.TabIndex = 17 + ' + 'btnSaveAll + ' + Me.btnSaveAll.Location = New System.Drawing.Point(77, 378) + Me.btnSaveAll.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.btnSaveAll.Name = "btnSaveAll" + Me.btnSaveAll.Size = New System.Drawing.Size(813, 28) + Me.btnSaveAll.TabIndex = 20 + Me.btnSaveAll.Text = "Save All Data" + Me.btnSaveAll.UseVisualStyleBackColor = True + ' + 'btnPing + ' + Me.btnPing.Location = New System.Drawing.Point(85, 8) + Me.btnPing.Margin = New System.Windows.Forms.Padding(4) + Me.btnPing.Name = "btnPing" + Me.btnPing.Size = New System.Drawing.Size(100, 28) + Me.btnPing.TabIndex = 21 + Me.btnPing.Text = "Test Ping" + Me.btnPing.UseVisualStyleBackColor = True + ' + 'lblPing + ' + Me.lblPing.AutoSize = True + Me.lblPing.Location = New System.Drawing.Point(212, 14) + Me.lblPing.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblPing.Name = "lblPing" + Me.lblPing.Size = New System.Drawing.Size(59, 17) + Me.lblPing.TabIndex = 22 + Me.lblPing.Text = "ping???" + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1067, 554) + Me.Controls.Add(Me.lblPing) + Me.Controls.Add(Me.btnPing) + Me.Controls.Add(Me.btnSaveAll) + Me.Controls.Add(Me.txtUnlEnd) + Me.Controls.Add(Me.txtWorkEnd) + Me.Controls.Add(Me.txtPrintEnd) + Me.Controls.Add(Me.txtUnlStart) + Me.Controls.Add(Me.txtWorkStart) + Me.Controls.Add(Me.txtPrintStart) + Me.Controls.Add(Me.lblNextBunk) + Me.Controls.Add(Me.txtCurrBunk) + Me.Controls.Add(Me.btnNextBunk) + Me.Controls.Add(Me.btnUnlEnd) + Me.Controls.Add(Me.btnUnlStart) + Me.Controls.Add(Me.btnWorkEnd) + Me.Controls.Add(Me.btnWorkStart) + Me.Controls.Add(Me.btnPrintEnd) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.cmbSheet) + Me.Controls.Add(Me.btnPrintStart) + Me.Controls.Add(Me.btnLoadBunk) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.btnReset) + Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.Name = "Form1" + Me.Text = "Form1" + Me.ResumeLayout(False) + Me.PerformLayout() - End Sub + End Sub - Friend WithEvents btnReset As Button + Friend WithEvents btnReset As Button Friend WithEvents Label1 As Label Friend WithEvents btnLoadBunk As Button Friend WithEvents btnPrintStart As Button @@ -276,4 +322,6 @@ Partial Class Form1 Friend WithEvents txtWorkEnd As TextBox Friend WithEvents txtPrintEnd As TextBox Friend WithEvents btnSaveAll As Button + Friend WithEvents btnPing As Button + Friend WithEvents lblPing As Label End Class diff --git a/RedisExample/Form1.vb b/RedisExample/Form1.vb index 6bbcaa4..b6b6995 100644 --- a/RedisExample/Form1.vb +++ b/RedisExample/Form1.vb @@ -1,4 +1,5 @@ -Imports NKC_SDK +Imports System.Net.NetworkInformation +Imports NKC_SDK Public Class Form1 @@ -6,9 +7,13 @@ Public Class Form1 ' caricamento del NEXT STACK da redis (come oggetto) ' PROD http : http://seriate.steamware.net:8083/NKC/ ' DEV: https : http://localhost:44388/ + Dim baseIp As String = "seriate.steamware.net" Dim baseUrl As String = "http://seriate.steamware.net:8083/NKC/" - Dim currNKC As NKC = New NKC(baseUrl) + Dim currNKC As NKC = New NKC(baseIp, baseUrl) + Dim currentBunk As ProdBunk = Nothing + Dim risultatoPing As PingReply = Nothing + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnReset.Click @@ -111,21 +116,49 @@ Public Class Form1 Private Sub updateDataButtons() - ' imposto dateora ed in base ai valori dt del currBunk abilito o meno i buttons... - txtPrintStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtStart.ToString() - txtPrintEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtEnd.ToString() - txtWorkStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtStart.ToString() - txtWorkEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtEnd.ToString() - txtUnlStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtStart.ToString() - txtUnlEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtEnd.ToString() + Dim showButtons As Boolean = False + + ' verifico se il ping è ok... + If IsNothing(risultatoPing) Then + lblPing.Text = "Effettuare test ping!" + + Else + ' controllo se sia success.. + If risultatoPing.Status = IPStatus.Success Then + ' ok show + showButtons = True + ' imposto dateora ed in base ai valori dt del currBunk abilito o meno i buttons... + txtPrintStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtStart.ToString() + txtPrintEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Printing.DtEnd.ToString() + txtWorkStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtStart.ToString() + txtWorkEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Machining.DtEnd.ToString() + txtUnlStart.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtStart.ToString() + txtUnlEnd.Text = currentBunk.SheetList(cmbSheet.SelectedIndex).Unloading.DtEnd.ToString() - btnPrintStart.Enabled = String.IsNullOrWhiteSpace(txtPrintStart.Text) - btnPrintEnd.Enabled = String.IsNullOrWhiteSpace(txtPrintEnd.Text) - btnWorkStart.Enabled = String.IsNullOrWhiteSpace(txtWorkStart.Text) - btnWorkEnd.Enabled = String.IsNullOrWhiteSpace(txtWorkEnd.Text) - btnUnlStart.Enabled = String.IsNullOrWhiteSpace(txtUnlStart.Text) - btnUnlEnd.Enabled = String.IsNullOrWhiteSpace(txtUnlEnd.Text) + btnPrintStart.Enabled = String.IsNullOrWhiteSpace(txtPrintStart.Text) + btnPrintEnd.Enabled = String.IsNullOrWhiteSpace(txtPrintEnd.Text) + btnWorkStart.Enabled = String.IsNullOrWhiteSpace(txtWorkStart.Text) + btnWorkEnd.Enabled = String.IsNullOrWhiteSpace(txtWorkEnd.Text) + btnUnlStart.Enabled = String.IsNullOrWhiteSpace(txtUnlStart.Text) + btnUnlEnd.Enabled = String.IsNullOrWhiteSpace(txtUnlEnd.Text) + Else + lblPing.Text = "Ping test fallito! " + risultatoPing.Status.ToString() + + End If + + + End If + + ' fix buttons + btnLoadBunk.Visible = showButtons + btnNextBunk.Visible = showButtons + btnPrintStart.Visible = showButtons + btnPrintEnd.Visible = showButtons + btnWorkStart.Visible = showButtons + btnWorkEnd.Visible = showButtons + btnUnlStart.Visible = showButtons + btnUnlEnd.Visible = showButtons End Sub @@ -169,4 +202,11 @@ Public Class Form1 txtUnlEnd.Text = DateTime.Now End Sub + + Private Sub btnPing_Click(sender As Object, e As EventArgs) Handles btnPing.Click + ' chiamo test ping... + risultatoPing = currNKC.testPing + lblPing.Text = risultatoPing.Status.ToString() + + End Sub End Class diff --git a/RedisExample/RedisExample.vbproj b/RedisExample/RedisExample.vbproj index e7a7a18..ef4441b 100644 --- a/RedisExample/RedisExample.vbproj +++ b/RedisExample/RedisExample.vbproj @@ -50,99 +50,16 @@ On - - ..\packages\AIM.1.0.3\lib\AegisImplicitMail.dll - - - ..\packages\AjaxControlToolkit.19.1.0\lib\net40\AjaxControlToolkit.dll - - - ..\packages\Crc32C.NET.1.0.5.0\lib\net20\Crc32C.NET.dll - - - ..\packages\DnsClient.1.2.0\lib\net45\DnsClient.dll - - - ..\packages\SharpZipLib.1.2.0\lib\net45\ICSharpCode.SharpZipLib.dll - - - ..\packages\MongoDB.Bson.2.10.1\lib\net452\MongoDB.Bson.dll - - - ..\packages\MongoDB.Driver.2.10.1\lib\net452\MongoDB.Driver.dll - - - ..\packages\MongoDB.Driver.Core.2.10.1\lib\net452\MongoDB.Driver.Core.dll - - - ..\packages\MongoDB.Libmongocrypt.1.0.0\lib\net452\MongoDB.Libmongocrypt.dll - - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - ..\packages\NLog.4.6.8\lib\net45\NLog.dll - - - ..\packages\PDFsharp.1.50.5147\lib\net20\PdfSharp.dll - - - ..\packages\PDFsharp.1.50.5147\lib\net20\PdfSharp.Charting.dll - - - ..\packages\Pipelines.Sockets.Unofficial.2.1.1\lib\net461\Pipelines.Sockets.Unofficial.dll - - - ..\packages\SharpCompress.0.24.0\lib\net45\SharpCompress.dll - - - ..\packages\Snappy.NET.1.1.1.8\lib\net45\Snappy.NET.dll - - - ..\packages\StackExchange.Redis.2.0.601\lib\net461\StackExchange.Redis.dll - - - ..\packages\SteamWare.3.5.2002.719\lib\net462\SteamWare.dll - - - ..\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll - - - ..\packages\System.Diagnostics.PerformanceCounter.4.7.0\lib\net461\System.Diagnostics.PerformanceCounter.dll - - - ..\packages\System.IO.Pipelines.4.7.0\lib\netstandard2.0\System.IO.Pipelines.dll - - - ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - True - - - ..\packages\System.Threading.Channels.4.7.0\lib\netstandard2.0\System.Threading.Channels.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll - @@ -202,8 +119,6 @@ - - MyApplicationCodeGenerator Application.Designer.vb @@ -214,7 +129,6 @@ Settings.Designer.vb - @@ -222,20 +136,5 @@ NKC_SDK - - - - - - - - - - Questo progetto fa riferimento a uno o più pacchetti NuGet che non sono presenti in questo computer. Usare lo strumento di ripristino dei pacchetti NuGet per scaricarli. Per altre informazioni, vedere http://go.microsoft.com/fwlink/?LinkID=322105. Il file mancante è {0}. - - - - - \ No newline at end of file diff --git a/RedisExample/packages.config b/RedisExample/packages.config deleted file mode 100644 index a0c50e2..0000000 --- a/RedisExample/packages.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file