diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml b/ENI2/DetailViewControls/WasteDetailControl.xaml
index 2e350c35..6051b940 100644
--- a/ENI2/DetailViewControls/WasteDetailControl.xaml
+++ b/ENI2/DetailViewControls/WasteDetailControl.xaml
@@ -182,10 +182,12 @@
+
+
diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
index e4c5cbec..69c456be 100644
--- a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
+++ b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
@@ -684,5 +684,35 @@ namespace ENI2.DetailViewControls
#endregion
+ #region Copy WAS to WAS_RCPT handler
+
+ private void buttonCopyFromWAS_Click(object sender, RoutedEventArgs e)
+ {
+ if (_selectedWAS_RCPT == null) return;
+
+ if(MessageBox.Show(Properties.Resources.textCopyToWASConfirmation, Properties.Resources.textConfirmation,
+ MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
+ {
+ foreach(Waste waste in _was.Waste)
+ {
+ if(waste.WasteDisposalAmount_MTQ.HasValue && waste.WasteDisposalAmount_MTQ > 0)
+ {
+ // find matching WAS_RCPT entry
+ foreach(WasteReceived wasteReceived in _selectedWAS_RCPT.WasteReceived)
+ {
+ if(wasteReceived.WasteCode.Equals(waste.WasteType.ToString()))
+ {
+ wasteReceived.AmountWasteReceived_MTQ = waste.WasteDisposalAmount_MTQ;
+ break;
+ }
+ }
+ }
+ }
+ this.dataGridWasteReceived.Items.Refresh();
+ }
+ }
+
+ #endregion
+
}
}
diff --git a/ENI2/Properties/Resources.Designer.cs b/ENI2/Properties/Resources.Designer.cs
index 65b5d156..c7c1bba9 100644
--- a/ENI2/Properties/Resources.Designer.cs
+++ b/ENI2/Properties/Resources.Designer.cs
@@ -1613,6 +1613,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Copy from WAS.
+ ///
+ public static string textCopyFromWAS {
+ get {
+ return ResourceManager.GetString("textCopyFromWAS", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Copy IMO to clipboard.
///
@@ -1658,6 +1667,15 @@ namespace ENI2.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Do you want to copy / overwrite disposal amounts using values from WAS?.
+ ///
+ public static string textCopyToWASConfirmation {
+ get {
+ return ResourceManager.GetString("textCopyToWASConfirmation", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Copy TOWA to TOWD.
///
diff --git a/ENI2/Properties/Resources.resx b/ENI2/Properties/Resources.resx
index df0de683..61813aac 100644
--- a/ENI2/Properties/Resources.resx
+++ b/ENI2/Properties/Resources.resx
@@ -1882,4 +1882,10 @@
Excel import value mappings
+
+ Copy from WAS
+
+
+ Do you want to copy / overwrite disposal amounts using values from WAS?
+
\ No newline at end of file
diff --git a/bsmd.database/WasteDisposalServiceProvider_Template.cs b/bsmd.database/WasteDisposalServiceProvider_Template.cs
index ab52b4b8..308f62b9 100644
--- a/bsmd.database/WasteDisposalServiceProvider_Template.cs
+++ b/bsmd.database/WasteDisposalServiceProvider_Template.cs
@@ -97,8 +97,8 @@ namespace bsmd.database
public int CompareTo(object obj)
{
- if (obj is WasteDisposalServiceProvider_Template)
- this.Remark?.CompareTo(((WasteDisposalServiceProvider_Template)obj).Remark ?? "");
+ if (obj is WasteDisposalServiceProvider_Template template)
+ this.Remark?.CompareTo(template.Remark ?? "");
return 0;
}