Added delete all buttons to CREWA CREWD PASA PASD in Border police ctrl

This commit is contained in:
Daniel Schick 2024-08-12 13:56:37 +02:00
parent bed3fc397a
commit c26c19d401
5 changed files with 101 additions and 21 deletions

View File

@ -65,6 +65,7 @@
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/> <CheckBox Name="checkBoxCrewNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAX_Click"/>
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
<Button Name="buttonDeleteAllCrewA" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllCrewA_Click"/>
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWA" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
@ -107,6 +108,7 @@
<Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelCrewNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click"/> <CheckBox Name="checkBoxCrewNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationPAXDeparture_Click"/>
<Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelCrewNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
<Button Name="buttonDeleteAllCrewD" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllCrewD_Click"/>
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWD" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="CREWD" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" x:Name="dataGridCrewListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
@ -147,6 +149,7 @@
<Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelPasNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/> <CheckBox Name="checkBoxPasNotificationPAX" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAX_Click"/>
<Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelPasNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" />
<Button Name="buttonDeleteAllPasA" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllPasA_Click"/>
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASA" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerList" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
@ -192,6 +195,7 @@
<Label Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" /> <Label Name="labelPasNotificationSchengenDeparture" Content="{x:Static p:Resources.textNotificationSchengen}" />
<CheckBox Name="checkBoxPasNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/> <CheckBox Name="checkBoxPasNotificationPAXDeparture" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxPasNotificationPAXDeparture_Click"/>
<Label Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" /> <Label Name="labelPasNotificationPAXDeparture" Content="{x:Static p:Resources.textNotificationPAX}" />
<Button Name="buttonDeleteAllPasD" Margin="2" Content="{x:Static p:Resources.textDeleteAllEntries}" Background="Transparent" Click="buttonDeleteAllPasD_Click"/>
<TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASD" VerticalAlignment="Center" /> <TextBlock Margin="30,0,0,0" FontWeight="Bold" FontSize="16" Text="PASD" VerticalAlignment="Center" />
</StackPanel> </StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPassengerListDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"

View File

@ -14,6 +14,7 @@ using ENI2.Locode;
using ExcelDataReader; using ExcelDataReader;
using bsmd.database; using bsmd.database;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Linq;
namespace ENI2.DetailViewControls namespace ENI2.DetailViewControls
{ {
@ -1188,8 +1189,6 @@ namespace ENI2.DetailViewControls
} }
} }
private void buttonImportExcelPassengerDeparture_Click(object sender, RoutedEventArgs e) private void buttonImportExcelPassengerDeparture_Click(object sender, RoutedEventArgs e)
{ {
OpenFileDialog ofd = new OpenFileDialog OpenFileDialog ofd = new OpenFileDialog
@ -1314,7 +1313,7 @@ namespace ENI2.DetailViewControls
private void checkBoxCrewNotificationSchengen_Click(object sender, RoutedEventArgs e) private void checkBoxCrewNotificationSchengen_Click(object sender, RoutedEventArgs e)
{ {
foreach(CREW crew in _crewMessage.Elements) foreach(CREW crew in _crewMessage.Elements.Cast<CREW>())
{ {
crew.NotificationSchengen = checkBoxCrewNotificationSchengen.IsChecked; crew.NotificationSchengen = checkBoxCrewNotificationSchengen.IsChecked;
} }
@ -1324,7 +1323,7 @@ namespace ENI2.DetailViewControls
private void checkBoxCrewNotificationPAX_Click(object sender, RoutedEventArgs e) private void checkBoxCrewNotificationPAX_Click(object sender, RoutedEventArgs e)
{ {
foreach (CREW crew in _crewMessage.Elements) foreach (CREW crew in _crewMessage.Elements.Cast<CREW>())
{ {
crew.NotificationPAX = checkBoxCrewNotificationPAX.IsChecked; crew.NotificationPAX = checkBoxCrewNotificationPAX.IsChecked;
} }
@ -1333,7 +1332,7 @@ namespace ENI2.DetailViewControls
private void checkBoxCrewNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e) private void checkBoxCrewNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e)
{ {
foreach(CREWD crewd in _crewdMessage.Elements) foreach(CREWD crewd in _crewdMessage.Elements.Cast<CREWD>())
{ {
crewd.NotificationSchengen = checkBoxCrewNotificationSchengenDeparture.IsChecked; crewd.NotificationSchengen = checkBoxCrewNotificationSchengenDeparture.IsChecked;
} }
@ -1342,7 +1341,7 @@ namespace ENI2.DetailViewControls
private void checkBoxCrewNotificationPAXDeparture_Click(object sender, RoutedEventArgs e) private void checkBoxCrewNotificationPAXDeparture_Click(object sender, RoutedEventArgs e)
{ {
foreach (CREWD crewd in _crewdMessage.Elements) foreach (CREWD crewd in _crewdMessage.Elements.Cast<CREWD>())
{ {
crewd.NotificationPAX = checkBoxCrewNotificationPAXDeparture.IsChecked; crewd.NotificationPAX = checkBoxCrewNotificationPAXDeparture.IsChecked;
} }
@ -1351,7 +1350,7 @@ namespace ENI2.DetailViewControls
private void checkBoxPasNotificationSchengen_Click(object sender, RoutedEventArgs e) private void checkBoxPasNotificationSchengen_Click(object sender, RoutedEventArgs e)
{ {
foreach(PAS pas in _pasMessage.Elements) foreach(PAS pas in _pasMessage.Elements.Cast<PAS>())
{ {
pas.NotificationSchengen = checkBoxPasNotificationSchengen.IsChecked; pas.NotificationSchengen = checkBoxPasNotificationSchengen.IsChecked;
} }
@ -1360,7 +1359,7 @@ namespace ENI2.DetailViewControls
private void checkBoxPasNotificationPAX_Click(object sender, RoutedEventArgs e) private void checkBoxPasNotificationPAX_Click(object sender, RoutedEventArgs e)
{ {
foreach(PAS pas in _pasMessage.Elements) foreach(PAS pas in _pasMessage.Elements.Cast<PAS>())
{ {
pas.NotificationPAX = checkBoxPasNotificationPAX.IsChecked; pas.NotificationPAX = checkBoxPasNotificationPAX.IsChecked;
} }
@ -1369,7 +1368,7 @@ namespace ENI2.DetailViewControls
private void checkBoxPasNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e) private void checkBoxPasNotificationSchengenDeparture_Click(object sender, RoutedEventArgs e)
{ {
foreach(PASD pasd in _pasdMessage.Elements) foreach(PASD pasd in _pasdMessage.Elements.Cast<PASD>())
{ {
pasd.NotificationSchengen = checkBoxPasNotificationSchengenDeparture.IsChecked; pasd.NotificationSchengen = checkBoxPasNotificationSchengenDeparture.IsChecked;
} }
@ -1378,7 +1377,7 @@ namespace ENI2.DetailViewControls
private void checkBoxPasNotificationPAXDeparture_Click(object sender, RoutedEventArgs e) private void checkBoxPasNotificationPAXDeparture_Click(object sender, RoutedEventArgs e)
{ {
foreach(PASD pasd in _pasdMessage.Elements) foreach(PASD pasd in _pasdMessage.Elements.Cast<PASD>())
{ {
pasd.NotificationPAX = checkBoxPasNotificationPAXDeparture.IsChecked; pasd.NotificationPAX = checkBoxPasNotificationPAXDeparture.IsChecked;
} }
@ -1387,5 +1386,65 @@ namespace ENI2.DetailViewControls
#endregion #endregion
#region Buttons to delete all entries from CREWA CREWD PASA PASD
private async void buttonDeleteAllCrewA_Click(object sender, RoutedEventArgs e)
{
if(MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
foreach(CREW crewa in this._crewMessage.Elements.Cast<CREW>())
{
await DBManagerAsync.DeleteAsync(crewa);
}
this._crewMessage.Elements.Clear();
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREWA);
}
}
private async void buttonDeleteAllCrewD_Click(object sender, RoutedEventArgs e)
{
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
foreach (CREWD crewd in this._crewMessage.Elements.Cast<CREWD>())
{
await DBManagerAsync.DeleteAsync(crewd);
}
this._crewdMessage.Elements.Clear();
this.dataGridCrewListDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREWD);
}
}
private async void buttonDeleteAllPasA_Click(object sender, RoutedEventArgs e)
{
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
foreach (PAS pasa in this._pasMessage.Elements.Cast<PAS>())
{
await DBManagerAsync.DeleteAsync(pasa);
}
this._pasMessage.Elements.Clear();
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PASA);
}
}
private async void buttonDeleteAllPasD_Click(object sender, RoutedEventArgs e)
{
if (MessageBox.Show(Properties.Resources.textConfimDeleteAllEntries, Properties.Resources.textConfirmation, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
foreach (PASD pasd in this._pasdMessage.Elements.Cast<PASD>())
{
await DBManagerAsync.DeleteAsync(pasd);
}
this._pasdMessage.Elements.Clear();
this.dataGridPassengerListDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PASD);
}
}
#endregion
} }
} }

View File

@ -32,13 +32,6 @@ namespace ENI2.DetailViewControls
private WasteDisposalServiceProvider_Template _currentTemplate; private WasteDisposalServiceProvider_Template _currentTemplate;
private string _undoTemplate; private string _undoTemplate;
private static readonly string[] _wasteDeliveryList =
{
"ALL",
"SOME",
"NONE"
};
public WasteDetailControl() public WasteDetailControl()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -1433,6 +1433,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to This will delete all entries. Are you sure?.
/// </summary>
public static string textConfimDeleteAllEntries {
get {
return ResourceManager.GetString("textConfimDeleteAllEntries", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Confirmation. /// Looks up a localized string similar to Confirmation.
/// </summary> /// </summary>
@ -2000,6 +2009,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Delete all entries.
/// </summary>
public static string textDeleteAllEntries {
get {
return ResourceManager.GetString("textDeleteAllEntries", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Departure notification. /// Looks up a localized string similar to Departure notification.
/// </summary> /// </summary>

View File

@ -1906,4 +1906,10 @@
<data name="textSpecialCaseDEHAM" xml:space="preserve"> <data name="textSpecialCaseDEHAM" xml:space="preserve">
<value>{0} has not been sent for DEHAM. Close anyway?</value> <value>{0} has not been sent for DEHAM. Close anyway?</value>
</data> </data>
<data name="textDeleteAllEntries" xml:space="preserve">
<value>Delete all entries</value>
</data>
<data name="textConfimDeleteAllEntries" xml:space="preserve">
<value>This will delete all entries. Are you sure?</value>
</data>
</root> </root>