Add a confirmation dialog if the waste service disposal provider field is not empty when the template is applied

This commit is contained in:
Daniel Schick 2025-07-26 10:58:39 +02:00
parent 54aa91afc1
commit 0c9b38ddd9
4 changed files with 26 additions and 0 deletions

View File

@ -361,6 +361,13 @@ namespace ENI2.DetailViewControls
{
if (this._currentTemplate == null) return;
// confirm overwrite of waste disposal service provider
if (this.textBox_WasteDisposalServiceProvider.Text.Length > 0)
{
if (MessageBox.Show(Properties.Resources.textConfirmWSDPOverwrite, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No)
== MessageBoxResult.No) { return; }
}
this._undoTemplate = createFromCurrentText(null, null);
this.textBox_AgentCity.Text = this._currentTemplate.AgentCity;

View File

@ -2173,6 +2173,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to The existing value for the waste disposal service provider will be overwritten. Proceed?.
/// </summary>
public static string textConfirmWSDPOverwrite {
get {
return ResourceManager.GetString("textConfirmWSDPOverwrite", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Construction characteristics.
/// </summary>

View File

@ -2257,4 +2257,7 @@
<data name="textNSWStatus" xml:space="preserve">
<value>NSW-Status</value>
</data>
<data name="textConfirmWSDPOverwrite" xml:space="preserve">
<value>The existing value for the waste disposal service provider will be overwritten. Proceed?</value>
</data>
</root>

View File

@ -339,6 +339,13 @@ namespace ENI2.SheetDisplayControls
{
if (this._currentTemplate == null) return;
// confirm overwrite of waste disposal service provider
if (this.textBox_WasteDisposalServiceProvider.Text.Length > 0)
{
if (MessageBox.Show(Properties.Resources.textConfirmWSDPOverwrite, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No)
== MessageBoxResult.No) { return; }
}
this._undoTemplate = createFromCurrentText(null, null);
this.textBox_AgentCity.Text = this._currentTemplate.AgentCity;