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

View File

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

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

View File

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

View File

@ -35,7 +35,7 @@ namespace ENI2
#region Fields #region Fields
private ReportingPartyControl rpControl; private ReportingPartyControl rpControl;
private POListControl poControl; private MaerskOverviewControl moControl;
private ServerStatusControl statusControl; private ServerStatusControl statusControl;
private readonly SucheControl sucheControl; private readonly SucheControl sucheControl;
private CompareExcelDialog compareExcelDialog; private CompareExcelDialog compareExcelDialog;
@ -281,11 +281,11 @@ namespace ENI2
} }
else if(sender == this.buttonPOListe) 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) else if(sender == this.buttonStatus)
{ {

View File

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

View File

@ -1709,7 +1709,7 @@
<value>IMO hazard class (Group)</value> <value>IMO hazard class (Group)</value>
</data> </data>
<data name="textPOLists" xml:space="preserve"> <data name="textPOLists" xml:space="preserve">
<value>PO numbers</value> <value>Maersk</value>
</data> </data>
<data name="textMaerskSeago" xml:space="preserve"> <data name="textMaerskSeago" xml:space="preserve">
<value>Maersk / SeaGo</value> <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(1)) ladg.CargoHandlingType = reader.GetByte(1);
if (!reader.IsDBNull(2)) ladg.CargoCodeNST = reader.GetString(2); if (!reader.IsDBNull(2)) ladg.CargoCodeNST = reader.GetString(2);
if (!reader.IsDBNull(3)) ladg.CargoNumberOfItems = reader.GetInt32(3); 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(5)) ladg.PortOfLoading = reader.GetString(5);
if (!reader.IsDBNull(6)) ladg.PortOfDischarge = reader.GetString(6); if (!reader.IsDBNull(6)) ladg.PortOfDischarge = reader.GetString(6);
if (!reader.IsDBNull(7)) ladg.Identifier = reader.GetString(7); if (!reader.IsDBNull(7)) ladg.Identifier = reader.GetString(7);