From 1d9eafed0c118d38fd30bed271393313be2a2583 Mon Sep 17 00:00:00 2001 From: Luc Vandenbroucke Date: Fri, 25 Nov 2022 14:37:12 +0100 Subject: [PATCH] check --- eDosLocal/UpdateLocal.sql | 4 +++- syncEdosLocal/Program.cs | 29 ++++++++---------------- syncEdosLocal/Properties/AssemblyInfo.cs | 4 ++-- syncEdosLocal/packages.config | 2 +- syncEdosLocal/syncEdosLocal.csproj | 11 +++++---- 5 files changed, 22 insertions(+), 28 deletions(-) diff --git a/eDosLocal/UpdateLocal.sql b/eDosLocal/UpdateLocal.sql index 812dd4b..4fd7c3a 100644 --- a/eDosLocal/UpdateLocal.sql +++ b/eDosLocal/UpdateLocal.sql @@ -260,7 +260,9 @@ GO IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id=OBJECT_ID('[dbo].[StationSettings]') AND name='AllowMultipleEPD') ALTER TABLE [dbo].[StationSettings] ADD AllowMultipleEPD BIT NULL; IF NOT EXISTS (SELECT * FROM sys.columns WHERE object_id=OBJECT_ID('[dbo].[StationSettings]') AND name='EPDRetries') -ALTER TABLE [dbo].[StationSettings] ADD EPDRetries BIT NULL; +ALTER TABLE [dbo].[StationSettings] ADD EPDRetries INT NULL; +IF EXISTS (SELECT * FROM sys.columns WHERE object_id=OBJECT_ID('[dbo].[StationSettings]') AND name='EPDRetries' AND [system_type_id]<>56) +ALTER TABLE [dbo].[StationSettings] ALTER COLUMN [EPDREtries] int GO ALTER PROCEDURE [dbo].[StationSettingsSelect] AS SELECT diff --git a/syncEdosLocal/Program.cs b/syncEdosLocal/Program.cs index cb8bbdb..3e54677 100644 --- a/syncEdosLocal/Program.cs +++ b/syncEdosLocal/Program.cs @@ -9,7 +9,6 @@ using spl = LSWLib.CLog; namespace syncEdosLocal { - class cResult { @@ -96,11 +95,11 @@ namespace syncEdosLocal class Program { - [DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); - [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); + //[DllImport("kernel32.dll")] static extern IntPtr GetConsoleWindow(); + //[DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); - const int SW_HIDE = 0; - const int SW_SHOW = 5; + //const int SW_HIDE = 0; + //const int SW_SHOW = 5; const string moduleName = "syncEdosLocal"; public static string pcName; @@ -331,17 +330,13 @@ namespace syncEdosLocal } if (Verbose > 0) { - var handle = GetConsoleWindow(); - ShowWindow(handle, SW_SHOW); + LSWLib.Util.ShowConsoleWindow(); oStream = new System.IO.StreamWriter(System.Console.OpenStandardOutput()); } else { oStream = null; // new System.IO.StreamWriter( System.IO.Stream.Null); - var handle = GetConsoleWindow(); - ShowWindow(handle, SW_HIDE); - //// Show - //ShowWindow(handle, SW_SHOW); + LSWLib.Util.HideConsoleWindow(); } pcName = System.Environment.MachineName; @@ -403,7 +398,6 @@ namespace syncEdosLocal } if (eDosLocalCon != null) UpdateRemoteReturns(eDosLocalCon); - } } catch (System.Exception ex) @@ -414,8 +408,6 @@ namespace syncEdosLocal } if (error) goto final; - - final: messages.AppendLine($"Process:End,tm={System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm")}, Errors={error}, Warnings={warning}"); @@ -436,6 +428,8 @@ namespace syncEdosLocal // using (var mc = new System.Net.Mail.SmtpClient(smtpServer, smtpPort)) { mc.Send(m); } //} spLog.CloseSplunkLog(); + if (error) Environment.Exit(1); + else Environment.Exit(1); } static void DoorloopVisits(SqlConnection coLocal, SqlConnection coCentral, spl spLog, ref bool error) { @@ -554,11 +548,6 @@ namespace syncEdosLocal { spLog.Connection_InfoMessageLog(e, ref messages); } - - static Program() - { - var handle = GetConsoleWindow(); - ShowWindow(handle, SW_HIDE); - } + } } diff --git a/syncEdosLocal/Properties/AssemblyInfo.cs b/syncEdosLocal/Properties/AssemblyInfo.cs index 7c985bd..e84f669 100644 --- a/syncEdosLocal/Properties/AssemblyInfo.cs +++ b/syncEdosLocal/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.3.0")] -[assembly: AssemblyFileVersion("1.6.3.0")] +[assembly: AssemblyVersion("1.7.0.0")] +[assembly: AssemblyFileVersion("1.7.0.0")] diff --git a/syncEdosLocal/packages.config b/syncEdosLocal/packages.config index 5e54067..c392b83 100644 --- a/syncEdosLocal/packages.config +++ b/syncEdosLocal/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/syncEdosLocal/syncEdosLocal.csproj b/syncEdosLocal/syncEdosLocal.csproj index a827c90..d385c2e 100644 --- a/syncEdosLocal/syncEdosLocal.csproj +++ b/syncEdosLocal/syncEdosLocal.csproj @@ -1,6 +1,6 @@  - + Debug @@ -106,9 +106,12 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + - + + + %25signer%25 $(TargetPath) + \ No newline at end of file