Merge branch 'release/eni_7.2.9'

This commit is contained in:
Daniel Schick 2025-07-15 11:11:03 +02:00
commit e97017179b
40 changed files with 1255 additions and 336 deletions

View File

@ -506,7 +506,7 @@ namespace ENI2
this.DetailControl_RequestReload(this.Core.Id.Value); this.DetailControl_RequestReload(this.Core.Id.Value);
System.Action<int> SetTabAction = (int x) => System.Action<int> SetTabAction = x =>
{ {
// this hopefully happens *after* the view was completely reloaded // this hopefully happens *after* the view was completely reloaded
if (this.detailView.Children[0] is DetailBaseControl currentNewControl) if (this.detailView.Children[0] is DetailBaseControl currentNewControl)
@ -590,7 +590,7 @@ namespace ENI2
this.DetailControl_RequestReload(this.Core.Id.Value); this.DetailControl_RequestReload(this.Core.Id.Value);
System.Action<int> SetTabAction = (int x) => Action<int> SetTabAction = x =>
{ {
// this hopefully happens *after* the view was completely reloaded // this hopefully happens *after* the view was completely reloaded
if (this.detailView.Children[0] is DetailBaseControl currentNewControl) if (this.detailView.Children[0] is DetailBaseControl currentNewControl)

View File

@ -21,6 +21,7 @@ using Microsoft.Win32;
using System.Diagnostics; using System.Diagnostics;
using System.ComponentModel; using System.ComponentModel;
using static bsmd.database.Message; using static bsmd.database.Message;
using PdfSharp.Fonts;
namespace ENI2.DetailViewControls namespace ENI2.DetailViewControls
{ {
@ -576,6 +577,12 @@ namespace ENI2.DetailViewControls
Util.UIHelper.SetBusyState(); Util.UIHelper.SetBusyState();
ReportManager rm = new ReportManager(); ReportManager rm = new ReportManager();
// TODO!!
// https://docs.pdfsharp.net/PDFsharp/Topics/Fonts/Font-Resolving.html
// https://docs.pdfsharp.net/MigraDoc/DOM/Document/MigraDocSettings.html
GlobalFontSettings.UseWindowsFontsUnderWindows = true;
GlobalFontSettings.UseWindowsFontsUnderWsl2 = true;
// create PDF from message classes // create PDF from message classes
if (rm.Create(sfd.FileName, this.Core, sicd.SelectedClasses, out string importResultText)) if (rm.Create(sfd.FileName, this.Core, sicd.SelectedClasses, out string importResultText))
{ {

View File

@ -28,7 +28,7 @@
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="50" /> <RowDefinition Height="50" />
<RowDefinition Height="220" /> <RowDefinition Height="194" />
<RowDefinition Height="200" /> <RowDefinition Height="200" />
<RowDefinition Height="200" /> <RowDefinition Height="200" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
@ -36,10 +36,12 @@
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" /> <ColumnDefinition Width="1*" />
<ColumnDefinition Width="5*" /> <ColumnDefinition Width="4*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" VerticalAlignment="Center"/> <TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
<Button x:Name="buttonCopyNameFromCREWA" Grid.Row="0" Grid.Column="2" Margin="2" Content="{x:Static p:Resources.textCopyFromCREWA}" Click="buttonCopyNameFromCREWA_Click"/>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5"> <GroupBox Name="infoGroupBox" Header="{x:Static p:Resources.textInfo}" Grid.Row="1" Margin="0,5,0,5">
@ -57,35 +59,84 @@
<RowDefinition Height="26" /> <RowDefinition Height="26" />
<RowDefinition Height="26" /> <RowDefinition Height="26" />
<RowDefinition Height="26" /> <RowDefinition Height="26" />
<RowDefinition Height="26" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textShippingArea}" Name="label_INFOShippingArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textMaerskSeago}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textPortArea}" Name="label_INFOPortArea" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textRequestedPositionInPortOfCall}" Name="label_INFORequestedBerth" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textBowThrusterPower}" Name="label_INFOBowThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textBowThrusterPower}" Name="label_INFOBowThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textSternThrusterPower}" Name="label_INFOSternThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textSternThrusterPower}" Name="label_INFOSternThrusterPower" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textFumigatedBulkCargo}" Name="label_INFOFumigatedBulkCargo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textDeplacementSummerDraught}" Name="label_INFODeplacementSummerDraught" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="1" Grid.Column="2" Content="{x:Static p:Resources.textSpecialRequirementsOfShipAtBerth}" Name="label_INFOSpecialRequirements" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="2" Content="{x:Static p:Resources.textConstructionCharacteristics}" Name="label_INFOConstructionCharacteristics" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" /> <ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxShippingArea" Margin="2" SelectedIndex="{Binding ShippingArea, Converter={util:ByteConverter}}" ContextMenu="{DynamicResource ClearContextMenu}" />
<ComboBox Grid.Row="0" Grid.Column="3" x:Name="comboBoxGroup" Margin="2,2,4,2" ItemsSource="{StaticResource arrList}"
DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" /> <Grid Grid.Row="1" Grid.Column="1">
<Button Grid.Row="1" Grid.Column="3" x:Name="buttonSearchPortArea" Margin="2" Content="Lookup port area" Click="buttonSearchPortArea_Click" /> <Grid.ColumnDefinitions>
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="110" />
</Grid.ColumnDefinitions>
<ComboBox Grid.Column="0" Name="comboBoxPortArea" Margin="2" SelectedValue="{Binding PortArea}" SelectedValuePath="Key" DisplayMemberPath="Value" ContextMenu="{DynamicResource ClearContextMenu}" />
<Button Grid.Column="1" x:Name="buttonSearchPortArea" Margin="2" Content="Lookup port area" Click="buttonSearchPortArea_Click" />
</Grid>
<TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/> <TextBox Grid.Row="2" Grid.Column="1" Name="textRequestedPostionInPortOfCall" Margin="2" Text="{Binding RequestedPositionInPortOfCall, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/> <TextBox Grid.Row="3" Grid.Column="1" Name="textBowThrusterPower" Margin="2" Text="{Binding BowThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/> <TextBox Grid.Row="4" Grid.Column="1" Name="textSternThrusterPower" Margin="2" Text="{Binding SternThrusterPower, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/> <CheckBox Grid.Row="5" Grid.Column="1" Name="checkBoxFumigatedBulkCargo" VerticalContentAlignment="Center" IsChecked="{Binding FumigatedBulkCargoBool, Mode=TwoWay}" Margin="2"/>
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="0" Grid.Column="3" Name="doubleUpDownDisplacementSummerDraught" ShowButtonSpinner="False" ParsingNumberStyle="Any" Value="{Binding DeplacementSummerDraught_TNE}" Margin="4,2,0,2" FormatString="N1" TextAlignment="Left"/>
<TextBox Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top" /> <TextBox Grid.Row="1" Grid.Column="3" Grid.RowSpan="2" Name="textSpecialRequirements" Margin="2" Text="{Binding SpecialRequirementsOfShipAtBerth, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top" />
<TextBox Grid.Row="5" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top"/> <TextBox Grid.Row="3" Grid.Column="3" Grid.RowSpan="2" Name="textConstructionCharacteristics" Margin="2" Text="{Binding ConstructionCharacteristicsOfShip, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Top"/>
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2"> <GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="2">
<enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".1*" />
<ColumnDefinition Width=".2*" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width=".2*" />
</Grid.ColumnDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textSERVTemplate}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="comboBoxGroup" Margin="2,2,4,2" DisplayMemberPath="ServiceName"
SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" />
<Button Name="buttonSetTemplate" Margin="2" Click="buttonSetTemplate_Click" BorderThickness="0" Background="Transparent" Grid.Column="2"
ToolTip="Apply template" HorizontalContentAlignment="Right" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonEditTemplate" Grid.Column="4" Grid.Row="0" Margin="2" Click="buttonEditTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Edit template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/pencil.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonNewTemplate" Grid.Column="5" Grid.Row="0" Margin="2" Click="buttonNewTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="New template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/document_plain_new.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonDeleteTemplate" Grid.Column="6" Grid.Row="0" Margin="2" Click="buttonDeleteTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
</Grid>
<enictrl:ENIDataGrid Grid.Row="1" x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0"> AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" /> <DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
@ -94,7 +145,7 @@
<DataGridTextColumn Header="{x:Static p:Resources.textServiceInvoiceRecipient}" Binding="{Binding ServiceInvoiceRecipient, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" /> <DataGridTextColumn Header="{x:Static p:Resources.textServiceInvoiceRecipient}" Binding="{Binding ServiceInvoiceRecipient, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
</DataGrid.Columns> </DataGrid.Columns>
</enictrl:ENIDataGrid> </enictrl:ENIDataGrid>
</Grid>
</GroupBox> </GroupBox>
<GroupBox Name="ladgGroupBox" Header="{x:Static p:Resources.textLadg}" Grid.Row="3"> <GroupBox Name="ladgGroupBox" Header="{x:Static p:Resources.textLadg}" Grid.Row="3">
<enictrl:ENIDataGrid x:Name="dataGridLADG" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid x:Name="dataGridLADG" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"

View File

@ -16,6 +16,8 @@ using ENI2.EditControls;
using ENI2.Util; using ENI2.Util;
using bsmd.database; using bsmd.database;
using System.Threading.Tasks;
using System.Diagnostics;
namespace ENI2.DetailViewControls namespace ENI2.DetailViewControls
{ {
@ -25,11 +27,18 @@ namespace ENI2.DetailViewControls
public partial class PortNotificationDetailControl : DetailBaseControl public partial class PortNotificationDetailControl : DetailBaseControl
{ {
#region Fields
private Message _nameMessage; private Message _nameMessage;
private Message _infoMessage; private Message _infoMessage;
private Message _servMessage; private Message _servMessage;
private Message _ladgMessage; private Message _ladgMessage;
private Message _crewaMessage;
private Dictionary<string, string> portAreas = null; private Dictionary<string, string> portAreas = null;
private static List<SERV_Template> _servTemplates = null;
private SERV_Template _currentTemplate;
#endregion
private static readonly string[] shippingAreas = { private static readonly string[] shippingAreas = {
Properties.Resources.textShippingAreaNORTHBALTIC, Properties.Resources.textShippingAreaNORTHBALTIC,
@ -59,7 +68,7 @@ namespace ENI2.DetailViewControls
this.dataGridLADG.CellEditEnding += (obj, ev) => { this.OnNotificationClassChanged(Message.NotificationClass.LADG); }; this.dataGridLADG.CellEditEnding += (obj, ev) => { this.OnNotificationClassChanged(Message.NotificationClass.LADG); };
} }
public override void Initialize() public override async void Initialize()
{ {
base.Initialize(); base.Initialize();
@ -69,6 +78,7 @@ namespace ENI2.DetailViewControls
if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._infoMessage = aMessage; this.ControlMessages.Add(aMessage); } if (aMessage.MessageNotificationClass == Message.NotificationClass.INFO) { this._infoMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) { this._servMessage = aMessage; this.ControlMessages.Add(aMessage); } if (aMessage.MessageNotificationClass == Message.NotificationClass.SERV) { this._servMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) { this._ladgMessage = aMessage; this.ControlMessages.Add(aMessage); } if (aMessage.MessageNotificationClass == Message.NotificationClass.LADG) { this._ladgMessage = aMessage; this.ControlMessages.Add(aMessage); }
if(aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewaMessage = aMessage;}
} }
#region init NAME #region init NAME
@ -157,14 +167,20 @@ namespace ENI2.DetailViewControls
#endregion #endregion
#region init helper Maersk / SeaGo Field #region init SERV templates
if (this.Core.IsFlagSet(MessageCore.CoreFlags.MAERSK_BHV)) this.comboBoxGroup.SelectedIndex = 1; if(_servTemplates == null)
if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_BHV)) this.comboBoxGroup.SelectedIndex = 2; {
if (this.Core.IsFlagSet(MessageCore.CoreFlags.SEAGO_WHV)) this.comboBoxGroup.SelectedIndex = 3; _servTemplates = await DBManagerAsync.GetSERVTemplatesAsync(); // initial load
if (this.Core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.comboBoxGroup.SelectedIndex = 4; _servTemplates.Sort();
if (this.Core.IsFlagSet(MessageCore.CoreFlags.ELBE_BULK)) this.comboBoxGroup.SelectedIndex = 5; Trace.WriteLine($"{_servTemplates.Count} SERV templates loaded");
if (this.Core.IsFlagSet(MessageCore.CoreFlags.FCT_JUNGE)) this.comboBoxGroup.SelectedIndex = 6; }
this.comboBoxGroup.ItemsSource = _servTemplates;
this.buttonDeleteTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
this.buttonEditTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
this.buttonNewTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
#endregion #endregion
@ -365,157 +381,100 @@ namespace ENI2.DetailViewControls
#endregion #endregion
#region Spezialbalkon für die Gruppenauswahl im Core (Maersk BHV / Seago usw.) #region SERV template event handler
private void comboBoxGroup_SelectionChanged(object sender, SelectionChangedEventArgs e) private void comboBoxGroup_SelectionChanged(object sender, SelectionChangedEventArgs e)
{ {
// clear all if(this.comboBoxGroup.SelectedItem is SERV_Template st)
this.Core.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.HOEGH);
this.Core.SetFlag(false, MessageCore.CoreFlags.ELBE_BULK);
this.Core.SetFlag(false, MessageCore.CoreFlags.FCT_JUNGE);
if (this.comboBoxGroup.SelectedItem == null)
{ {
this.comboBoxGroup.SelectedIndex = 0; this.buttonDeleteTemplate.IsEnabled = true;
DBManager.Instance.Save(this.Core); this.buttonSetTemplate.IsEnabled = true;
this._currentTemplate = st;
} }
else }
private void buttonSetTemplate_Click(object sender, RoutedEventArgs e)
{
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
{ {
DictionaryEntry selectedItem = (DictionaryEntry)this.comboBoxGroup.SelectedItem; bool found = false;
if (Int32.TryParse((string)selectedItem.Value, out int selectedValue)) foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
{ {
if (selectedValue == (int)MessageCore.CoreFlags.MAERSK_BHV) CheckServiceEntryMaerskBHV(); if (serv.ServiceName.Equals(st.ServiceName))
if (selectedValue == (int)MessageCore.CoreFlags.SEAGO_BHV) CheckServiceEntrySeaGoBHV(); {
if (selectedValue == (int)MessageCore.CoreFlags.HOEGH) CheckServiceEntryHoegh(); found = true; break;
if (selectedValue == (int)MessageCore.CoreFlags.ELBE_BULK) CheckServiceEntryElbeBulk(); }
if (selectedValue == (int)MessageCore.CoreFlags.FCT_JUNGE) CheckServiceEntryFctJunge(); }
this.Core.SetFlag(true, (MessageCore.CoreFlags)selectedValue);
DBManager.Instance.Save(this.Core); if (!found)
{
SERV newServ = new SERV();
newServ.ServiceName = st.ServiceName;
newServ.ServiceBeneficiary = st.ServiceBeneficiary;
newServ.ServiceInvoiceRecipient = st.ServiceInvoiceRecipient;
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
}
private void buttonNewTemplate_Click(object sender, RoutedEventArgs e)
{
SERV_Template newTemplate = new SERV_Template();
EditSERVDialog esd = new EditSERVDialog();
esd.AddVisible = false;
esd.SERV_Template = newTemplate;
if(esd.ShowDialog() ?? false)
{
_ = DBManagerAsync.SaveAsync(esd.SERV_Template);
this.comboBoxGroup.ItemsSource = null;
_servTemplates.Add(newTemplate);
_servTemplates.Sort();
this.comboBoxGroup.ItemsSource = _servTemplates;
}
}
private void buttonEditTemplate_Click(object sender, RoutedEventArgs e)
{
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
{
EditSERVDialog editSERVDialog = new EditSERVDialog();
editSERVDialog.AddVisible = false;
editSERVDialog.SERV_Template = st;
if (editSERVDialog.ShowDialog() ?? false)
{
_ = DBManagerAsync.SaveAsync(st);
this.comboBoxGroup.ItemsSource = null;
_servTemplates.Sort();
this.comboBoxGroup.ItemsSource = _servTemplates;
}
}
}
private void buttonDeleteTemplate_Click(object sender, RoutedEventArgs e)
{
if (_currentTemplate != null)
{
if (MessageBox.Show("Delete this template?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
this.comboBoxGroup.SelectedItem = null;
this.comboBoxGroup.ItemsSource = null;
_ = DBManagerAsync.DeleteAsync(_currentTemplate);
_servTemplates.Remove(_currentTemplate);
this.buttonDeleteTemplate.IsEnabled = false;
this.comboBoxGroup.ItemsSource = _servTemplates;
this.buttonSetTemplate.IsEnabled = false;
} }
} }
} }
#endregion #endregion
#region special entry ship service check #region other event handler
private void CheckServiceEntryMaerskBHV()
{
bool found = false;
foreach(SERV serv in _servMessage.Elements.Cast<SERV>())
{
if (serv.ServiceBeneficiary.Equals("Maersk A/S, Esplanaden 50, DK-1263 Copenhagen K, VAT-ID: DK53139655"))
found = true;
}
if(!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "Maersk A/S, Esplanaden 50, DK-1263 Copenhagen K, VAT-ID: DK53139655";
newServ.ServiceInvoiceRecipient = "Maersk Deutschland A/S & Co.KG, Johanniswall 7, 20095 Hamburg";
newServ.ServiceName = "Maersk BHV";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void CheckServiceEntrySeaGoBHV()
{
bool found = false;
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
{
if (serv.ServiceBeneficiary.Equals("Sealand Europe A/S, Dampfaergevej 10, 3.tv, DK- 2100 Copenhagen, VAT-ID: DK53139655"))
found = true;
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "Sealand Europe A/S, Dampfaergevej 10, 3.tv, DK- 2100 Copenhagen, VAT-ID: DK53139655";
newServ.ServiceInvoiceRecipient = "Maersk Deutschland A/S & Co. KG on behalf of Sealand Europe A/S, Johanniswall 7, 20095 Hamburg";
newServ.ServiceName = "SeaGo BHV";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void CheckServiceEntryHoegh()
{
bool found = false;
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
{
if (serv.ServiceBeneficiary.Equals("Höegh Autoliners AS, Oslo, Norway"))
found = true;
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "Höegh Autoliners AS, Oslo, Norway";
newServ.ServiceInvoiceRecipient = " PWL Port Services GmbH & Co. KG";
newServ.ServiceName = "HOEGH BHV";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void CheckServiceEntryFctJunge()
{
bool found = false;
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
{
if (serv.ServiceName.Equals("Fct Junge - Hamburg"))
found = true;
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "";
newServ.ServiceInvoiceRecipient = " Frachtcontor Junge & Co. GmbH";
newServ.ServiceName = "Fct Junge - Hamburg";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void CheckServiceEntryElbeBulk()
{
bool found = false;
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
{
if (serv.ServiceName.Equals("Elbe Bulk Schiffe - Hamburg"))
found = true;
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceBeneficiary = "";
newServ.ServiceInvoiceRecipient = " Division Elbe Bulk, Frachtcontor Junge & Co. GmbH";
newServ.ServiceName = "Elbe Bulk Schiffe - Hamburg";
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
private void buttonSearchPortArea_Click(object sender, RoutedEventArgs e) private void buttonSearchPortArea_Click(object sender, RoutedEventArgs e)
{ {
@ -536,16 +495,28 @@ namespace ENI2.DetailViewControls
} }
} }
private void buttonCopyNameFromCREWA_Click(object sender, RoutedEventArgs e)
{
CREW crewA = null;
if (this._crewaMessage.Elements.Count > 0)
{
crewA = this._crewaMessage.Elements[0] as CREW;
}
SelectCrewMemberDialog scmd = new SelectCrewMemberDialog();
scmd.CREW = crewA;
scmd.AddVisible = false;
if (scmd.ShowDialog() ?? false)
{
this.textBox_NameMaster.Text = $"{crewA.CrewMemberFirstName} {crewA.CrewMemberLastName}";
this.SublistElementChanged(Message.NotificationClass.NAME);
var binding = textBox_NameMaster.GetBindingExpression(TextBox.TextProperty);
binding?.UpdateSource();
}
}
#endregion #endregion
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
}
private void contextMenuClearMaersk_Click(object sender, RoutedEventArgs e)
{
}
} }
} }

View File

@ -18,7 +18,7 @@
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<PublishUrl>eni2.publish\</PublishUrl> <PublishUrl>ENI2.publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>
<InstallFrom>Web</InstallFrom> <InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled> <UpdateEnabled>true</UpdateEnabled>
@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion> <MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision> <ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.2.8.1</ApplicationVersion> <ApplicationVersion>7.2.9.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
@ -137,60 +137,72 @@
<Reference Include="ExcelDataReader, Version=3.7.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL"> <Reference Include="ExcelDataReader, Version=3.7.0.0, Culture=neutral, PublicKeyToken=93517dbe6a4012fa, processorArchitecture=MSIL">
<HintPath>packages\ExcelDataReader.3.7.0\lib\net462\ExcelDataReader.dll</HintPath> <HintPath>packages\ExcelDataReader.3.7.0\lib\net462\ExcelDataReader.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath> <HintPath>packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.4\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath> <HintPath>packages\Microsoft.Bcl.AsyncInterfaces.9.0.6\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=9.0.0.4, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Bcl.Cryptography, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.9.0.4\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath> <HintPath>packages\Microsoft.Bcl.Cryptography.9.0.6\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.4, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.DependencyInjection, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.4\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath> <HintPath>packages\Microsoft.Extensions.DependencyInjection.9.0.6\lib\net462\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Logging, Version=9.0.0.4, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.9.0.4\lib\net462\Microsoft.Extensions.Logging.dll</HintPath> <HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.9.0.6\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=9.0.0.4, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Logging, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.9.0.4\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath> <HintPath>packages\Microsoft.Extensions.Logging.9.0.6\lib\net462\Microsoft.Extensions.Logging.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Options, Version=9.0.0.4, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Options.9.0.4\lib\net462\Microsoft.Extensions.Options.dll</HintPath> <HintPath>packages\Microsoft.Extensions.Logging.Abstractions.9.0.6\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=9.0.0.4, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL"> <Reference Include="Microsoft.Extensions.Options, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Primitives.9.0.4\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath> <HintPath>packages\Microsoft.Extensions.Options.9.0.6\lib\net462\Microsoft.Extensions.Options.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=9.0.0.6, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Primitives.9.0.6\lib\net462\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL"> <Reference Include="Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath> <HintPath>packages\Microsoft.Office.Interop.Excel.15.0.4795.1001\lib\net20\Microsoft.Office.Interop.Excel.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="MigraDoc.DocumentObjectModel, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="MigraDoc.DocumentObjectModel, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\MigraDoc.DocumentObjectModel.dll</HintPath> <HintPath>packages\PDFsharp-MigraDoc.6.2.0\lib\netstandard2.0\MigraDoc.DocumentObjectModel.dll</HintPath>
</Reference> </Reference>
<Reference Include="MigraDoc.Rendering, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="MigraDoc.Rendering, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\MigraDoc.Rendering.dll</HintPath> <HintPath>packages\PDFsharp-MigraDoc.6.2.0\lib\netstandard2.0\MigraDoc.Rendering.dll</HintPath>
</Reference> </Reference>
<Reference Include="MigraDoc.RtfRendering, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="MigraDoc.RtfRendering, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\MigraDoc.RtfRendering.dll</HintPath> <HintPath>packages\PDFsharp-MigraDoc.6.2.0\lib\netstandard2.0\MigraDoc.RtfRendering.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="PdfSharp, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\PdfSharp.dll</HintPath> <HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp.Charting, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="PdfSharp.BarCodes, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\PdfSharp.Charting.dll</HintPath> <HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.BarCodes.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp.Quality, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="PdfSharp.Charting, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\PdfSharp.Quality.dll</HintPath> <HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Charting.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp.Snippets, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="PdfSharp.Cryptography, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\PdfSharp.Snippets.dll</HintPath> <HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Cryptography.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp.System, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="PdfSharp.Quality, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\PdfSharp.System.dll</HintPath> <HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Quality.dll</HintPath>
</Reference> </Reference>
<Reference Include="PdfSharp.WPFonts, Version=6.1.1.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL"> <Reference Include="PdfSharp.Shared, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp-MigraDoc.6.1.1\lib\netstandard2.0\PdfSharp.WPFonts.dll</HintPath> <HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Shared.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.Snippets, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.Snippets.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.System, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.System.dll</HintPath>
</Reference>
<Reference Include="PdfSharp.WPFonts, Version=6.2.0.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb, processorArchitecture=MSIL">
<HintPath>packages\PDFsharp.6.2.0\lib\netstandard2.0\PdfSharp.WPFonts.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
@ -202,10 +214,13 @@
<Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath> <HintPath>packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.4, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Diagnostics.DiagnosticSource, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Diagnostics.DiagnosticSource.9.0.4\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath> <HintPath>packages\System.Diagnostics.DiagnosticSource.9.0.6\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Formats.Asn1, Version=9.0.0.6, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Formats.Asn1.9.0.6\lib\net462\System.Formats.Asn1.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath> <HintPath>packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
@ -218,6 +233,10 @@
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath> <HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security" />
<Reference Include="System.Security.Cryptography.Pkcs, Version=9.0.0.6, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Security.Cryptography.Pkcs.9.0.6\lib\net462\System.Security.Cryptography.Pkcs.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.ServiceModel.Web" /> <Reference Include="System.ServiceModel.Web" />
<Reference Include="System.ServiceProcess" /> <Reference Include="System.ServiceProcess" />
@ -308,6 +327,9 @@
<Compile Include="EditControls\NewDGItemDialog.xaml.cs"> <Compile Include="EditControls\NewDGItemDialog.xaml.cs">
<DependentUpon>NewDGItemDialog.xaml</DependentUpon> <DependentUpon>NewDGItemDialog.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="EditControls\SelectCrewMemberDialog.xaml.cs">
<DependentUpon>SelectCrewMemberDialog.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\SelectPortAreaDialog.xaml.cs"> <Compile Include="EditControls\SelectPortAreaDialog.xaml.cs">
<DependentUpon>SelectPortAreaDialog.xaml</DependentUpon> <DependentUpon>SelectPortAreaDialog.xaml</DependentUpon>
</Compile> </Compile>
@ -793,6 +815,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="EditControls\SelectCrewMemberDialog.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="EditControls\SelectImportClassesDialog.xaml"> <Page Include="EditControls\SelectImportClassesDialog.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -1021,6 +1047,7 @@
<Content Include="Report\Logo.png"> <Content Include="Report\Logo.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Resource Include="Resources\pencil.png" />
<Content Include="x64\SQLite.Interop.dll"> <Content Include="x64\SQLite.Interop.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>

View File

@ -1,5 +1,5 @@
// Copyright (c) 2017 schick Informatik // Copyright (c) 2017 schick Informatik
// Description: // Description: Edit SERV and SERV_template entities
// //
using System.Windows; using System.Windows;
@ -14,36 +14,78 @@ namespace ENI2.EditControls
/// </summary> /// </summary>
public partial class EditSERVDialog : EditWindowBase public partial class EditSERVDialog : EditWindowBase
{ {
#region Construction
public EditSERVDialog() public EditSERVDialog()
{ {
InitializeComponent(); InitializeComponent();
Loaded += EditSERVDialog_Loaded; Loaded += EditSERVDialog_Loaded;
} }
#endregion
#region Properties
public SERV SERV { get; set; }
public SERV_Template SERV_Template { get; set; }
#endregion
#region event handler
private void EditSERVDialog_Loaded(object sender, RoutedEventArgs e) private void EditSERVDialog_Loaded(object sender, RoutedEventArgs e)
{ {
this.OKClicked += EditSERVDialog_OKClicked; this.OKClicked += EditSERVDialog_OKClicked;
// copy into fields // copy into fields
this.textBoxServiceName.Text = this.SERV.ServiceName; if (this.SERV != null)
this.textBoxServiceBeneficiary.Text = this.SERV.ServiceBeneficiary; {
this.textBoxServiceInvoiceRecipient.Text = this.SERV.ServiceInvoiceRecipient; this.textBoxServiceName.Text = this.SERV.ServiceName;
this.AddVisible = true; this.textBoxServiceBeneficiary.Text = this.SERV.ServiceBeneficiary;
} this.textBoxServiceInvoiceRecipient.Text = this.SERV.ServiceInvoiceRecipient;
this.AddVisible = true;
}
public void CopyValuesToEntity() if (this.SERV_Template != null)
{ {
// copy back this.textBoxServiceName.Text = this.SERV_Template.ServiceName;
this.SERV.ServiceName = this.textBoxServiceName.Text.Trim(); this.textBoxServiceBeneficiary.Text = this.SERV_Template.ServiceBeneficiary;
this.SERV.ServiceBeneficiary = this.textBoxServiceBeneficiary.Text.Trim(); this.textBoxServiceInvoiceRecipient.Text = this.SERV_Template.ServiceInvoiceRecipient;
this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim(); }
} }
private void EditSERVDialog_OKClicked() private void EditSERVDialog_OKClicked()
{ {
this.CopyValuesToEntity(); this.CopyValuesToEntity();
} }
public SERV SERV { get; set; } #endregion
#region public methods
public void CopyValuesToEntity()
{
if (this.SERV != null)
{
// copy back
this.SERV.ServiceName = this.textBoxServiceName.Text.Trim();
this.SERV.ServiceBeneficiary = this.textBoxServiceBeneficiary.Text.Trim();
this.SERV.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
}
if (this.SERV_Template != null)
{
// copy back
this.SERV_Template.ServiceName = this.textBoxServiceName.Text.Trim();
this.SERV_Template.ServiceBeneficiary = this.textBoxServiceBeneficiary.Text.Trim();
this.SERV_Template.ServiceInvoiceRecipient = this.textBoxServiceInvoiceRecipient.Text.Trim();
}
}
#endregion
} }
} }

View File

@ -0,0 +1,32 @@
<enictrl:EditWindowBase x:Class="ENI2.EditControls.SelectCrewMemberDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d"
Title="{x:Static p:Resources.textSelectCrewMember}" Height="160" Width="400" Background="AliceBlue">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width=".5*" />
<ColumnDefinition Width=".5*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textLastName}" />
<Label Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textFirstName}" />
<Label Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textCrewFunctionOnBoard}" />
<TextBlock Text="{Binding CrewMemberLastName}" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" />
<TextBlock Text="{Binding CrewMemberFirstName}" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" />
<TextBlock Text="{Binding CrewMemberDuty}" Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" />
</Grid>
</enictrl:EditWindowBase>

View File

@ -0,0 +1,41 @@
// Copyright (c) 2017- schick Informatik
// Description:
//
using bsmd.database;
using ENI2.Controls;
using System.Windows;
namespace ENI2.EditControls
{
/// <summary>
/// Interaction logic for SelectCrewMemberDialog.xaml
/// </summary>
public partial class SelectCrewMemberDialog : EditWindowBase
{
public SelectCrewMemberDialog()
{
InitializeComponent();
Loaded += SelectCrewMemberDialog_Loaded;
}
#region Properties
public CREW CREW { get; set; }
#endregion
#region event handler
private void SelectCrewMemberDialog_Loaded(object sender, RoutedEventArgs e)
{
if (CREW != null)
{
this.DataContext = CREW;
}
}
#endregion
}
}

View File

@ -750,6 +750,16 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap pencil {
get {
object obj = ResourceManager.GetObject("pencil", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>
@ -2011,7 +2021,7 @@ namespace ENI2.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Columns &quot;o&quot; of OBC Code (value 15.19). /// Looks up a localized string similar to Columns &quot;o&quot; of IBC Code (value 15.19).
/// </summary> /// </summary>
public static string textColumsOfIBC { public static string textColumsOfIBC {
get { get {
@ -2253,6 +2263,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Copy from CREWA.
/// </summary>
public static string textCopyFromCREWA {
get {
return ResourceManager.GetString("textCopyFromCREWA", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Copy from last 10 port facilities called. /// Looks up a localized string similar to Copy from last 10 port facilities called.
/// </summary> /// </summary>
@ -5259,6 +5278,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Select crew member.
/// </summary>
public static string textSelectCrewMember {
get {
return ResourceManager.GetString("textSelectCrewMember", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Select classes to import. /// Looks up a localized string similar to Select classes to import.
/// </summary> /// </summary>
@ -5358,6 +5386,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to SERV-Template.
/// </summary>
public static string textSERVTemplate {
get {
return ResourceManager.GetString("textSERVTemplate", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Ship-to-ship activity. /// Looks up a localized string similar to Ship-to-ship activity.
/// </summary> /// </summary>

View File

@ -2233,4 +2233,16 @@
<data name="textSECSimplification" xml:space="preserve"> <data name="textSECSimplification" xml:space="preserve">
<value>SEC simplification available</value> <value>SEC simplification available</value>
</data> </data>
<data name="textCopyFromCREWA" xml:space="preserve">
<value>Copy from CREWA</value>
</data>
<data name="textSelectCrewMember" xml:space="preserve">
<value>Select crew member</value>
</data>
<data name="textSERVTemplate" xml:space="preserve">
<value>SERV-Template</value>
</data>
<data name="pencil" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

BIN
ENI2/Resources/pencil.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -30,6 +30,7 @@
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textNameMaster}" Name="label_nameMaster" Margin="0,0,10,0"/>
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" /> <TextBox Grid.Row="0" Grid.Column="1" Name="textBox_NameMaster" MaxLength="100" Margin="2" Text="{Binding NameOfMaster, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center" />
<Button Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textCopyFromCREWA}" Margin="2" Width="120" HorizontalAlignment="Left" x:Name="buttonCopyFromCrewA" Click="buttonCopyFromCrewA_Click" />
<Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/> <Label Name="labelCrewNotificationSchengen" Content="{x:Static p:Resources.textNotificationSchengen}" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right"/>
<CheckBox Name="checkBoxCrewNotificationSchengen" Grid.Row="1" Grid.Column="1" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/> <CheckBox Name="checkBoxCrewNotificationSchengen" Grid.Row="1" Grid.Column="1" IsThreeState="False" VerticalAlignment="Center" Margin="10,0,0,0" Click="checkBoxCrewNotificationSchengen_Click"/>
<Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" /> <Label Name="labelCrewNotificationPAX" Content="{x:Static p:Resources.textNotificationPAX}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" />

View File

@ -233,6 +233,28 @@ namespace ENI2.SheetDisplayControls
} }
} }
private void buttonCopyFromCrewA_Click(object sender, RoutedEventArgs e)
{
CREW crewA = null;
if (this._crewaMessage.Elements.Count > 0)
{
crewA = this._crewaMessage.Elements[0] as CREW;
}
SelectCrewMemberDialog scmd = new SelectCrewMemberDialog();
scmd.CREW = crewA;
scmd.AddVisible = false;
if (scmd.ShowDialog() ?? false)
{
this.textBox_NameMaster.Text = $"{crewA.CrewMemberFirstName} {crewA.CrewMemberLastName}";
this.SublistElementChanged(Message.NotificationClass.NAME);
var binding = textBox_NameMaster.GetBindingExpression(TextBox.TextProperty);
binding?.UpdateSource();
}
}
#endregion #endregion
#region crew grid arrival #region crew grid arrival
@ -378,8 +400,10 @@ namespace ENI2.SheetDisplayControls
} }
} }
#endregion
#endregion
} }
} }

View File

@ -178,8 +178,40 @@
<TextBox Grid.Row="12" Grid.Column="1" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/> <TextBox Grid.Row="12" Grid.Column="1" Name="textBox_AgentFirstName" MaxLength="99" Margin="2" Text="{Binding AgentFirstName, Converter={util:TrimStringConverter}}" VerticalContentAlignment="Center"/>
<TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text24Invoice}" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/> <TextBlock FontSize="18" VerticalAlignment="Bottom" Text="{x:Static p:Resources.text24Invoice}" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/>
<Label HorizontalContentAlignment="Right" Grid.Row="14" Grid.Column="0" Content="{x:Static p:Resources.textMaerskSeago}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/> <Label HorizontalContentAlignment="Right" Grid.Row="14" Grid.Column="0" Content="{x:Static p:Resources.textSERVTemplate}" Name="label_MaerskSeaGo" VerticalContentAlignment="Center" Margin="0,0,10,0"/>
<ComboBox Grid.Row="14" Grid.Column="1" x:Name="comboBoxGroup" Margin="2" ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value" SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" /> <ComboBox Grid.Row="14" Grid.Column="1" x:Name="comboBoxGroup" DisplayMemberPath="ServiceName" Margin="2" SelectionChanged="comboBoxGroup_SelectionChanged" ContextMenu="{DynamicResource ClearContextMenu}" />
<Grid Grid.Row="14" Grid.Column="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="26" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Name="buttonSetSERVTemplate" Margin="2" Click="buttonSetSERVTemplate_Click" BorderThickness="0" Background="Transparent" Grid.Column="0"
ToolTip="Apply template" HorizontalContentAlignment="Right" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/check.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonEditSERVTemplate" Grid.Column="2" Grid.Row="0" Margin="2" Click="buttonEditSERVTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Edit template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/pencil.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonNewSERVTemplate" Grid.Column="3" Grid.Row="0" Margin="2" Click="buttonNewSERVTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="New template">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/document_plain_new.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
<Button Name="buttonDeleteSERVTemplate" Grid.Column="4" Grid.Row="0" Margin="2" Click="buttonDeleteSERVTemplate_Click" BorderThickness="0" Background="Transparent" ToolTip="Delete template" IsEnabled="False">
<StackPanel Orientation="Horizontal">
<Image Source="../Resources/delete.png" Margin="0,0,0,0" Height="20" Width="20" />
</StackPanel>
</Button>
</Grid>
<GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="3"> <GroupBox Name="servGroupBox" Header="{x:Static p:Resources.textServ}" Grid.Row="15" Grid.Column="0" Grid.ColumnSpan="3">
<enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid x:Name="dataGridSERV" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0"> AutoGenerateColumns="False" Margin="0,5,0,0">

View File

@ -34,7 +34,7 @@ namespace ENI2.SheetDisplayControls
private SEC _sec; private SEC _sec;
private WAS _was; private WAS _was;
private Message _stoMessage; private Message _stoMessage;
private Message _crewMessage; // private Message _crewMessage;
private Dictionary<string, string> portAreas = null; private Dictionary<string, string> portAreas = null;
@ -42,6 +42,9 @@ namespace ENI2.SheetDisplayControls
private AGNT_Template _currentTemplate; private AGNT_Template _currentTemplate;
private AGNT_Template _undoTemplate; private AGNT_Template _undoTemplate;
private static List<SERV_Template> _servTemplates = null;
private SERV_Template _currentSERVTemplate;
private static List<WasteDisposalServiceProvider_Template> _wsdpTemplates = null; private static List<WasteDisposalServiceProvider_Template> _wsdpTemplates = null;
private WasteDisposalServiceProvider_Template _currentWSDPTemplate; private WasteDisposalServiceProvider_Template _currentWSDPTemplate;
private string _undoWSDPTemplate; private string _undoWSDPTemplate;
@ -90,7 +93,7 @@ namespace ENI2.SheetDisplayControls
if (aMessage.MessageNotificationClass == Message.NotificationClass.AGNT) { this._agnt = aMessage.Elements[0] as AGNT; this.ControlMessages.Add(aMessage); } if (aMessage.MessageNotificationClass == Message.NotificationClass.AGNT) { this._agnt = aMessage.Elements[0] as AGNT; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) { this._was = aMessage.Elements[0] as WAS; this.ControlMessages.Add(aMessage); } if (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) { this._was = aMessage.Elements[0] as WAS; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.STO) { this._stoMessage = aMessage; this.ControlMessages.Add(aMessage); } if (aMessage.MessageNotificationClass == Message.NotificationClass.STO) { this._stoMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewMessage = aMessage; this.ControlMessages.Add(aMessage); } // if (aMessage.MessageNotificationClass == Message.NotificationClass.CREWA) { this._crewMessage = aMessage; this.ControlMessages.Add(aMessage); }
} }
// 2.1 // 2.1
@ -202,6 +205,23 @@ namespace ENI2.SheetDisplayControls
// this.dataGridEffects.Initialize(); // this.dataGridEffects.Initialize();
// this.dataGridEffects.ItemsSource = _crewMessage.Elements; // this.dataGridEffects.ItemsSource = _crewMessage.Elements;
#region init SERV templates
if (_servTemplates == null)
{
_servTemplates = await DBManagerAsync.GetSERVTemplatesAsync(); // initial load
_servTemplates.Sort();
Trace.WriteLine($"{_servTemplates.Count} SERV templates loaded");
}
this.comboBoxGroup.ItemsSource = _servTemplates;
this.buttonDeleteSERVTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
this.buttonEditSERVTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
this.buttonNewSERVTemplate.Visibility = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsEditor ? Visibility.Visible : Visibility.Hidden;
#endregion
} }
public override int SelectedTabIndex public override int SelectedTabIndex
@ -578,37 +598,6 @@ namespace ENI2.SheetDisplayControls
} }
} }
private void comboBoxGroup_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// clear all
this.Core.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
this.Core.SetFlag(false, MessageCore.CoreFlags.HOEGH);
this.Core.SetFlag(false, MessageCore.CoreFlags.ELBE_BULK);
this.Core.SetFlag(false, MessageCore.CoreFlags.FCT_JUNGE);
if (this.comboBoxGroup.SelectedItem == null)
{
this.comboBoxGroup.SelectedIndex = 0;
DBManager.Instance.Save(this.Core);
}
else
{
DictionaryEntry selectedItem = (DictionaryEntry)this.comboBoxGroup.SelectedItem;
if (Int32.TryParse((string)selectedItem.Value, out int selectedValue))
{
if (selectedValue == (int)MessageCore.CoreFlags.MAERSK_BHV) CheckServiceEntryMaerskBHV();
if (selectedValue == (int)MessageCore.CoreFlags.SEAGO_BHV) CheckServiceEntrySeaGoBHV();
if (selectedValue == (int)MessageCore.CoreFlags.HOEGH) CheckServiceEntryHoegh();
if (selectedValue == (int)MessageCore.CoreFlags.ELBE_BULK) CheckServiceEntryElbeBulk();
if (selectedValue == (int)MessageCore.CoreFlags.FCT_JUNGE) CheckServiceEntryFctJunge();
this.Core.SetFlag(true, (MessageCore.CoreFlags)selectedValue);
DBManager.Instance.Save(this.Core);
}
}
}
#endregion #endregion
#region special entry ship service check #region special entry ship service check
@ -1149,5 +1138,98 @@ namespace ENI2.SheetDisplayControls
#endregion #endregion
#region SERV template button event handler
private void comboBoxGroup_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
{
this.buttonDeleteSERVTemplate.IsEnabled = true;
this.buttonSetSERVTemplate.IsEnabled = true;
this._currentSERVTemplate = st;
}
}
private void buttonSetSERVTemplate_Click(object sender, RoutedEventArgs e)
{
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
{
bool found = false;
foreach (SERV serv in _servMessage.Elements.Cast<SERV>())
{
if (serv.ServiceName.Equals(st.ServiceName))
{
found = true; break;
}
}
if (!found)
{
SERV newServ = new SERV();
newServ.ServiceName = st.ServiceName;
newServ.ServiceBeneficiary = st.ServiceBeneficiary;
newServ.ServiceInvoiceRecipient = st.ServiceInvoiceRecipient;
newServ.MessageHeader = this._servMessage;
newServ.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this._servMessage.Elements.Add(newServ);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}
}
private void buttonEditSERVTemplate_Click(object sender, RoutedEventArgs e)
{
if (this.comboBoxGroup.SelectedItem is SERV_Template st)
{
EditSERVDialog editSERVDialog = new EditSERVDialog();
editSERVDialog.AddVisible = false;
editSERVDialog.SERV_Template = st;
if (editSERVDialog.ShowDialog() ?? false)
{
_ = DBManagerAsync.SaveAsync(st);
this.comboBoxGroup.ItemsSource = null;
_servTemplates.Sort();
this.comboBoxGroup.ItemsSource = _servTemplates;
}
}
}
private void buttonNewSERVTemplate_Click(object sender, RoutedEventArgs e)
{
SERV_Template newTemplate = new SERV_Template();
EditSERVDialog esd = new EditSERVDialog();
esd.AddVisible = false;
esd.SERV_Template = newTemplate;
if (esd.ShowDialog() ?? false)
{
_ = DBManagerAsync.SaveAsync(esd.SERV_Template);
this.comboBoxGroup.ItemsSource = null;
_servTemplates.Add(newTemplate);
_servTemplates.Sort();
this.comboBoxGroup.ItemsSource = _servTemplates;
}
}
private void buttonDeleteSERVTemplate_Click(object sender, RoutedEventArgs e)
{
if (_currentSERVTemplate != null)
{
if (MessageBox.Show("Delete this template?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes)
{
this.comboBoxGroup.SelectedItem = null;
this.comboBoxGroup.ItemsSource = null;
_ = DBManagerAsync.DeleteAsync(_currentTemplate);
_servTemplates.Remove(_currentSERVTemplate);
this.buttonDeleteSERVTemplate.IsEnabled = false;
this.comboBoxGroup.ItemsSource = _servTemplates;
this.buttonSetSERVTemplate.IsEnabled = false;
}
}
}
#endregion
} }
} }

View File

@ -2,23 +2,27 @@
<packages> <packages>
<package id="ExcelDataReader" version="3.7.0" targetFramework="net48" /> <package id="ExcelDataReader" version="3.7.0" targetFramework="net48" />
<package id="Extended.Wpf.Toolkit" version="4.7.25104.5739" targetFramework="net48" /> <package id="Extended.Wpf.Toolkit" version="4.7.25104.5739" targetFramework="net48" />
<package id="log4net" version="3.0.4" targetFramework="net48" /> <package id="log4net" version="3.1.0" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Bcl.AsyncInterfaces" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Bcl.Cryptography" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Extensions.DependencyInjection" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Extensions.Logging" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Options" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Extensions.Logging.Abstractions" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Primitives" version="9.0.4" targetFramework="net48" /> <package id="Microsoft.Extensions.Options" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Extensions.Primitives" version="9.0.6" targetFramework="net48" />
<package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net48" /> <package id="Microsoft.Office.Interop.Excel" version="15.0.4795.1001" targetFramework="net48" />
<package id="PDFsharp-MigraDoc" version="6.1.1" targetFramework="net48" /> <package id="PDFsharp" version="6.2.0" targetFramework="net48" />
<package id="PDFsharp-MigraDoc" version="6.2.0" targetFramework="net48" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.119.0" targetFramework="net48" /> <package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.119.0" targetFramework="net48" />
<package id="System.Buffers" version="4.6.1" targetFramework="net48" /> <package id="System.Buffers" version="4.6.1" targetFramework="net48" />
<package id="System.Data.SQLite.Core" version="1.0.119.0" targetFramework="net48" /> <package id="System.Data.SQLite.Core" version="1.0.119.0" targetFramework="net48" />
<package id="System.Diagnostics.DiagnosticSource" version="9.0.4" targetFramework="net48" /> <package id="System.Diagnostics.DiagnosticSource" version="9.0.6" targetFramework="net48" />
<package id="System.Formats.Asn1" version="9.0.6" targetFramework="net48" />
<package id="System.Memory" version="4.6.3" targetFramework="net48" /> <package id="System.Memory" version="4.6.3" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" /> <package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" /> <package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" />
<package id="System.Security.Cryptography.Pkcs" version="9.0.6" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" /> <package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" />
<package id="System.ValueTuple" version="4.6.1" targetFramework="net48" /> <package id="System.ValueTuple" version="4.6.1" targetFramework="net48" />
</packages> </packages>

25
SQL/SERV_template.sql Normal file
View File

@ -0,0 +1,25 @@
PRINT N'Creating [dbo].[SERV_template]...';
GO
CREATE TABLE [dbo].[SERV_template] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[ServiceName] NVARCHAR (100) NULL,
[ServiceBeneficiary] NVARCHAR (256) NULL,
[ServiceInvoiceRecipient] NVARCHAR (256) NULL,
[Created] DATETIME NULL DEFAULT CURRENT_TIMESTAMP,
[Changed] DATETIME NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
GO
CREATE TRIGGER SERV_template_Trigger_Change_Log
ON
dbo.SERV_template
FOR UPDATE
AS
SET NOCOUNT ON
IF NOT UPDATE([Changed])
UPDATE SERV_template SET [Changed] = GETDATE() WHERE Id IN (SELECT Id FROM [inserted])
GO

View File

@ -46,8 +46,8 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath> <HintPath>..\ENI2\packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="3.0.4" targetFramework="net48" /> <package id="log4net" version="3.1.0" targetFramework="net48" />
</packages> </packages>

View File

@ -1,36 +1,72 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="bsmd.Tool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="bsmd.Tool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<log4net> <log4net>
<root> <root>
<level value="DEBUG"/> <level value="DEBUG" />
<appender-ref ref="LogFileAppender"/> <appender-ref ref="LogFileAppender" />
</root> </root>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">
<param name="File" value="log.bsmd.Tool.txt"/> <param name="File" value="log.bsmd.Tool.txt" />
<param name="AppendToFile" value="true"/> <param name="AppendToFile" value="true" />
<rollingStyle value="Size"/> <rollingStyle value="Size" />
<maxSizeRollBackups value="10"/> <maxSizeRollBackups value="10" />
<maximumFileSize value="10MB"/> <maximumFileSize value="10MB" />
<staticLogFileName value="true"/> <staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%date [%thread] %-5level [%logger] - %message%newline"/> <param name="ConversionPattern" value="%date [%thread] %-5level [%logger] - %message%newline" />
</layout> </layout>
</appender> </appender>
</log4net> </log4net>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup> </startup>
<userSettings> <runtime>
<bsmd.Tool.Properties.Settings> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<setting name="ConnectionString" serializeAs="String"> <dependentAssembly>
<value>replace me!</value> <assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
</setting> <bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
</bsmd.Tool.Properties.Settings> </dependentAssembly>
</userSettings> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<applicationSettings>
<bsmd.Tool.Properties.Settings>
<setting name="ConnectionString" serializeAs="String">
<value>replace me!</value>
</setting>
<setting name="EcholotOutputFolder" serializeAs="String">
<value />
</setting>
<setting name="EcholotMaxThreads" serializeAs="String">
<value>4</value>
</setting>
<setting name="HISNORD_Folder" serializeAs="String">
<value>C:\temp\hisnord</value>
</setting>
<setting name="DBH_Folder" serializeAs="String">
<value>C:\temp\dbh</value>
</setting>
</bsmd.Tool.Properties.Settings>
</applicationSettings>
</configuration> </configuration>

224
bsmd.Tool/Echolot.cs Normal file
View File

@ -0,0 +1,224 @@
// Copyright (c) 2020- schick Informatik
// Description: The purpose of this tool is to evaluate files sent both through HIS-Nord and dbh
// to evaluate how many classes were sent at what time and by whom to the purpose of improved employee
// time planning
using ClosedXML.Excel;
using log4net;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace bsmd.Tool
{
internal static class Echolot
{
private static readonly ILog _log = LogManager.GetLogger(typeof(Echolot));
static readonly HashSet<string> ValidGroupingKeys = new HashSet<string>
{
"VISIT",
"TRANSIT",
"NOA_NOD",
"NOANOD",
"ATA",
"ATD",
"SEC",
"POBA",
"POBD",
"NAME",
"TIEFA",
"TIEFD",
"BKRA",
"BKRD",
"STAT",
"LADG",
"INFO",
"SERV",
"PRE72H",
"MDH",
"WAS",
"CREWA",
"PASA",
"BPOL",
"TOWA",
"TOWD",
"HAZA",
"HAZD",
"AGNT",
"STO",
"CREWD",
"PASD",
"WAS_RCPT"
};
static readonly HashSet<string> IgnoreGroupingKeys = new HashSet<string>
{
"VISIT",
"TRANSIT",
"ATA",
"ATD"
};
internal static void Evaluate(string outputFolder, int maxThreads)
{
DateTime executionTime = DateTime.Now;
#region first scan: dbh files
string inputFolder = Properties.Settings.Default.DBH_Folder;
var files = Directory.GetFiles(inputFolder, "*.xml");
var results = new ConcurrentBag<ResultRow>();
Parallel.ForEach(files, new ParallelOptions { MaxDegreeOfParallelism = maxThreads }, file =>
{
try
{
var doc = XDocument.Load(file);
// Look for a valid grouping key at the root level
var groupingElem = doc.Root.Elements()
.FirstOrDefault(x => ValidGroupingKeys.Contains(x.Name.LocalName) && !IgnoreGroupingKeys.Contains(x.Name.LocalName));
if (groupingElem == null)
{
_log.InfoFormat("skipping {0}", file);
return; // Skip file
}
var lastName = doc.Descendants("RPLastName").FirstOrDefault()?.Value?.Trim();
var firstName = doc.Descendants("RPFirstName").FirstOrDefault()?.Value?.Trim();
var timestampStr = doc.Descendants("Timestamp").FirstOrDefault()?.Value?.Trim();
DateTime timestamp = DateTime.Parse(timestampStr);
results.Add(new ResultRow
{
FirstName = firstName,
LastName = lastName,
Timestamp = timestamp,
WeekStart = GetWeekStart(timestamp, executionTime.DayOfWeek),
Provider = "DBH"
});
}
catch (Exception ex)
{
_log.Error(ex.ToString());
}
});
#endregion
#region second scan: his-nord files
var inputFolder2 = Properties.Settings.Default.HISNORD_Folder;
var files2 = Directory.GetFiles(inputFolder2, "*.xml");
Parallel.ForEach(files2, new ParallelOptions { MaxDegreeOfParallelism = maxThreads }, file =>
{
try
{
var doc = XDocument.Load(file);
var match = Regex.Match(file, @"-([A-Z0-9_]+)\.xml$", RegexOptions.None);
string key = "";
if (match.Success)
{
key = match.Groups[1].Value;
}
if((key.Length == 0) || IgnoreGroupingKeys.Contains(key))
{
_log.InfoFormat("skipping {0}", file);
return; // Skip file
}
var username = doc.Descendants("firstname").FirstOrDefault()?.Value?.Trim();
if(username == null)
{
_log.WarnFormat("Username not found in file {0}", file);
return;
}
var splitname = username.Split(' ');
var lastName = splitname[1].Trim();
var firstName = splitname[0].Trim();
DateTime timestamp = File.GetCreationTime(file);
results.Add(new ResultRow
{
FirstName = firstName,
LastName = lastName,
Timestamp = timestamp,
WeekStart = GetWeekStart(timestamp, executionTime.DayOfWeek),
Provider = "HIS-NORD"
});
}
catch (Exception ex)
{
_log.Error(ex.ToString());
}
});
#endregion
var grouped = results
.GroupBy(r => r.WeekStart)
.OrderBy(g => g.Key);
// Write Excel
string excelFile = Path.Combine(outputFolder, $"echolot_{executionTime:yyyyMMdd_HHmmss}.xlsx");
using (var workbook = new XLWorkbook())
{
foreach (var weekGroup in grouped)
{
var ws = workbook.Worksheets.Add(weekGroup.Key.ToString("yyyy-MM-dd"));
ws.Cell(1, 1).Value = "Firstname";
ws.Cell(1, 2).Value = "Lastname";
ws.Cell(1, 3).Value = "Count";
int row = 2;
var orderedGroups = weekGroup
.GroupBy(x => new { x.FirstName, x.LastName })
.OrderByDescending(g => g.Count()); // Use OrderBy for ascending
foreach (var nameGroup in orderedGroups)
{
ws.Cell(row, 1).Value = nameGroup.Key.FirstName;
ws.Cell(row, 2).Value = nameGroup.Key.LastName;
ws.Cell(row, 3).Value = nameGroup.Count();
row++;
}
}
workbook.SaveAs(excelFile);
}
}
static DateTime GetWeekStart(DateTime date, DayOfWeek weekStart)
{
int diff = (7 + (date.DayOfWeek - weekStart)) % 7;
return date.Date.AddDays(-1 * diff);
}
class ResultRow
{
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime Timestamp { get; set; }
public DateTime WeekStart { get; set; }
public string Provider { get; set; }
}
}
}

View File

@ -25,6 +25,18 @@ namespace bsmd.Tool
[Option("locodes", HelpText = "use this flag if you want to import locodes")] [Option("locodes", HelpText = "use this flag if you want to import locodes")]
public bool ImportLocodes { get; set; } public bool ImportLocodes { get; set; }
[Option("echolot", HelpText = "use this flag to run the echolot output file evaluation")]
public bool Echolot { get; set; }
[Option('i', "input_folder", HelpText = "Input folder")]
public string InputFolder { get; set; }
[Option('o', "output_folder", HelpText = "Output folder")]
public string OutputFolder { get; set; }
[Option("max_threads", HelpText = "Maximum amount of parallelism for folder parsing")]
public int? MaxThreads { get; set; }
[Option('s', "staledays", Default = 30, HelpText ="Delete files older than X days")] [Option('s', "staledays", Default = 30, HelpText ="Delete files older than X days")]
public int StaleDays { get; set; } public int StaleDays { get; set; }

View File

@ -1,4 +1,5 @@
using CommandLine; using bsmd.database;
using CommandLine;
using log4net; using log4net;
using System; using System;
@ -40,15 +41,24 @@ namespace bsmd.Tool
LocodeSQliteImport.Import(o.LocodeDB, o.LocodeCSV); LocodeSQliteImport.Import(o.LocodeDB, o.LocodeCSV);
} }
} }
if(o.Echolot)
{
string outputFolder = Properties.Settings.Default.EcholotOutputFolder;
if (!o.OutputFolder.IsNullOrEmpty())
outputFolder = o.OutputFolder;
int maxThreads = 2;
if (o.MaxThreads.HasValue) maxThreads = o.MaxThreads.Value;
Echolot.Evaluate(outputFolder, maxThreads);
}
}); });
} }
catch (Exception ex) catch (Exception ex)
{ {
log.Fatal(ex.ToString()); log.Fatal(ex.ToString());
Console.WriteLine(ex.Message);
result = 1; result = 1;
} }
Console.Read();
return result; return result;
} }
} }

View File

@ -12,7 +12,7 @@ namespace bsmd.Tool.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -23,15 +23,48 @@ namespace bsmd.Tool.Properties {
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("replace me!")] [global::System.Configuration.DefaultSettingValueAttribute("replace me!")]
public string ConnectionString { public string ConnectionString {
get { get {
return ((string)(this["ConnectionString"])); return ((string)(this["ConnectionString"]));
} }
set { }
this["ConnectionString"] = value;
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string EcholotOutputFolder {
get {
return ((string)(this["EcholotOutputFolder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("4")]
public int EcholotMaxThreads {
get {
return ((int)(this["EcholotMaxThreads"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\temp\\hisnord")]
public string HISNORD_Folder {
get {
return ((string)(this["HISNORD_Folder"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("C:\\temp\\dbh")]
public string DBH_Folder {
get {
return ((string)(this["DBH_Folder"]));
} }
} }
} }

View File

@ -2,8 +2,20 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.Tool.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="bsmd.Tool.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="ConnectionString" Type="System.String" Scope="User"> <Setting Name="ConnectionString" Type="System.String" Scope="Application">
<Value Profile="(Default)">replace me!</Value> <Value Profile="(Default)">replace me!</Value>
</Setting> </Setting>
<Setting Name="EcholotOutputFolder" Type="System.String" Scope="Application">
<Value Profile="(Default)" />
</Setting>
<Setting Name="EcholotMaxThreads" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">4</Value>
</Setting>
<Setting Name="HISNORD_Folder" Type="System.String" Scope="Application">
<Value Profile="(Default)">C:\temp\hisnord</Value>
</Setting>
<Setting Name="DBH_Folder" Type="System.String" Scope="Application">
<Value Profile="(Default)">C:\temp\dbh</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -44,25 +44,62 @@
<Reference Include="bsmd.database"> <Reference Include="bsmd.database">
<HintPath>..\bsmd.database\bin\Debug\bsmd.database.dll</HintPath> <HintPath>..\bsmd.database\bin\Debug\bsmd.database.dll</HintPath>
</Reference> </Reference>
<Reference Include="ClosedXML, Version=0.105.0.0, Culture=neutral, PublicKeyToken=fd1eb21b62ae805b, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.0.105.0\lib\netstandard2.0\ClosedXML.dll</HintPath>
</Reference>
<Reference Include="ClosedXML.Parser, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d5f7376574c51ec, processorArchitecture=MSIL">
<HintPath>..\packages\ClosedXML.Parser.2.0.0\lib\netstandard2.0\ClosedXML.Parser.dll</HintPath>
</Reference>
<Reference Include="CommandLine, Version=2.9.1.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL"> <Reference Include="CommandLine, Version=2.9.1.0, Culture=neutral, PublicKeyToken=5a870481e358d379, processorArchitecture=MSIL">
<HintPath>..\packages\CommandLineParser.2.9.1\lib\net461\CommandLine.dll</HintPath> <HintPath>..\packages\CommandLineParser.2.9.1\lib\net461\CommandLine.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="DocumentFormat.OpenXml, Version=3.1.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath> <HintPath>..\packages\DocumentFormat.OpenXml.3.1.1\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml.Framework, Version=3.1.1.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.Framework.3.1.1\lib\net46\DocumentFormat.OpenXml.Framework.dll</HintPath>
</Reference>
<Reference Include="ExcelNumberFormat, Version=1.1.0.0, Culture=neutral, PublicKeyToken=23c6f5d73be07eca, processorArchitecture=MSIL">
<HintPath>..\packages\ExcelNumberFormat.1.1.0\lib\net20\ExcelNumberFormat.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.HashCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.HashCode.1.1.1\lib\net461\Microsoft.Bcl.HashCode.dll</HintPath>
</Reference>
<Reference Include="RBush, Version=4.0.0.0, Culture=neutral, PublicKeyToken=c77e27b81f4d0187, processorArchitecture=MSIL">
<HintPath>..\packages\RBush.Signed.4.0.0\lib\net47\RBush.dll</HintPath>
</Reference>
<Reference Include="SixLabors.Fonts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13, processorArchitecture=MSIL">
<HintPath>..\packages\SixLabors.Fonts.1.0.0\lib\netstandard2.0\SixLabors.Fonts.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data.SQLite, Version=1.0.117.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <Reference Include="System.Data.SQLite, Version=1.0.119.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\lib\net46\System.Data.SQLite.dll</HintPath> <HintPath>..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\lib\net46\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\bsmd.database\Properties\AssemblyProductInfo.cs"> <Compile Include="..\bsmd.database\Properties\AssemblyProductInfo.cs">
@ -76,6 +113,7 @@
</Compile> </Compile>
<Compile Include="CheckRules.cs" /> <Compile Include="CheckRules.cs" />
<Compile Include="CleanupFiles.cs" /> <Compile Include="CleanupFiles.cs" />
<Compile Include="Echolot.cs" />
<Compile Include="LocodeSQliteImport.cs" /> <Compile Include="LocodeSQliteImport.cs" />
<Compile Include="Options.cs" /> <Compile Include="Options.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
@ -89,6 +127,7 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="..\bsmdKey.snk" /> <None Include="..\bsmdKey.snk" />
<None Include="bsmd.Tool.licenseheader" />
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
@ -96,12 +135,12 @@
</None> </None>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" /> <Import Project="..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets" Condition="Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.117.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" /> <Error Condition="!Exists('..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.119.0\build\net46\Stub.System.Data.SQLite.Core.NetFramework.targets'))" />
</Target> </Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>--locodes --csv="C:\svn_lager\bsmd\nsw\Archiv\2022-2.UNLOCODE.all.csv" --db "C:\git_lager\git_bsmd\misc\db.sqlite"</StartArguments> <StartArguments>--echolot --output_folder="C:\temp"</StartArguments>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -0,0 +1,14 @@
extensions: designer.cs generated.cs
extensions: .cs .cpp .h
// Copyright (c) 2020- schick Informatik
// Description:
//
extensions: .aspx .ascx
<%--
Copyright (c) 2020- schick Informatik
--%>
extensions: .xml .config .xsd
<!--
Copyright (c) 2020- schick Informatik
-->

View File

@ -1,7 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="ClosedXML" version="0.105.0" targetFramework="net48" />
<package id="ClosedXML.Parser" version="2.0.0" targetFramework="net48" />
<package id="CommandLineParser" version="2.9.1" targetFramework="net48" /> <package id="CommandLineParser" version="2.9.1" targetFramework="net48" />
<package id="log4net" version="2.0.15" targetFramework="net48" /> <package id="DocumentFormat.OpenXml" version="3.1.1" targetFramework="net48" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.117.0" targetFramework="net48" /> <package id="DocumentFormat.OpenXml.Framework" version="3.1.1" targetFramework="net48" />
<package id="System.Data.SQLite.Core" version="1.0.117.0" targetFramework="net48" /> <package id="ExcelNumberFormat" version="1.1.0" targetFramework="net48" />
<package id="log4net" version="3.1.0" targetFramework="net48" />
<package id="Microsoft.Bcl.HashCode" version="1.1.1" targetFramework="net48" />
<package id="RBush.Signed" version="4.0.0" targetFramework="net48" />
<package id="SixLabors.Fonts" version="1.0.0" targetFramework="net48" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.119.0" targetFramework="net48" />
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
<package id="System.Data.SQLite.Core" version="1.0.119.0" targetFramework="net48" />
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.0" targetFramework="net48" />
</packages> </packages>

View File

@ -137,8 +137,8 @@ namespace bsmd.database
} }
} }
[ENI2Validation] //[ENI2Validation]
[MaxLength(256)] //[MaxLength(256)]
public string Effects { get; set; } public string Effects { get; set; }
[ENI2Validation] [ENI2Validation]

View File

@ -112,6 +112,16 @@ namespace bsmd.database
return (await at.LoadListAsync(reader)).ConvertAll(x => (AGNT_Template)x); return (await at.LoadListAsync(reader)).ConvertAll(x => (AGNT_Template)x);
} }
public static async Task<List<SERV_Template>> GetSERVTemplatesAsync()
{
SqlCommand cmd = new SqlCommand();
SERV_Template st = new SERV_Template();
st.PrepareLoadCommand(cmd, Message.LoadFilter.ALL);
SqlDataReader reader = await PerformCommandAsync(cmd);
return (await st.LoadListAsync(reader)).ConvertAll(x => (SERV_Template)x);
}
public static async Task<List<WasteDisposalServiceProvider_Template>> GetWastDisposalServiceProviderTemplatesAsync() public static async Task<List<WasteDisposalServiceProvider_Template>> GetWastDisposalServiceProviderTemplatesAsync()
{ {
SqlCommand cmd = new SqlCommand(); SqlCommand cmd = new SqlCommand();

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("7.2.8")] [assembly: AssemblyInformationalVersion("7.2.9")]
[assembly: AssemblyCopyright("Copyright © 2014-2025 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2025 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("7.2.8.*")] [assembly: AssemblyVersion("7.2.9.*")]

View File

@ -0,0 +1,128 @@
// Copyright (c) 2024-present schick Informatik
// Description:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bsmd.database
{
public class SERV_Template : DatabaseEntityAsync, IComparable
{
#region Construction
public SERV_Template()
{
this.tablename = "[dbo].[SERV_template]";
}
#endregion
#region Properties
[MaxLength(99)]
public string ServiceName { get; set; }
[MaxLength(255)]
public string ServiceBeneficiary { get; set; }
[MaxLength(255)]
public string ServiceInvoiceRecipient { get; set; }
#endregion
#region DatabaseEntity implementation
public override void PrepareSave(IDbCommand cmd)
{
SqlCommand scmd = cmd as SqlCommand;
if (this.ServiceName != null) scmd.Parameters.AddWithValue("@P1", this.ServiceName);
else scmd.Parameters.AddWithValue("@P1", DBNull.Value);
if (this.ServiceBeneficiary != null) scmd.Parameters.AddWithValue(@"P2", this.ServiceBeneficiary);
else scmd.Parameters.AddWithValue("@P2", DBNull.Value);
if (this.ServiceInvoiceRecipient != null) scmd.Parameters.AddWithValue("@P3", this.ServiceInvoiceRecipient);
else scmd.Parameters.AddWithValue("@P3", DBNull.Value);
if (this.IsNew)
{
this.CreateId();
cmd.CommandText = string.Format("INSERT INTO {0} (Id, ServiceName, ServiceBeneficiary, ServiceInvoiceRecipient) VALUES " +
"(@ID, @P1, @P2, @P3)", this.Tablename);
}
else
{
cmd.CommandText = string.Format("UPDATE {0} SET ServiceName = @P1, ServiceBeneficiary = @P2, ServiceInvoiceRecipient = @P3 WHERE Id = @ID", this.Tablename);
}
scmd.Parameters.AddWithValue("@ID", this.Id);
}
public override void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
string query = string.Format("SELECT Id, ServiceName, ServiceBeneficiary, ServiceInvoiceRecipient FROM {0}", this.Tablename);
switch (filter)
{
case Message.LoadFilter.ALL:
default:
break;
}
cmd.CommandText = query;
}
public override List<DatabaseEntity> LoadList(System.Data.IDataReader reader)
{
List<DatabaseEntity> result = new List<DatabaseEntity>();
while (reader.Read())
{
SERV_Template serv_t = new SERV_Template();
serv_t.id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) serv_t.ServiceName = reader.GetString(1);
if (!reader.IsDBNull(2)) serv_t.ServiceBeneficiary = reader.GetString(2);
if (!reader.IsDBNull(3)) serv_t.ServiceInvoiceRecipient = reader.GetString(3);
result.Add(serv_t);
}
reader.Close();
return result;
}
protected override DatabaseEntityAsync ReadRowFromReader(IDataReader reader)
{
SERV_Template serv_t = null;
if (reader != null)
{
serv_t = new SERV_Template();
serv_t.id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) serv_t.ServiceName = reader.GetString(1);
if (!reader.IsDBNull(2)) serv_t.ServiceBeneficiary = reader.GetString(2);
if (!reader.IsDBNull(3)) serv_t.ServiceInvoiceRecipient = reader.GetString(3);
}
return serv_t;
}
#endregion
#region IComparable implementation
public int CompareTo(object obj)
{
if (obj is SERV_Template template)
{
return this.ServiceName.CompareTo(template.ServiceName);
}
return 0;
}
#endregion
}
}

View File

@ -89,8 +89,8 @@
<UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner> <UseWinFormsOutOfProcDesigner>False</UseWinFormsOutOfProcDesigner>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=3.1.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath> <HintPath>..\ENI2\packages\log4net.3.1.0\lib\net462\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\ENI2\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> <HintPath>..\ENI2\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
@ -173,6 +173,7 @@
<Compile Include="SanitaryMeasuresDetail.cs" /> <Compile Include="SanitaryMeasuresDetail.cs" />
<Compile Include="SEC.cs" /> <Compile Include="SEC.cs" />
<Compile Include="SERV.cs" /> <Compile Include="SERV.cs" />
<Compile Include="SERV_Template.cs" />
<Compile Include="ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs" /> <Compile Include="ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.cs" />
<Compile Include="ShowReportAttribute.cs" /> <Compile Include="ShowReportAttribute.cs" />
<Compile Include="SOAPLoggerExtension.cs" /> <Compile Include="SOAPLoggerExtension.cs" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="log4net" version="3.0.4" targetFramework="net48" /> <package id="log4net" version="3.1.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" /> <package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
</packages> </packages>