diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj
index b9363d13..ec89f23c 100644
--- a/ENI2/ENI2.csproj
+++ b/ENI2/ENI2.csproj
@@ -228,6 +228,9 @@
LocodeControl.xaml
+
+ CompareExcelDialog.xaml
+
EditWasteReceiptDialog.xaml
@@ -532,6 +535,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -777,10 +784,10 @@
-
-
-
-
+
+
+
+
diff --git a/ENI2/EditControls/CompareExcelDialog.xaml b/ENI2/EditControls/CompareExcelDialog.xaml
new file mode 100644
index 00000000..e8096095
--- /dev/null
+++ b/ENI2/EditControls/CompareExcelDialog.xaml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ENI2/EditControls/CompareExcelDialog.xaml.cs b/ENI2/EditControls/CompareExcelDialog.xaml.cs
new file mode 100644
index 00000000..e60f774c
--- /dev/null
+++ b/ENI2/EditControls/CompareExcelDialog.xaml.cs
@@ -0,0 +1,78 @@
+using System;
+using System.IO;
+using System.Windows;
+using System.Windows.Media.Imaging;
+
+namespace ENI2.EditControls
+{
+ ///
+ /// Interaction logic for CompareExcelDialog.xaml
+ ///
+ public partial class CompareExcelDialog : Controls.StatusWindowBase
+ {
+ private string _sourcePath = null;
+ private string _targetPath = null;
+
+ public CompareExcelDialog()
+ {
+ InitializeComponent();
+ }
+
+ private void imageSource_Drop(object sender, DragEventArgs e)
+ {
+ string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop);
+ foreach (string file in files)
+ Console.WriteLine(file);
+ if(files.Length > 0)
+ {
+ if(File.Exists(files[0]))
+ {
+ if(files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
+ {
+ _sourcePath = files[0];
+ imageSource.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_green.png"));
+ }
+ else
+ {
+ imageSource.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_yellow.png"));
+ }
+ }
+ else
+ {
+ imageSource.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_red.png"));
+ }
+ }
+ }
+
+ private void imageTarget_Drop(object sender, DragEventArgs e)
+ {
+ string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
+ foreach (string file in files)
+ Console.WriteLine(file);
+ if (files.Length > 0)
+ {
+ if (File.Exists(files[0]))
+ {
+ if (files[0].EndsWith("xls") || files[0].EndsWith("xlsx"))
+ {
+ _targetPath = files[0];
+ imageTarget.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_green.png"));
+ }
+ else
+ {
+ imageTarget.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_yellow.png"));
+ }
+ }
+ else
+ {
+ imageTarget.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/trafficlight_red.png"));
+ }
+ }
+ }
+
+ private void imageSource_DragEnter(object sender, DragEventArgs e)
+ {
+ if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effects = DragDropEffects.Copy;
+ }
+ }
+}
diff --git a/ENI2/MainWindow.xaml b/ENI2/MainWindow.xaml
index a33af61f..37d9d068 100644
--- a/ENI2/MainWindow.xaml
+++ b/ENI2/MainWindow.xaml
@@ -72,6 +72,7 @@
+
@@ -84,7 +85,8 @@
-
+
+
diff --git a/ENI2/MainWindow.xaml.cs b/ENI2/MainWindow.xaml.cs
index ae7de548..483bc33a 100644
--- a/ENI2/MainWindow.xaml.cs
+++ b/ENI2/MainWindow.xaml.cs
@@ -38,7 +38,8 @@ namespace ENI2
private POListControl poControl;
private ServerStatusControl statusControl;
private readonly SucheControl sucheControl;
-
+ private CompareExcelDialog compareExcelDialog;
+
private bool efMode = false;
private bool dbConnected;
private readonly ScaleTransform _transform = new ScaleTransform(1.0, 1.0);
@@ -287,6 +288,22 @@ namespace ENI2
this.buttonNewWithId.Visibility = newButtonsVisible ? Visibility.Visible : Visibility.Hidden;
}
+ private void buttonCompareSheets_Click(object sender, RoutedEventArgs ev)
+ {
+ // Open compare dialog
+ if(compareExcelDialog == null)
+ {
+ this.compareExcelDialog = new CompareExcelDialog();
+ this.compareExcelDialog.Closed += (o, e) => this.compareExcelDialog = null;
+ compareExcelDialog.Show();
+ }
+ else
+ {
+ compareExcelDialog.BringUp();
+ }
+
+ }
+
#endregion
#region window lifetime event handler
@@ -691,6 +708,6 @@ namespace ENI2
}
#endregion
-
+
}
}
diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs
index d7b6c951..6c73ca2f 100644
--- a/ENI2/Properties/Resources.Designer.cs
+++ b/ENI2/Properties/Resources.Designer.cs
@@ -1345,6 +1345,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Compare excel sheets.
+ ///
+ public static string textCompareExcel {
+ get {
+ return ResourceManager.GetString("textCompareExcel", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Condition.
///
diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx
index 214be32e..692a6d10 100644
--- a/ENI2/Properties/Resources.resx
+++ b/ENI2/Properties/Resources.resx
@@ -1840,4 +1840,7 @@
Copy to {0}
+
+ Compare excel sheets
+
\ No newline at end of file