From df90ac807362c7bba29bd2c5921c8cd99cb3827d Mon Sep 17 00:00:00 2001 From: Luc Vandenbroucke Date: Tue, 27 Apr 2021 10:41:04 +0200 Subject: [PATCH] extra error checking --- SetupProject1/Product.wxs | 66 ++++++++----------- .../{SetupProject1.wax => eDosSetup.wax} | 6 +- SetupProject1/eDosSetup.wixproj | 18 ++--- eDosStation/App.xaml | 1 - eDosStation/DataInterface.cs | 23 ++++--- eDosStation/MainWindow.xaml.cs | 4 +- eDosStation/eDosStation.csproj | 18 ----- 7 files changed, 56 insertions(+), 80 deletions(-) rename SetupProject1/{SetupProject1.wax => eDosSetup.wax} (85%) diff --git a/SetupProject1/Product.wxs b/SetupProject1/Product.wxs index a7a3773..847bd7e 100644 --- a/SetupProject1/Product.wxs +++ b/SetupProject1/Product.wxs @@ -1,28 +1,24 @@ - + - + - + - + - - + + - - - @@ -32,7 +28,7 @@ - + @@ -46,42 +42,35 @@ - - - + + + - - - + + + - - + + - + - + + @@ -94,14 +83,17 @@ + - + + + @@ -115,11 +107,11 @@ - - + + - + @@ -132,17 +124,15 @@ - + - + + diff --git a/SetupProject1/SetupProject1.wax b/SetupProject1/eDosSetup.wax similarity index 85% rename from SetupProject1/SetupProject1.wax rename to SetupProject1/eDosSetup.wax index bcbe63c..bd240de 100644 --- a/SetupProject1/SetupProject1.wax +++ b/SetupProject1/eDosSetup.wax @@ -1,15 +1,15 @@ - syncEdosLocal\syncEdosLocal.csproj eDosStation\eDosStation.csproj + syncEdosLocal\syncEdosLocal.csproj - false - false + true + true false - \ No newline at end of file diff --git a/SetupProject1/eDosSetup.wixproj b/SetupProject1/eDosSetup.wixproj index cb7e406..961c0ce 100644 --- a/SetupProject1/eDosSetup.wixproj +++ b/SetupProject1/eDosSetup.wixproj @@ -22,6 +22,15 @@ + + + $(WixExtDir)\WixUtilExtension.dll + WixUtilExtension + + + + + eDosStation @@ -40,15 +49,6 @@ INSTALLFOLDER - - - - - - $(WixExtDir)\WixUtilExtension.dll - WixUtilExtension - - diff --git a/eDosStation/App.xaml b/eDosStation/App.xaml index a63dabf..1aeda9d 100644 --- a/eDosStation/App.xaml +++ b/eDosStation/App.xaml @@ -9,6 +9,5 @@ - diff --git a/eDosStation/DataInterface.cs b/eDosStation/DataInterface.cs index 8cf7041..1e4a392 100644 --- a/eDosStation/DataInterface.cs +++ b/eDosStation/DataInterface.cs @@ -101,15 +101,20 @@ namespace eDosStation private void init() { - first(); - currentConStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosStation.Properties.Settings.localConnectionString"].ConnectionString; - ConCentralStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosConnectionString"].ConnectionString; - localConnection = new SqlConnection(currentConStr); - NextIDCommand = new SqlCommand("SELECT NEXT VALUE FOR VisitSequence as VisitID", localConnection); - - isLocal = true; - MakeCommands(); - bool rv= checkCon(false); + try + { + first(); + currentConStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosStation.Properties.Settings.localConnectionString"].ConnectionString; + ConCentralStr = System.Configuration.ConfigurationManager.ConnectionStrings["eDosConnectionString"].ConnectionString; + localConnection = new SqlConnection(currentConStr); + NextIDCommand = new SqlCommand("SELECT NEXT VALUE FOR VisitSequence as VisitID", localConnection); + isLocal = true; + MakeCommands(); + bool rv = checkCon(false); + } catch (Exception ex) + { + System.Windows.MessageBox.Show($"Init error {ex.Message} con={currentConStr}"); + } } public DataInterface() diff --git a/eDosStation/MainWindow.xaml.cs b/eDosStation/MainWindow.xaml.cs index c1f1ac2..19ae35f 100644 --- a/eDosStation/MainWindow.xaml.cs +++ b/eDosStation/MainWindow.xaml.cs @@ -60,7 +60,7 @@ namespace eDosStation private void MenuItem_Click(object sender, RoutedEventArgs e) { - Settings s = new Settings( thisStation); + Settings s = new Settings(thisStation); s.ShowDialog(); } @@ -93,9 +93,9 @@ namespace eDosStation bool ok = true; string errMsg = string.Empty; - dataInterface = new DataInterface(); try { + dataInterface = new DataInterface(); thisStation = new Station(dataInterface, string.Empty); } catch (System.Exception ex) diff --git a/eDosStation/eDosStation.csproj b/eDosStation/eDosStation.csproj index 3b70e35..dfb0806 100644 --- a/eDosStation/eDosStation.csproj +++ b/eDosStation/eDosStation.csproj @@ -89,24 +89,6 @@ http://timestamp.digicert.com - - ..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll - - - ..\packages\SharpDX.D3DCompiler.4.2.0\lib\net45\SharpDX.D3DCompiler.dll - - - ..\packages\SharpDX.Direct2D1.4.2.0\lib\net45\SharpDX.Direct2D1.dll - - - ..\packages\SharpDX.Direct3D10.4.2.0\lib\net45\SharpDX.Direct3D10.dll - - - ..\packages\SharpDX.Direct3D9.4.2.0\lib\net45\SharpDX.Direct3D9.dll - - - ..\packages\SharpDX.DXGI.4.2.0\lib\net45\SharpDX.DXGI.dll -