3.5.3.2 Databinding Korrektur, Initialize() damit es keine weiteren OnLoad/Konstruktor Kollisionen gibt
This commit is contained in:
parent
12bbe8a1b8
commit
2a8ee17059
@ -16,10 +16,20 @@ namespace ENI2
|
|||||||
public class DetailBaseControl : UserControl
|
public class DetailBaseControl : UserControl
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
public MessageCore Core { get; set; }
|
public MessageCore Core { get; set; }
|
||||||
|
|
||||||
public List<Message> Messages { get; set; }
|
public List<Message> Messages { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region protected methods
|
||||||
|
|
||||||
|
public virtual void Initialize() { }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -85,6 +85,7 @@ namespace ENI2
|
|||||||
DetailBaseControl detailControl = (DetailBaseControl) Activator.CreateInstance(mg.MessageGroupControlType);
|
DetailBaseControl detailControl = (DetailBaseControl) Activator.CreateInstance(mg.MessageGroupControlType);
|
||||||
detailControl.Core = _core;
|
detailControl.Core = _core;
|
||||||
detailControl.Messages = _messages;
|
detailControl.Messages = _messages;
|
||||||
|
detailControl.Initialize();
|
||||||
// plug it in ;-)
|
// plug it in ;-)
|
||||||
detailView.Children.Clear();
|
detailView.Children.Clear();
|
||||||
detailView.Children.Add(detailControl);
|
detailView.Children.Add(detailControl);
|
||||||
|
|||||||
@ -3,7 +3,8 @@
|
|||||||
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:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
xmlns:local="clr-namespace:ENI2.DetailViewControls"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="300" d:DesignWidth="600">
|
d:DesignHeight="300" d:DesignWidth="600">
|
||||||
@ -23,14 +24,20 @@
|
|||||||
<ColumnDefinition Width="2*" />
|
<ColumnDefinition Width="2*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Grid.Row="0" Grid.Column="0" Content="Anlaufhafen" />
|
<Label Grid.Row="0" Grid.Column="0" Content="Anlaufhafen" />
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" IsReadOnly="True" Text="{Binding PoC}" Margin="2"/>
|
<TextBox Name="textBoxPoC" Grid.Row="0" Grid.Column="1" IsReadOnly="True" Text="{Binding PoC}" Margin="2"/>
|
||||||
<Label Grid.Row="0" Grid.Column="2" Content="Visit/Transit-ID" />
|
<Label Grid.Row="0" Grid.Column="2" Content="Visit/Transit-ID" />
|
||||||
<TextBox Grid.Row="0" Grid.Column="3" IsReadOnly="True" Text="{Binding DisplayId}" Margin="2"/>
|
<TextBox Name="textBoxDisplayId" Grid.Row="0" Grid.Column="3" IsReadOnly="True" Margin="2"/>
|
||||||
<Label Grid.Row="1" Grid.Column="0" Content="IMO-Nummer" />
|
<Label Grid.Row="1" Grid.Column="0" Content="IMO-Nummer" />
|
||||||
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding IMO}" Margin="2" />
|
<TextBox Name="textBoxIMO" Grid.Row="1" Grid.Column="1" Text="{Binding IMO}" Margin="2" />
|
||||||
<Label Grid.Row="1" Grid.Column="2" Content="ENI-Nummer" />
|
<Label Grid.Row="1" Grid.Column="2" Content="ENI-Nummer" />
|
||||||
<TextBox Grid.Row="1" Grid.Column="3" Text="{Binding ENI}" Margin="2" />
|
<TextBox Name="textBoxENI" Grid.Row="1" Grid.Column="3" Text="{Binding ENI}" Margin="2" />
|
||||||
|
<Label Grid.Row="2" Grid.Column="0" Content="ETA PoC" />
|
||||||
|
<Label Grid.Row="2" Grid.Column="2" Content="ETD PoC" />
|
||||||
|
<Label Grid.Row="3" Grid.Column="0" Content="ATA PoC" />
|
||||||
|
<Label Grid.Row="3" Grid.Column="2" Content="ATD PoC" />
|
||||||
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="2" Value="{Binding ETA, Mode=TwoWay}" Name="dateTimePickerETA" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" />
|
||||||
|
<xctk:DateTimePicker Grid.Column="3" Grid.Row="2" Name="dateTimePickerETD" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
</src:DetailBaseControl>
|
</src:DetailBaseControl>
|
||||||
|
|||||||
@ -27,9 +27,49 @@ namespace ENI2.DetailViewControls
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class OverViewDetailControl : DetailBaseControl
|
public partial class OverViewDetailControl : DetailBaseControl
|
||||||
{
|
{
|
||||||
|
private Message _message = null;
|
||||||
|
|
||||||
public OverViewDetailControl()
|
public OverViewDetailControl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
Message.NotificationClass notificationClass = this.Core.IsTransit ? Message.NotificationClass.TRANSIT : Message.NotificationClass.VISIT;
|
||||||
|
if (this.Messages == null) return;
|
||||||
|
if (this.Core == null) return;
|
||||||
|
|
||||||
|
this.textBoxENI.DataContext = this.Core;
|
||||||
|
this.textBoxIMO.DataContext = this.Core;
|
||||||
|
this.textBoxPoC.DataContext = this.Core;
|
||||||
|
this.dateTimePickerETA.DataContext = this.Core;
|
||||||
|
//this.dateTimePickerETD.DataContext = ..
|
||||||
|
|
||||||
|
Binding vtBinding = new Binding();
|
||||||
|
vtBinding.Source = this.Core;
|
||||||
|
vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId");
|
||||||
|
vtBinding.Mode = BindingMode.TwoWay;
|
||||||
|
vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
|
||||||
|
BindingOperations.SetBinding(textBoxDisplayId, TextBox.TextProperty, vtBinding);
|
||||||
|
|
||||||
|
foreach (Message aMessage in this.Messages)
|
||||||
|
{
|
||||||
|
if (aMessage.MessageNotificationClass == notificationClass)
|
||||||
|
{
|
||||||
|
_message = aMessage;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_message != null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
|
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
|
||||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||||
<WebPage>publish.html</WebPage>
|
<WebPage>publish.html</WebPage>
|
||||||
<ApplicationRevision>2</ApplicationRevision>
|
<ApplicationRevision>3</ApplicationRevision>
|
||||||
<ApplicationVersion>3.5.3.%2a</ApplicationVersion>
|
<ApplicationVersion>3.5.3.%2a</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
|
|||||||
@ -45,9 +45,9 @@
|
|||||||
<ColumnDefinition Width="3*" />
|
<ColumnDefinition Width="3*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Label Grid.Column="0" Grid.Row="0" Content="Von:" HorizontalAlignment="Left" />
|
<Label Grid.Column="0" Grid.Row="0" Content="Von:" HorizontalAlignment="Left" />
|
||||||
<xctk:DateTimePicker Grid.Column="1" Grid.Row="0" Name="dateTimePickerETAFrom" Format="Custom" FormatString="dd.MM.yyyy hh:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" />
|
<xctk:DateTimePicker Grid.Column="1" Grid.Row="0" Name="dateTimePickerETAFrom" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" />
|
||||||
<Label Grid.Column="2" Grid.Row="0" Content="Bis:" HorizontalAlignment="Left" />
|
<Label Grid.Column="2" Grid.Row="0" Content="Bis:" HorizontalAlignment="Left" />
|
||||||
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Name="dateTimePickerETATo" Format="Custom" FormatString="dd.MM.yyyy hh:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" />
|
<xctk:DateTimePicker Grid.Column="3" Grid.Row="0" Name="dateTimePickerETATo" Format="Custom" FormatString="dd.MM.yyyy HH:mm" ShowButtonSpinner="False" VerticalContentAlignment="Center" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<TextBox Grid.Column="3" Grid.Row="2" Name="textBoxTicketNr" Margin="2"/>
|
<TextBox Grid.Column="3" Grid.Row="2" Name="textBoxTicketNr" Margin="2"/>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@ -2612,9 +2612,9 @@ namespace bsmd.ExcelReadService
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
reader.Conf.ConfirmText("Visit.PortOfCall", poc, ExcelReader.ReadState.FAIL);
|
message = string.Format("Port of call missing or not found for IMO {0}", imo);
|
||||||
reader.Conf.ConfirmText("Visit.PortOfCall_DK", poc, ExcelReader.ReadState.FAIL);
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isValidId = bsmd.database.Util.IsVisitId(visitTransitId) ||bsmd.database.Util.IsTransitId(visitTransitId);
|
bool isValidId = bsmd.database.Util.IsVisitId(visitTransitId) ||bsmd.database.Util.IsTransitId(visitTransitId);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user