Merge branch 'feature/eni_7.9' of ssh://lager/mnt/ext/git/git_bsmd into feature/eni_7.9

This commit is contained in:
Daniel Schick 2023-02-05 08:09:09 +01:00
commit 2e91da8f3b
10 changed files with 308 additions and 345 deletions

View File

@ -1,56 +1,52 @@
<UserControl x:Class="ENI2.Controls.POListControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:local="clr-namespace:ENI2.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<col:ArrayList x:Key="arrList">
<col:DictionaryEntry Key="None" Value="0" />
<col:DictionaryEntry Key="Maersk BRV/WHV" Value="1" />
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
</col:ArrayList>
</UserControl.Resources>
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textPOLists}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Label Content="Calendar week" />
<xctk:DoubleUpDown x:Name="doubleUpDownCalendarWeek" VerticalContentAlignment="Center" VerticalAlignment="Center"
HorizontalAlignment="Stretch" Margin="2" Value="01" ValueChanged="doubleUpDownCalendarWeek_ValueChanged"/>
<Label Content="Type" />
<ComboBox x:Name="comboBoxFilterType" Margin="2" SelectionChanged="comboBoxFilterType_SelectionChanged" Width="100" />
<Button x:Name="buttonExcelExport" Margin="2" Click="buttonExcelExport_Click" Content="Export Excel" Width="100" />
<Button x:Name="buttonSaveChanges" Margin="2" Click="buttonSaveChanges_Click" Content="Save changes" Width="100" IsEnabled="False" />
</StackPanel>
<local:ENIDataGrid Grid.Row="1" Margin="2,8,2,2" x:Name="dataGridPOCores" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" CellEditEnding="dataGridPOCores_CellEditEnding" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="IMO/ENI" Binding="{Binding IMOENIDisplay}" IsReadOnly="True" />
<DataGridTextColumn x:Name="gridColumnPONumber" Header="PO number" Binding="{Binding PONumber, Mode=TwoWay}" IsReadOnly="False" />
<DataGridComboBoxColumn x:Name="gridColumnGroup" Header="Group" IsReadOnly="False" SelectedValueBinding="{Binding Flags, Mode=TwoWay}"
ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value">
</DataGridComboBoxColumn>
<DataGridTextColumn Header="Ship name" Binding="{Binding Shipname}" IsReadOnly="True" />
<DataGridTextColumn Header="ETA" Binding="{Binding ETA_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
<DataGridTextColumn Header="ETD" Binding="{Binding ETD_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
<DataGridTextColumn x:Name="gridColumnATA" Header="ATA" Binding="{Binding POATA, StringFormat=\{0:dd.MM.yyyy\}, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="False" />
<DataGridTextColumn Header="ATD" Binding="{Binding ATD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
<DataGridTextColumn Header="Hafen" Binding="{Binding PortnameDisplay}" IsReadOnly="True" />
<DataGridTextColumn Header="Id" Binding="{Binding DisplayId}" IsReadOnly="True" />
</DataGrid.Columns>
</local:ENIDataGrid>
</Grid>
</GroupBox>
</UserControl>
<UserControl x:Class="ENI2.Controls.MaerskListControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:util="clr-namespace:ENI2.Util"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:p="clr-namespace:ENI2.Properties"
xmlns:local="clr-namespace:ENI2.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<col:ArrayList x:Key="arrList">
<col:DictionaryEntry Key="None" Value="0" />
<col:DictionaryEntry Key="Maersk BRV/WHV" Value="1" />
<col:DictionaryEntry Key="SeaGo BHV" Value="2" />
<col:DictionaryEntry Key="SeaGo WHV" Value="4" />
</col:ArrayList>
</UserControl.Resources>
<GroupBox Name="groupBoxRP" Header="{x:Static p:Resources.textPOLists}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Label Content="Calendar week" />
<Label Content="Type" />
<Button x:Name="buttonImport" Margin="2" Content="Import" Width="70" />
<Button x:Name="buttonExport" Margin="2" Content="Export" Width="70" />
</StackPanel>
<local:ENIDataGrid Grid.Row="1" Margin="2,8,2,2" x:Name="dataGridPOCores" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" CellEditEnding="dataGridPOCores_CellEditEnding" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="IMO/ENI" Binding="{Binding IMOENIDisplay}" IsReadOnly="True" />
<DataGridTextColumn x:Name="gridColumnPONumber" Header="PO number" Binding="{Binding PONumber, Mode=TwoWay}" IsReadOnly="False" />
<DataGridComboBoxColumn x:Name="gridColumnGroup" Header="Group" IsReadOnly="False" SelectedValueBinding="{Binding Flags, Mode=TwoWay}"
ItemsSource="{StaticResource arrList}" DisplayMemberPath="Key" SelectedValuePath="Value">
</DataGridComboBoxColumn>
<DataGridTextColumn Header="Ship name" Binding="{Binding Shipname}" IsReadOnly="True" />
<DataGridTextColumn Header="ETA" Binding="{Binding ETA_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
<DataGridTextColumn Header="ETD" Binding="{Binding ETD_NOA_NOD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
<DataGridTextColumn x:Name="gridColumnATA" Header="ATA" Binding="{Binding POATA, StringFormat=\{0:dd.MM.yyyy\}, Mode=TwoWay, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="False" />
<DataGridTextColumn Header="ATD" Binding="{Binding ATD, StringFormat=\{0:dd.MM.yyyy HH:mm\}, Converter={util:UtcToLocalDateTimeConverter}}" IsReadOnly="True" />
<DataGridTextColumn Header="Hafen" Binding="{Binding PortnameDisplay}" IsReadOnly="True" />
<DataGridTextColumn Header="Id" Binding="{Binding DisplayId}" IsReadOnly="True" />
</DataGrid.Columns>
</local:ENIDataGrid>
</Grid>
</GroupBox>
</UserControl>

View File

@ -1,278 +1,186 @@
// Copyright (c) 2017 schick Informatik
// Description: PO Nummer Übersicht. Ergänzung Nummern. Excel Export
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Win32;
using Microsoft.Office.Interop.Excel;
using System.Runtime.InteropServices;
using bsmd.database;
namespace ENI2.Controls
{
/// <summary>
/// Interaction logic for POListControl.xaml
/// </summary>
public partial class POListControl : UserControl
{
#region Fields
private readonly string[] _comboBoxEntries =
{
"All",
"Maersk BRV/WHV",
"SeaGo BHV",
"SeaGo WHV"
};
private List<MessageCore> searchResult = new List<MessageCore>();
private readonly List<MessageCore> filteredResult = new List<MessageCore>();
#endregion
#region Construction
public POListControl()
{
InitializeComponent();
Loaded += POList_Loaded;
}
#endregion
#region control event handler
private void POList_Loaded(object sender, RoutedEventArgs e)
{
this.comboBoxFilterType.ItemsSource = this._comboBoxEntries;
this.doubleUpDownCalendarWeek.Value = bsmd.database.Util.GetIso8601WeekOfYear(DateTime.Now);
this.dataGridPOCores.ItemsSource = this.filteredResult;
}
private void buttonExcelExport_Click(object sender, RoutedEventArgs e)
{
if (this.filteredResult.Count == 0) return;
OpenFileDialog ofd = new OpenFileDialog
{
Filter = "Excel Files|*.xls;*.xlsx"
};
if (ofd.ShowDialog() ?? false)
{
try
{
Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
excelApp.DisplayAlerts = false;
Workbook workBook = excelApp.Workbooks.Open(ofd.FileName);
Worksheet workSheet = workBook.Worksheets[1];
int rowIndex = 3;
foreach(MessageCore core in this.filteredResult)
{
workSheet.Cells[rowIndex, 7].Value = core.Shipname;
workSheet.Cells[rowIndex, 10].Value = core.PoC.Substring(2);
if(core.POATA.HasValue)
workSheet.Cells[rowIndex, 11].Value = core.POATA.Value.ToShortDateString();
workSheet.Cells[rowIndex, 13].Value = core.PONumber;
rowIndex++;
}
workBook.Save();
workBook.Close();
Marshal.ReleaseComObject(workBook);
excelApp.Quit();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
}
}
private void buttonSaveChanges_Click(object sender, RoutedEventArgs e)
{
foreach(MessageCore messageCore in this.filteredResult)
{
if (messageCore.IsDirty)
{
DBManager.Instance.Save(messageCore);
messageCore.IsDirty = false;
// load ATA for this Core
/* DAS ATA WIRD JETZT NICHT MEHR IN DIE MELDEKLASSE GESPEICHERT
Message ataMessage = DBManager.Instance.GetMessage(messageCore, Message.NotificationClass.ATA);
if(ataMessage?.Elements.Count == 1)
{
if(messageCore.ATA != ((ATA)ataMessage.Elements[0]).ATAPortOfCall)
{
((ATA)ataMessage.Elements[0]).ATAPortOfCall = messageCore.ATA;
DBManager.Instance.Save(ataMessage.Elements[0]);
}
}
*/
}
}
this.buttonSaveChanges.IsEnabled = false;
}
private void doubleUpDownCalendarWeek_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
if (!this.IsLoaded) return;
this.comboBoxFilterType.SelectedIndex = -1;
this.PerformSearch();
}
private void comboBoxFilterType_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.dataGridPOCores.ItemsSource = null;
if (this.comboBoxFilterType.SelectedIndex == -1) return;
this.filteredResult.Clear();
foreach (MessageCore core in this.searchResult)
{
switch (this.comboBoxFilterType.SelectedIndex)
{
case 0: this.filteredResult.Add(core); break;
case 1: if (core.IsFlagSet(MessageCore.CoreFlags.MAERSK_BHV)) this.filteredResult.Add(core); break;
case 2: if (core.IsFlagSet(MessageCore.CoreFlags.SEAGO_BHV)) this.filteredResult.Add(core); break;
case 3: if (core.IsFlagSet(MessageCore.CoreFlags.SEAGO_WHV)) this.filteredResult.Add(core); break;
case 4: if (core.IsFlagSet(MessageCore.CoreFlags.HOEGH)) this.filteredResult.Add(core); break;
}
}
this.dataGridPOCores.ItemsSource = this.filteredResult;
}
private void dataGridPOCores_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
if (e.EditAction == DataGridEditAction.Commit)
{
if (e.Column == gridColumnPONumber)
{
// validate for "true" number
var el = e.EditingElement as System.Windows.Controls.TextBox;
if (!el.Text.IsDigitsOnly())
{
el.Text = string.Empty;
e.Cancel = true;
}
else
{
buttonSaveChanges.IsEnabled = true;
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
editedCore.IsDirty = true;
}
}
if(e.Column == gridColumnGroup)
{
var el = e.EditingElement as ComboBox;
DictionaryEntry selectedItem = (DictionaryEntry) el.SelectedItem;
MessageCore.CoreFlags coreFlag = (MessageCore.CoreFlags) Enum.Parse(typeof(MessageCore.CoreFlags), selectedItem.Value.ToString());
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
// clear all first
editedCore.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
editedCore.SetFlag(false, MessageCore.CoreFlags.HOEGH);
if (coreFlag != MessageCore.CoreFlags.NONE)
{
editedCore.SetFlag(true, coreFlag);
}
buttonSaveChanges.IsEnabled = true;
editedCore.IsDirty = true;
}
if(e.Column == gridColumnATA)
{
var el = e.EditingElement as System.Windows.Controls.TextBox;
if(DateTime.TryParse(el.Text, out DateTime localATA))
{
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
editedCore.ATA = DateTime.SpecifyKind(localATA, DateTimeKind.Local).ToUniversalTime();
buttonSaveChanges.IsEnabled = true;
editedCore.IsDirty = true;
}
else
{
el.Text = string.Empty;
e.Cancel = true;
}
}
}
}
#endregion
#region private methods
private void PerformSearch()
{
this.dataGridPOCores.ItemsSource = null;
this.filteredResult.Clear();
if (!this.doubleUpDownCalendarWeek.Value.HasValue) return;
Dictionary<MessageCore.SearchFilterType, string> filterDict = new Dictionary<MessageCore.SearchFilterType, string>();
DateTime start = bsmd.database.Util.FirstDateOfWeekISO8601(DateTime.Now.Year, (int)this.doubleUpDownCalendarWeek.Value);
DateTime end = start.Add(new TimeSpan(6, 23, 59, 59));
// Die Suche findet in einem erweiterten Intervall statt, da später wenn möglich nach ATA gefiltert wird
uint from = start.Subtract(new TimeSpan(10, 0, 0, 0)).ToUniversalTime().ToUnixTimeStamp();
uint to = end.Add(new TimeSpan(5, 0, 0, 0)).ToUniversalTime().ToUnixTimeStamp();
filterDict.Add(MessageCore.SearchFilterType.FILTER_ETA, string.Format("{0}:{1}", from.ToString() ?? "", to.ToString() ?? ""));
Util.UIHelper.SetBusyState();
// suche auslösen
this.searchResult = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoresWithFilters(filterDict);
// alle anderen Häfen weg
this.searchResult.RemoveAll(item => (item.PoC == null) || (!item.PoC.Equals("DEBRV") && !item.PoC.Equals("DEWHV") && !item.PoC.Equals("DEWVN")));
// rückwärts iterieren um nach ETA und ATA zu filtern
if (this.searchResult.Count > 0)
{
for (int i = this.searchResult.Count - 1; i >= 0; i--)
{
MessageCore messageCore = this.searchResult[i];
if (messageCore.ATA.HasValue)
{
if ((messageCore.ATA.Value < start) || (messageCore.ATA.Value > end))
{
this.searchResult.RemoveAt(i);
}
else
{
if(!messageCore.POATA.HasValue)
{
messageCore.POATA = messageCore.ATA;
messageCore.IsDirty = true;
this.buttonSaveChanges.IsEnabled = true;
}
}
}
else
{
if ((messageCore.ETA.Value < start) || (messageCore.ETA.Value > end)) this.searchResult.RemoveAt(i);
}
}
}
searchResult.Sort((x, y) => DateTime.Compare(x.ATA ?? DateTime.MaxValue, y.ATA ?? DateTime.MaxValue));
this.dataGridPOCores.SelectedItem = null;
this.filteredResult.AddRange(searchResult);
this.dataGridPOCores.ItemsSource = this.filteredResult;
}
#endregion
}
}
// Copyright (c) 2017 schick Informatik
// Description: PO Nummer Übersicht. Ergänzung Nummern. Excel Export
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Win32;
using Microsoft.Office.Interop.Excel;
using System.Runtime.InteropServices;
using bsmd.database;
namespace ENI2.Controls
{
/// <summary>
/// Interaction logic for MaerskListControl.xaml
/// </summary>
public partial class MaerskListControl : UserControl
{
#region Fields
private List<MessageCore> searchResult = new List<MessageCore>();
private readonly List<MessageCore> filteredResult = new List<MessageCore>();
#endregion
#region Construction
public MaerskListControl()
{
InitializeComponent();
Loaded += POList_Loaded;
}
#endregion
#region control event handler
private void POList_Loaded(object sender, RoutedEventArgs e)
{
}
private void dataGridPOCores_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
if (e.EditAction == DataGridEditAction.Commit)
{
if (e.Column == gridColumnPONumber)
{
// validate for "true" number
var el = e.EditingElement as System.Windows.Controls.TextBox;
if (!el.Text.IsDigitsOnly())
{
el.Text = string.Empty;
e.Cancel = true;
}
else
{
// buttonSaveChanges.IsEnabled = true;
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
editedCore.IsDirty = true;
}
}
if(e.Column == gridColumnGroup)
{
var el = e.EditingElement as ComboBox;
DictionaryEntry selectedItem = (DictionaryEntry) el.SelectedItem;
MessageCore.CoreFlags coreFlag = (MessageCore.CoreFlags) Enum.Parse(typeof(MessageCore.CoreFlags), selectedItem.Value.ToString());
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
// clear all first
editedCore.SetFlag(false, MessageCore.CoreFlags.MAERSK_BHV);
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_BHV);
editedCore.SetFlag(false, MessageCore.CoreFlags.SEAGO_WHV);
editedCore.SetFlag(false, MessageCore.CoreFlags.HOEGH);
if (coreFlag != MessageCore.CoreFlags.NONE)
{
editedCore.SetFlag(true, coreFlag);
}
// buttonSaveChanges.IsEnabled = true;
editedCore.IsDirty = true;
}
if(e.Column == gridColumnATA)
{
var el = e.EditingElement as System.Windows.Controls.TextBox;
if(DateTime.TryParse(el.Text, out DateTime localATA))
{
MessageCore editedCore = this.filteredResult[e.Row.GetIndex()];
editedCore.ATA = DateTime.SpecifyKind(localATA, DateTimeKind.Local).ToUniversalTime();
// buttonSaveChanges.IsEnabled = true;
editedCore.IsDirty = true;
}
else
{
el.Text = string.Empty;
e.Cancel = true;
}
}
}
}
#endregion
#region private methods
private void PerformSearch()
{
this.dataGridPOCores.ItemsSource = null;
this.filteredResult.Clear();
// TODO: Da diese Suche hier so unfassbar lahmarschig ist wäre es günstig (zukünftig für das gesamte ENI),
// wenn die Abfrage asynchron stattfinden würde. Man muss nur irgendwie den Anwender bei Laune halten so dass
// er merkt, da passiert noch was. Eventuell mit einem "spinning" Icon. Aber der Rest bleibt aktiv.
Dictionary<MessageCore.SearchFilterType, string> filterDict = new Dictionary<MessageCore.SearchFilterType, string>();
DateTime start = DateTime.Now; // bsmd.database.Util.FirstDateOfWeekISO8601(DateTime.Now.Year, (int)this.doubleUpDownCalendarWeek.Value);
DateTime end = start.Add(new TimeSpan(6, 23, 59, 59));
// Die Suche findet in einem erweiterten Intervall statt, da später wenn möglich nach ATA gefiltert wird
uint from = start.Subtract(new TimeSpan(10, 0, 0, 0)).ToUniversalTime().ToUnixTimeStamp();
uint to = end.Add(new TimeSpan(5, 0, 0, 0)).ToUniversalTime().ToUnixTimeStamp();
filterDict.Add(MessageCore.SearchFilterType.FILTER_ETA, string.Format("{0}:{1}", from.ToString() ?? "", to.ToString() ?? ""));
Util.UIHelper.SetBusyState();
// suche auslösen
this.searchResult = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoresWithFilters(filterDict);
// alle anderen Häfen weg
this.searchResult.RemoveAll(item => (item.PoC == null) || (!item.PoC.Equals("DEBRV") && !item.PoC.Equals("DEWHV") && !item.PoC.Equals("DEWVN")));
// rückwärts iterieren um nach ETA und ATA zu filtern
if (this.searchResult.Count > 0)
{
for (int i = this.searchResult.Count - 1; i >= 0; i--)
{
MessageCore messageCore = this.searchResult[i];
if (messageCore.ATA.HasValue)
{
if ((messageCore.ATA.Value < start) || (messageCore.ATA.Value > end))
{
this.searchResult.RemoveAt(i);
}
else
{
if(!messageCore.POATA.HasValue)
{
messageCore.POATA = messageCore.ATA;
messageCore.IsDirty = true;
// this.buttonSaveChanges.IsEnabled = true;
}
}
}
else
{
if ((messageCore.ETA.Value < start) || (messageCore.ETA.Value > end)) this.searchResult.RemoveAt(i);
}
}
}
searchResult.Sort((x, y) => DateTime.Compare(x.ATA ?? DateTime.MaxValue, y.ATA ?? DateTime.MaxValue));
this.dataGridPOCores.SelectedItem = null;
this.filteredResult.AddRange(searchResult);
this.dataGridPOCores.ItemsSource = this.filteredResult;
}
private List<MessageCore> GetNextNDayCoresFromList(List<MessageCore> cores, int numDays = 3)
{
List<MessageCore> result = new List<MessageCore>();
result.AddRange(cores.FindAll(x => (x.ETADisplay.Value - DateTime.Now).TotalHours < (numDays * 24)));
return result;
}
#endregion
}
}

View File

@ -0,0 +1,24 @@
<UserControl x:Class="ENI2.Controls.MaerskOverviewControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ENI2.Controls"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Maersk lists" />
<TabControl x:Name="tabControlMaersk" Grid.Row="1">
<TabItem Name="tabItemBRV" Header="DEBRV">
<local:MaerskListControl x:Name="brvListControl" />
</TabItem>
<TabItem Name="tabItemWVN" Header="DEWVN">
<local:MaerskListControl x:Name="wvnListControl" />
</TabItem>
</TabControl>
</Grid>
</UserControl>

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ENI2.Controls
{
/// <summary>
/// Interaction logic for MaerskOverviewControl.xaml
/// </summary>
public partial class MaerskOverviewControl : UserControl
{
public MaerskOverviewControl()
{
InitializeComponent();
}
}
}

View File

@ -228,6 +228,9 @@
<Compile Include="Controls\LocodeControl.xaml.cs">
<DependentUpon>LocodeControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\MaerskOverviewControl.xaml.cs">
<DependentUpon>MaerskOverviewControl.xaml</DependentUpon>
</Compile>
<Compile Include="EditControls\CompareExcelDialog.xaml.cs">
<DependentUpon>CompareExcelDialog.xaml</DependentUpon>
</Compile>
@ -249,8 +252,8 @@
<Compile Include="Excel\ExcelManager.cs" />
<Compile Include="Excel\ExcelReader.cs" />
<Compile Include="Excel\ExcelUtil.cs" />
<Compile Include="Controls\POListControl.xaml.cs">
<DependentUpon>POListControl.xaml</DependentUpon>
<Compile Include="Controls\MaerskListControl.xaml.cs">
<DependentUpon>MaerskListControl.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\ReportingPartyControl.xaml.cs">
<DependentUpon>ReportingPartyControl.xaml</DependentUpon>
@ -458,7 +461,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\POListControl.xaml">
<Page Include="Controls\MaerskOverviewControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\MaerskListControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>

View File

@ -35,7 +35,7 @@ namespace ENI2.EditControls
};
this.comboBoxInitialHIS.ItemsSource = comboDataSource;
this.comboBoxInitialHIS.SelectedIndex = 1;
this.comboBoxInitialHIS.SelectedIndex = 0;
this.EnableOK(false);
this.locodePoC.PropertyChanged += LocodePoC_PropertyChanged;

View File

@ -35,7 +35,7 @@ namespace ENI2
#region Fields
private ReportingPartyControl rpControl;
private POListControl poControl;
private MaerskOverviewControl moControl;
private ServerStatusControl statusControl;
private readonly SucheControl sucheControl;
private CompareExcelDialog compareExcelDialog;
@ -281,11 +281,11 @@ namespace ENI2
}
else if(sender == this.buttonPOListe)
{
if (this.poControl == null)
if (this.moControl == null)
{
this.poControl = new POListControl();
this.moControl = new MaerskOverviewControl();
}
this.rootContainer.Children.Add(poControl);
this.rootContainer.Children.Add(moControl);
}
else if(sender == this.buttonStatus)
{

View File

@ -3733,7 +3733,7 @@ namespace ENI2.Properties {
}
/// <summary>
/// Looks up a localized string similar to PO numbers.
/// Looks up a localized string similar to Maersk.
/// </summary>
public static string textPOLists {
get {

View File

@ -1709,7 +1709,7 @@
<value>IMO hazard class (Group)</value>
</data>
<data name="textPOLists" xml:space="preserve">
<value>PO numbers</value>
<value>Maersk</value>
</data>
<data name="textMaerskSeago" xml:space="preserve">
<value>Maersk / SeaGo</value>

View File

@ -199,7 +199,7 @@ namespace bsmd.database
if (!reader.IsDBNull(1)) ladg.CargoHandlingType = reader.GetByte(1);
if (!reader.IsDBNull(2)) ladg.CargoCodeNST = reader.GetString(2);
if (!reader.IsDBNull(3)) ladg.CargoNumberOfItems = reader.GetInt32(3);
if (!reader.IsDBNull(4)) ladg.CargoGrossQuantity_TNE = (float) reader.GetDouble(4);
if (!reader.IsDBNull(4)) ladg.CargoGrossQuantity_TNE = reader.GetDouble(4);
if (!reader.IsDBNull(5)) ladg.PortOfLoading = reader.GetString(5);
if (!reader.IsDBNull(6)) ladg.PortOfDischarge = reader.GetString(6);
if (!reader.IsDBNull(7)) ladg.Identifier = reader.GetString(7);