3.8.10: Neues Build

This commit is contained in:
Daniel Schick 2017-11-29 06:34:26 +00:00
parent 07b57ed259
commit 88b18d3bf1
13 changed files with 99 additions and 14 deletions

View File

@ -68,6 +68,7 @@ namespace ENI2.Controls
{ {
this.MouseDoubleClick += dataGrid_MouseDoubleClick; this.MouseDoubleClick += dataGrid_MouseDoubleClick;
this.PreviewKeyDown += ENIDataGrid_PreviewKeyDown;
this.ContextMenu = new ContextMenu(); this.ContextMenu = new ContextMenu();
this.CanUserAddRows = false; this.CanUserAddRows = false;
@ -112,6 +113,16 @@ namespace ENI2.Controls
} }
private void ENIDataGrid_PreviewKeyDown(object sender, KeyEventArgs e)
{
if(sender is ENIDataGrid)
{
var grid = sender as ENIDataGrid;
if (Key.Delete == e.Key)
this.deleteItem(null, null);
}
}
#region public #region public
public DataGridRow GetRow(int index) public DataGridRow GetRow(int index)

View File

@ -94,6 +94,24 @@ namespace ENI2
#endregion #endregion
#region public methods
public void CoreChanged(MessageCore newCore)
{
this._core = newCore;
Application.Current.Dispatcher.Invoke(delegate
{
if(controlCache.ContainsKey(Properties.Resources.textOverview))
{
OverViewDetailControl ovdc = controlCache[Properties.Resources.textOverview] as OverViewDetailControl;
ovdc.Core = newCore;
ovdc.UpdateCore();
}
});
}
#endregion
#region class MessageGroup #region class MessageGroup
/// <summary> /// <summary>

View File

@ -373,7 +373,16 @@ namespace ENI2.DetailViewControls
{ {
MessageBox.Show("Reporting party empty, cannot show locked by!", "Notification", MessageBoxButton.OK, MessageBoxImage.Error); MessageBox.Show("Reporting party empty, cannot show locked by!", "Notification", MessageBoxButton.OK, MessageBoxImage.Error);
} }
} }
public void UpdateCore()
{
this.textBoxDisplayId.DataContext = null;
this.textBoxDisplayId.DataContext = this.Core;
this.labelBSMDStatusInternal.DataContext = null;
this.labelBSMDStatusInternal.DataContext = this.Core;
MessageBox.Show("Visit/Transit ID updated!");
}
#endregion #endregion

View File

@ -93,7 +93,7 @@
</TabItem> </TabItem>
<TabItem Header="{x:Static p:Resources.textLast10PortFacilities}" Name="tabLast10PortFacilites"> <TabItem Header="{x:Static p:Resources.textLast10PortFacilities}" Name="tabLast10PortFacilites">
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridLast10PortFacilities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridLast10PortFacilities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" 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" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortFacilityPortName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /> <DataGridTextColumn Header="{x:Static p:Resources.textPortname}" Binding="{Binding PortFacilityPortName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />

View File

@ -327,6 +327,10 @@ namespace ENI2.DetailViewControls
this.comboBoxISSCType.IsEnabled = enable; this.comboBoxISSCType.IsEnabled = enable;
this.datePickerISSCDateOfExpiration.IsEnabled = enable; this.datePickerISSCDateOfExpiration.IsEnabled = enable;
this.dataGridLast10PortFacilities.IsEnabled = enable;
this.dataGridShip2ShipActivities.IsEnabled = enable;
} }
#endregion #endregion

View File

@ -36,7 +36,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision> <ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>3.8.9.%2a</ApplicationVersion> <ApplicationVersion>3.8.10.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -66,6 +66,7 @@ namespace ENI2
this.mainPanel.LayoutTransform = this._transform; this.mainPanel.LayoutTransform = this._transform;
this._dbWatchDog = new DatabaseEntityWatchdog(); this._dbWatchDog = new DatabaseEntityWatchdog();
this._dbWatchDog.DatabaseEntityChanged += _dbWatchDog_DatabaseEntityChanged; this._dbWatchDog.DatabaseEntityChanged += _dbWatchDog_DatabaseEntityChanged;
this._dbWatchDog.VisitTransitIdUpdated += _dbWatchDog_VisitTransitIdUpdated;
App.SplashScreen.ShowMessage("done"); App.SplashScreen.ShowMessage("done");
Thread.Sleep(500); Thread.Sleep(500);
App.SplashScreen.LoadComplete(); App.SplashScreen.LoadComplete();
@ -461,6 +462,23 @@ namespace ENI2
} }
} }
private void _dbWatchDog_VisitTransitIdUpdated(DatabaseEntity entity)
{
MessageCore changedCore = entity as MessageCore;
if (changedCore != null)
{
TabItem tabitem = this.openTabs[changedCore.Id.Value];
this.Dispatcher.BeginInvoke(new Action(() =>
{
DetailRootControl drc = tabitem.Content as DetailRootControl;
if (drc != null)
{
drc.CoreChanged(changedCore);
}
}));
}
}
#endregion #endregion
#region mouse wheel / zooming events #region mouse wheel / zooming events

View File

@ -21,6 +21,7 @@ namespace ENI2.Util
public delegate void DatabaseEntityChangedHandler (DatabaseEntity entity); public delegate void DatabaseEntityChangedHandler (DatabaseEntity entity);
public event DatabaseEntityChangedHandler DatabaseEntityChanged; public event DatabaseEntityChangedHandler DatabaseEntityChanged;
public event DatabaseEntityChangedHandler VisitTransitIdUpdated;
public DatabaseEntityWatchdog() public DatabaseEntityWatchdog()
{ {
@ -45,6 +46,24 @@ namespace ENI2.Util
OnDatabaseEntityChanged(entity); OnDatabaseEntityChanged(entity);
changedCores.Add(entity); changedCores.Add(entity);
} }
if(entity.IsTransit)
{
if (!entity.TransitId.Equals(watchedEntity.TransitId))
{
OnVisitTransitIdUpdated(entity);
watchedEntity.TransitId = entity.TransitId;
}
}
else
{
if (!entity.VisitId.Equals(watchedEntity.VisitId))
{
OnVisitTransitIdUpdated(entity);
watchedEntity.VisitId = entity.VisitId;
}
}
} }
} }
@ -85,6 +104,11 @@ namespace ENI2.Util
this.DatabaseEntityChanged?.Invoke(entity); this.DatabaseEntityChanged?.Invoke(entity);
} }
protected void OnVisitTransitIdUpdated(DatabaseEntity entity)
{
this.VisitTransitIdUpdated?.Invoke(entity);
}
#endregion #endregion
} }

View File

@ -220,11 +220,11 @@ namespace bsmd.database
{ {
if(this.ETDFromPortOfCall.HasValue && this.ETAToPortOfCall.HasValue && if(this.ETDFromPortOfCall.HasValue && this.ETAToPortOfCall.HasValue &&
(this.ETDFromPortOfCall < this.ETAToPortOfCall)) (this.ETDFromPortOfCall < this.ETAToPortOfCall))
errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromPortOfCall", this.ETDFromPortOfCall.ToString(), this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromPortOfCall", this.ETDFromPortOfCall.ToString(), this.Title, this.Tablename));
if(this.CallPurposes.IsNullOrEmpty()) if(this.CallPurposes.IsNullOrEmpty())
{ {
errors.Add(RuleEngine.CreateError(ValidationCode.LIST_EMPTY, null, "CallPurpose", this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.LIST_EMPTY, null, "CallPurpose", this.Title, this.Tablename));
} }
} }
@ -232,24 +232,24 @@ namespace bsmd.database
{ {
if (this.ETDFromKielCanal.HasValue && this.ETAToKielCanal.HasValue && if (this.ETDFromKielCanal.HasValue && this.ETAToKielCanal.HasValue &&
(this.ETDFromKielCanal < this.ETAToKielCanal)) (this.ETDFromKielCanal < this.ETAToKielCanal))
errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromKielCanal", this.ETDFromKielCanal.ToString(), this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETDFromKielCanal", this.ETDFromKielCanal.ToString(), this.Title, this.Tablename));
} }
if((this.LastPort != null) && !this.LastPort.Equals("ZZUKN") && !this.ETDFromLastPort.HasValue) if((this.LastPort != null) && !this.LastPort.Equals("ZZUKN") && !this.ETDFromLastPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETDFromLastPort", null, this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETDFromLastPort", null, this.Title, this.Tablename));
if((this.LastPort != null) && this.LastPort.Equals("ZZUKN") && this.ETDFromLastPort.HasValue) if((this.LastPort != null) && this.LastPort.Equals("ZZUKN") && this.ETDFromLastPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "ETDFromLastPort", null, this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort", null, this.Title, this.Tablename));
if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue && if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue &&
this.ETAToNextPort < ETDFromPortOfCall) this.ETAToNextPort < ETDFromPortOfCall)
errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETAToNextPort", null, this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.E121, "ETAToNextPort", null, this.Title, this.Tablename));
if ((this.NextPort != null) && !this.NextPort.Equals("ZZUKN") && !this.ETAToNextPort.HasValue) if ((this.NextPort != null) && !this.NextPort.Equals("ZZUKN") && !this.ETAToNextPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETAToNextPort", null, this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, "ETAToNextPort", null, this.Title, this.Tablename));
if((this.NextPort != null) && this.NextPort.Equals("ZZUKN") && this.ETAToNextPort.HasValue) if((this.NextPort != null) && this.NextPort.Equals("ZZUKN") && this.ETAToNextPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "ETAToNextPort", null, this.Title, null)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETAToNextPort", null, this.Title, this.Tablename));
} }

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("3.8.9")] [assembly: AssemblyInformationalVersion("3.8.10")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

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

View File

@ -31,6 +31,7 @@ namespace bsmd.database
STRING_EXACT_LEN, STRING_EXACT_LEN,
LIST_EMPTY, LIST_EMPTY,
IMPLAUSIBLE, IMPLAUSIBLE,
IMPLAUSIBLE_ZZUKN,
POSITION_COUNT = 22, POSITION_COUNT = 22,
STRING_UNNUMBER = 23, STRING_UNNUMBER = 23,
STRING_IMOCLASS = 24, STRING_IMOCLASS = 24,

View File

@ -23,7 +23,7 @@ namespace bsmd.database
private ObservableCollection<DatabaseEntity> waste = new ObservableCollection<DatabaseEntity>(); private ObservableCollection<DatabaseEntity> waste = new ObservableCollection<DatabaseEntity>();
private static readonly int[] dkWasteCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2300, 2309, 3000, 5100, 5200, 5300, 2300 }; private static readonly int[] dkWasteCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2300, 2309, 3000, 5100, 5200, 5300, 2300 };
private static readonly int[] requiredCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2313, 2309, 3000, 5100, 5200, 5300 }; private static readonly int[] requiredCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2309, 3000, 5100, 5200, 5300 };
private static readonly string[] dkWasteTypes = { "Waste oils - Sludge", "Waste oils - Bilge water", "Waste oils - Other", "Garbage - Food waste", "Garbage - Plastic", "Garbage - Other", "Garbage - Other - Cooking oil", "Garbage - Other - Incinerator ashes and clinkers", "Operational wastes", "Garbage - Other", "Garbage - Other - Animal carcasses", "Sewage", "Cargo residues - Marpol Annex I - Other", "Cargo residues - Marpol Annex II - Other", "Cargo residues - Marpol Annex V - Other", "Garbage - Other" }; private static readonly string[] dkWasteTypes = { "Waste oils - Sludge", "Waste oils - Bilge water", "Waste oils - Other", "Garbage - Food waste", "Garbage - Plastic", "Garbage - Other", "Garbage - Other - Cooking oil", "Garbage - Other - Incinerator ashes and clinkers", "Operational wastes", "Garbage - Other", "Garbage - Other - Animal carcasses", "Sewage", "Cargo residues - Marpol Annex I - Other", "Cargo residues - Marpol Annex II - Other", "Cargo residues - Marpol Annex V - Other", "Garbage - Other" };
private static readonly string[] requiredTypes = { "Oily Residues (sludge)", "Oily Bilge Water", "Waste oil - others (specify)", "Food waste", "Plastics", "Domestic wastes", "Cooking oil", "Incinerator ashes", "Operational wastes", "Animal carcass(es)", "Sewage", "Cargo residues - Marpol Annex I", "Cargo residues - Marpol Annex II", "Cargo residues - Marpol Annex V" }; private static readonly string[] requiredTypes = { "Oily Residues (sludge)", "Oily Bilge Water", "Waste oil - others (specify)", "Food waste", "Plastics", "Domestic wastes", "Cooking oil", "Incinerator ashes", "Operational wastes", "Animal carcass(es)", "Sewage", "Cargo residues - Marpol Annex I", "Cargo residues - Marpol Annex II", "Cargo residues - Marpol Annex V" };