Compare commits

..

1 Commits

Author SHA1 Message Date
953c1eafaf Created release version 7.2.13 2026-01-22 07:25:58 +01:00
38 changed files with 362 additions and 740 deletions

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
(c) 2017-present Informatikbüro Daniel Schick (c) 2017-present Informatikbüro Daniel Schick
--> -->
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, 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="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</sectionGroup> </sectionGroup>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="ENI2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup> </startup>
<applicationSettings> <applicationSettings>
<ENI2.Properties.Settings> <ENI2.Properties.Settings>
@ -26,119 +26,28 @@
<value>1000</value> <value>1000</value>
</setting> </setting>
<setting name="LockingServerAddress" serializeAs="String"> <setting name="LockingServerAddress" serializeAs="String">
<value>http://192.168.2.24/LockingService/LockingService.svc</value> <value>http://192.168.2.24/LockingService/LockingService.svc</value>
</setting>
<setting name="ReportAuthor" serializeAs="String">
<value>BSMD ReportGenerator</value>
</setting> </setting>
<setting name="ConnectionString" serializeAs="String"> <setting name="ConnectionString" serializeAs="String">
<value>Initial Catalog=nswtest;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value> <value>Initial Catalog=nsw;Data Source=192.168.2.24\SQLEXPRESS;Uid=dfuser;pwd=dfpasswd;Persist Security Info=False;Connection Reset=false</value>
</setting> </setting>
</ENI2.Properties.Settings> </ENI2.Properties.Settings>
</applicationSettings> </applicationSettings>
<userSettings> <userSettings>
<ENI2.Properties.Settings> <ENI2.Properties.Settings>
<setting name="MainWindowPlacement" serializeAs="String"> <setting name="MainWindowPlacement" serializeAs="String">
<value /> <value/>
</setting>
<setting name="Width" serializeAs="String">
<value>825</value>
</setting>
<setting name="Height" serializeAs="String">
<value>450</value>
</setting>
<setting name="W1Left" serializeAs="String">
<value>0</value>
</setting>
<setting name="W1Top" serializeAs="String">
<value>0</value>
</setting>
<setting name="W2Left" serializeAs="String">
<value>0</value>
</setting>
<setting name="W2Top" serializeAs="String">
<value>0</value>
</setting>
<setting name="W3Left" serializeAs="String">
<value>0</value>
</setting>
<setting name="W3Top" serializeAs="String">
<value>0</value>
</setting> </setting>
</ENI2.Properties.Settings> </ENI2.Properties.Settings>
</userSettings> </userSettings>
<system.serviceModel> <system.serviceModel>
<bindings> <bindings>
<basicHttpBinding> <basicHttpBinding>
<binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647" /> <binding name="BasicHttpBinding_IService" maxReceivedMessageSize="2147483647"/>
</basicHttpBinding> </basicHttpBinding>
</bindings> </bindings>
<client> <client>
<endpoint address="http://localhost:11651/LockingService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="LockingServiceReference.IService" name="BasicHttpBinding_IService" /> <endpoint address="http://localhost:11651/LockingService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService" contract="LockingServiceReference.IService" name="BasicHttpBinding_IService"/>
</client> </client>
</system.serviceModel> </system.serviceModel>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Logging.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Options" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.2" newVersion="6.0.0.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Primitives" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.3" newVersion="9.0.0.3" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Security.Cryptography.Pkcs" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DocumentFormat.OpenXml.Framework" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.0.0" newVersion="3.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DocumentFormat.OpenXml" publicKeyToken="8fb06cb64d019a17" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.3.0.0" newVersion="3.3.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.HashCode" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration> </configuration>

View File

@ -338,8 +338,7 @@ namespace ENI2.Controls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row

View File

@ -17,7 +17,6 @@ using ENI2.EditControls;
using System.Windows.Input; using System.Windows.Input;
using System.Linq; using System.Linq;
using ENI2.SheetDisplayControls; using ENI2.SheetDisplayControls;
using System.Threading.Tasks;
namespace ENI2 namespace ENI2
{ {
@ -35,9 +34,6 @@ namespace ENI2
// private readonly Dictionary<Message.NotificationClass, string> messageClassControlDict = new Dictionary<Message.NotificationClass, string>(); // private readonly Dictionary<Message.NotificationClass, string> messageClassControlDict = new Dictionary<Message.NotificationClass, string>();
private readonly object messageListLock = new object(); private readonly object messageListLock = new object();
private readonly HighlightService highlightService = new HighlightService(); private readonly HighlightService highlightService = new HighlightService();
private readonly object validationLock = new object();
private Task<ValidationResult> activeValidationTask = null;
private bool pendingShowMessages = false;
// Referenzen für Fehler/Violation Dialoge (können, müssen aber nicht offen bleiben) // Referenzen für Fehler/Violation Dialoge (können, müssen aber nicht offen bleiben)
protected ErrorListDialog _errorListDialog = null; protected ErrorListDialog _errorListDialog = null;
@ -707,13 +703,7 @@ namespace ENI2
private void DetailControl_RequestSendValidation() private void DetailControl_RequestSendValidation()
{ {
DetailControl_RequestSendValidationAsync(); this.Validate(false, out _, out List<MessageError> errorList);
}
private async void DetailControl_RequestSendValidationAsync()
{
ValidationResult result = await ValidateAndApplyAsync(false);
List<MessageError> errorList = result.Errors;
foreach (Message aMessage in this._messages) foreach (Message aMessage in this._messages)
{ {
@ -787,66 +777,43 @@ namespace ENI2
} }
} }
private async void DetailControl_RequestValidate(bool showDialog) private void DetailControl_RequestValidate(bool showDialog)
{ {
await ValidateAndApplyAsync(showDialog); this.Validate(showDialog, out _, out _);
} }
private async Task<ValidationResult> ValidateAndApplyAsync(bool showMessages) private void Validate(bool showMessages, out List<MessageViolation> vViolations, out List<MessageError> vErrors)
{ {
Task<ValidationResult> validationTask = null; vViolations = new List<MessageViolation>();
lock (validationLock) vErrors = new List<MessageError>();
{
if (activeValidationTask != null && !activeValidationTask.IsCompleted)
{
if (showMessages)
pendingShowMessages = true;
validationTask = activeValidationTask;
}
else
{
pendingShowMessages = showMessages;
activeValidationTask = ValidateAndApplyCoreAsync();
validationTask = activeValidationTask;
}
}
return await validationTask; // TODO: clear highlighting
}
private async Task<ValidationResult> ValidateAndApplyCoreAsync()
{
Util.UIHelper.SetBusyState(); Util.UIHelper.SetBusyState();
ApplyCrewEffectsWarningSuppression();
List<Message> messagesSnapshot = _messages.ToList();
ValidationResult result = await Task.Run(() => ValidateCore(messagesSnapshot));
bool showMessages;
lock (validationLock)
{
showMessages = pendingShowMessages;
pendingShowMessages = false;
activeValidationTask = null;
}
ApplyValidationResult(result, showMessages);
return result;
}
private ValidationResult ValidateCore(List<Message> messagesSnapshot)
{
List<MessageViolation> vViolations = new List<MessageViolation>();
List<MessageError> vErrors = new List<MessageError>();
RuleEngine ruleEngine = new RuleEngine(); RuleEngine ruleEngine = new RuleEngine();
foreach (Message aMessage in messagesSnapshot) foreach (Message aMessage in _messages)
{ {
if (!aMessage.EvaluateForValidation(this.Core.IsTransit)) continue; if (!aMessage.EvaluateForValidation(this.Core.IsTransit)) continue;
List<MessageError> errors = new List<MessageError>(); List<MessageError> errors = new List<MessageError>();
List<MessageViolation> violations = new List<MessageViolation>(); List<MessageViolation> violations = new List<MessageViolation>();
ruleEngine.ValidateMessage(aMessage, out errors, out violations); ruleEngine.ValidateMessage(aMessage, out errors, out violations);
if (errors.Count > 0)
aMessage.ErrorCount = errors.Count;
else
aMessage.ErrorCount = null;
if (violations.Count > 0)
{
aMessage.ViolationCount = violations.Count;
aMessage.PositionViolationCount = violations.Count(v => !v.Identifier.IsNullOrEmpty());
}
else
{
aMessage.ViolationCount = null;
aMessage.PositionViolationCount = null;
}
string messageGroup = this.MessageGroupForMessage(aMessage); string messageGroup = this.MessageGroupForMessage(aMessage);
@ -862,22 +829,22 @@ namespace ENI2
vViolations.AddRange(violations); vViolations.AddRange(violations);
} }
#region 12.11.18 / 6.3.21 / 23.5.22 / 26.10.24 / 27.1.26: globale Plausi-Prüfungen #region 12.11.18 / 6.3.21 / 23.5.22 / 26.10.24: globale Plausi-Prüfungen
Message crewaMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWA); Message crewaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWA);
Message crewdMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWD); Message crewdMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWD);
Message pasaMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.PASA); Message pasaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PASA);
Message pasdMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.PASD); Message pasdMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PASD);
Message pobaMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA); Message pobaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBA);
Message pobdMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBD); Message pobdMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.POBD);
Message secMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.SEC); Message secMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.SEC);
Message noanodMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.NOA_NOD); Message noanodMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.NOA_NOD);
Message mdhMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.MDH); Message mdhMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.MDH);
Message was_rcptMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.WAS_RCPT); Message was_rcptMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.WAS_RCPT);
Message wasMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.WAS); Message wasMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.WAS);
Message servMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.SERV); Message servMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.SERV);
Message statMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.STAT); Message statMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.STAT);
Message pre72hMessage = messagesSnapshot.Find(message => message.MessageNotificationClass == Message.NotificationClass.PRE72H); Message pre72hMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.PRE72H);
#region CREW / PAS Count Plausibility #region CREW / PAS Count Plausibility
@ -1017,6 +984,22 @@ namespace ENI2
#endregion #endregion
#region 4.1.23 no CREW effects warning for DE
if (crewaMessage != null)
{
MessageViolation mv = crewaMessage.ViolationList.Find((x) => x.PropertyName.Equals("Effects") && (x.ViolationCode == (int)ValidationCode.TRUNCATE));
if ((mv != null) && !Core.IsDK)
crewaMessage.ViolationList.Remove(mv);
}
if(crewdMessage != null)
{
MessageViolation mvd = crewdMessage.ViolationList.Find((x) => x.PropertyName.Equals("Effects") && (x.ViolationCode == (int)ValidationCode.TRUNCATE));
if ((mvd != null) && !Core.IsDK)
crewdMessage.ViolationList.Remove(mvd);
}
#endregion
#region WAS_RCPT double numbers #region WAS_RCPT double numbers
Dictionary<string, string> identDict = new Dictionary<string, string>(); Dictionary<string, string> identDict = new Dictionary<string, string>();
@ -1044,37 +1027,35 @@ namespace ENI2
#region Kiel Canal Timing Plausibility #region Kiel Canal Timing Plausibility
if (!this.Core.IsTransit && (secMessage?.Elements.Count > 0) && (noanodMessage?.Elements.Count > 0))
{ {
if (!this.Core.IsTransit && (secMessage?.Elements.Count > 0) && (noanodMessage?.Elements.Count > 0)) SEC sec = secMessage.Elements[0] as SEC;
NOA_NOD noa_nod = noanodMessage.Elements[0] as NOA_NOD;
if (sec.KielCanalPassagePlanned ?? false)
{ {
SEC sec = secMessage.Elements[0] as SEC; // Überprüfung, ob die eingehende NOK-Durchfahrt auch wirklich innerhalb der eingehenden Reise liegt (bei VISIT)
NOA_NOD noa_nod = noanodMessage.Elements[0] as NOA_NOD; bool isValidIncoming = (noa_nod.ETDFromLastPort < sec.KielCanalPassagePlannedIncomming) &&
(sec.KielCanalPassagePlannedIncomming < noa_nod.ETAToPortOfCall);
if (!sec.KielCanalPassagePlannedIncomming.HasValue) isValidIncoming = true;
if (sec.KielCanalPassagePlanned ?? false) if(!isValidIncoming)
{ {
// Überprüfung, ob die eingehende NOK-Durchfahrt auch wirklich innerhalb der eingehenden Reise liegt (bei VISIT) MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Kiel Canal incoming implausible (ETD / ETA ports)!", null, "Kiel Canal timing", null, "SEC");
bool isValidIncoming = (noa_nod.ETDFromLastPort < sec.KielCanalPassagePlannedIncomming) && mv.MessageGroupName = Properties.Resources.textOverview;
(sec.KielCanalPassagePlannedIncomming < noa_nod.ETAToPortOfCall); vViolations.Add(mv);
if (!sec.KielCanalPassagePlannedIncomming.HasValue) isValidIncoming = true; }
if (!isValidIncoming)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Kiel Canal incoming implausible (ETD / ETA ports)!", null, "Kiel Canal timing", null, "SEC");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
}
bool isValidOutgoing = (noa_nod.ETDFromPortOfCall < sec.KielCanalPassagePlannedOutgoing) && bool isValidOutgoing = (noa_nod.ETDFromPortOfCall < sec.KielCanalPassagePlannedOutgoing) &&
((noa_nod.NextPort == "ZZUKN") || (sec.KielCanalPassagePlannedOutgoing < noa_nod.ETAToNextPort)); ((noa_nod.NextPort == "ZZUKN") || (sec.KielCanalPassagePlannedOutgoing < noa_nod.ETAToNextPort));
if (!sec.KielCanalPassagePlannedOutgoing.HasValue) isValidOutgoing = true; if (!sec.KielCanalPassagePlannedOutgoing.HasValue) isValidOutgoing = true;
if (!isValidOutgoing) if(!isValidOutgoing)
{ {
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Kiel Canal outgoing implausible (ETD / ETA ports)!", null, "Kiel Canal timing", null, "SEC"); MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Kiel Canal outgoing implausible (ETD / ETA ports)!", null, "Kiel Canal timing", null, "SEC");
mv.MessageGroupName = Properties.Resources.textOverview; mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv); vViolations.Add(mv);
}
} }
} }
} }
@ -1231,133 +1212,19 @@ namespace ENI2
#endregion #endregion
#region WAS special max capa rules regarding next port #endregion
foreach (MessageError me in vErrors)
{ {
string wasMessageGroup = this.MessageGroupForMessage(wasMessage); this.highlightService.HighlightError(me, this.GetContainerForMessageGroupName(me.MessageGroupName));
}
// see WAS-Regulation.docx in parent projects misc folder foreach (MessageViolation mv in vViolations)
if ((noanodMessage?.Elements.Count > 0) && wasMessage?.Elements.Count > 0) {
{ this.highlightService.HighlightViolation(mv, this.GetContainerForMessageGroupName(mv.MessageGroupName));
NOA_NOD noa_nod = noanodMessage.Elements[0] as NOA_NOD;
WAS was = wasMessage.Elements[0] as WAS;
bool isSpecialNextPort = RuleEngine.IsSpecialNextPort(noa_nod.NextPort);
if (isSpecialNextPort)
{
foreach (Waste waste in was.Waste)
{
switch (waste.WasteType)
{
case 101:
case 102:
case 103:
case 104:
case 105:
case 401:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.5)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
case 501:
case 502:
case 503:
case 504:
case 505:
case 506:
case 507:
case 508:
case 509:
case 510:
case 511:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.25)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
case 601:
case 602:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.75)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
}
}
}
else
{
foreach (Waste waste in was.Waste)
{
switch (waste.WasteType)
{
case 101:
case 102:
case 103:
case 104:
case 105:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.25)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
case 401:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.5)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
case 501:
case 502:
case 503:
case 504:
case 505:
case 506:
case 507:
case 508:
case 509:
case 510:
case 511:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.2)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
case 601:
case 602:
if (waste.WasteAmountRetained_MTQ > waste.WasteCapacity_MTQ * 0.25)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Acc. to EU Regulation 2022/89 the amount retained on board is noticeably", null, "Waste", waste.Identifier, was.Tablename);
mv.MessageGroupName = wasMessageGroup;
vViolations.Add(mv);
}
break;
}
}
}
}
} }
#endregion
#endregion
// "neue" regelbasierte Validierung: Hier werden die einzelnen Regeln geprüft. // "neue" regelbasierte Validierung: Hier werden die einzelnen Regeln geprüft.
bsmd.database.ValidationRule.PrepareNameLookupDict(this.Core, messagesSnapshot); bsmd.database.ValidationRule.PrepareNameLookupDict(this.Core, this._messages);
List<bsmd.database.ValidationRule> validationRules = DBManager.Instance.GetValidationRules(); List<bsmd.database.ValidationRule> validationRules = DBManager.Instance.GetValidationRules();
@ -1384,94 +1251,10 @@ namespace ENI2
} }
} }
// Recompute per-message counts after all global validations
Dictionary<Message, MessageValidationCounts> counts = new Dictionary<Message, MessageValidationCounts>();
int assignViolationCounter = 0;
int assignErrorCounter = 0;
List<MessageViolation> tmpVList = new List<MessageViolation>(vViolations);
List<MessageError> tmpEList = new List<MessageError>(vErrors);
foreach (Message aMessage in messagesSnapshot)
{
counts[aMessage] = new MessageValidationCounts();
counts[aMessage].ErrorCount = tmpEList.Count(me => me.NotificationClass == aMessage.MessageNotificationClassDisplay); // generic
// special cases
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.WAS_RCPT) && (me.NotificationClass == "WasteReceived"));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IMDGPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IGCPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IBCPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IMSBCPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "MARPOL_Annex_I_Position") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IMDGPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IGCPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IBCPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IMSBCPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "MARPOL_Annex_I_Position") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) && (me.NotificationClass == "Waste"));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) && (me.NotificationClass == "LastTenPortFacilitiesCalled"));
counts[aMessage].ErrorCount += tmpEList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) && (me.NotificationClass == "ShipToShipActivitiesDuringLastTenPortFacilitiesCalled"));
if (counts[aMessage].ErrorCount == 0) counts[aMessage].ErrorCount = null; // set to empty if nothing counted
assignErrorCounter += counts[aMessage].ErrorCount ?? 0;
counts[aMessage].ViolationCount = vViolations.Count(mv => mv.NotificationClass == aMessage.MessageNotificationClassDisplay); // generic
// special cases
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.WAS_RCPT) && (me.NotificationClass == "WasteReceived"));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IMDGPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IGCPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IBCPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "IMSBCPosition") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZA) && (me.NotificationClass == "MARPOL_Annex_I_Position") && me.MessageGroupName.Contains("arrival", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IMDGPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IGCPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IBCPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "IMSBCPosition") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD) && (me.NotificationClass == "MARPOL_Annex_I_Position") && me.MessageGroupName.Contains("departure", StringComparison.OrdinalIgnoreCase));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.WAS) && (me.NotificationClass == "Waste"));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) && (me.NotificationClass == "LastTenPortFacilitiesCalled"));
counts[aMessage].ViolationCount += tmpVList.Count(me => (aMessage.MessageNotificationClass == Message.NotificationClass.SEC) && (me.NotificationClass == "ShipToShipActivitiesDuringLastTenPortFacilitiesCalled"));
if (counts[aMessage].ViolationCount == 0) counts[aMessage].ViolationCount = null;
assignViolationCounter += counts[aMessage].ViolationCount ?? 0;
}
Trace.WriteLine(string.Format("Unassigned errors: {0}, unassigned violations: {1}", vErrors.Count - assignErrorCounter, vViolations.Count - assignViolationCounter));
return new ValidationResult(vViolations, vErrors, counts);
}
private void ApplyValidationResult(ValidationResult result, bool showMessages)
{
// TODO: clear highlighting
foreach (KeyValuePair<Message, MessageValidationCounts> entry in result.Counts)
{
Message aMessage = entry.Key;
MessageValidationCounts messageCounts = entry.Value;
aMessage.ErrorCount = messageCounts.ErrorCount;
aMessage.ViolationCount = messageCounts.ViolationCount;
}
foreach (MessageError me in result.Errors)
{
this.highlightService.HighlightError(me, this.GetContainerForMessageGroupName(me.MessageGroupName));
}
foreach (MessageViolation mv in result.Violations)
{
this.highlightService.HighlightViolation(mv, this.GetContainerForMessageGroupName(mv.MessageGroupName));
}
if (showMessages) if (showMessages)
{ {
// Show error and violation dialog // Show error and violation dialog
if (result.Errors.Count > 0) if (vErrors.Count > 0)
{ {
if(this._errorListDialog == null) if(this._errorListDialog == null)
{ {
@ -1486,10 +1269,10 @@ namespace ENI2
{ {
this._errorListDialog.BringUp(); this._errorListDialog.BringUp();
} }
this._errorListDialog.Errors = result.Errors; this._errorListDialog.Errors = vErrors;
} }
if (result.Violations.Count > 0) if (vViolations.Count > 0)
{ {
if(this._violationListDialog == null) if(this._violationListDialog == null)
{ {
@ -1504,62 +1287,15 @@ namespace ENI2
{ {
this._violationListDialog.BringUp(); this._violationListDialog.BringUp();
} }
_violationListDialog.Violations = result.Violations; _violationListDialog.Violations = vViolations;
} }
if((result.Errors.Count == 0) && (result.Violations.Count == 0)) if((vErrors.Count == 0) && (vViolations.Count == 0))
{ {
MessageBox.Show(Properties.Resources.textValidationOK, Properties.Resources.textValidation, MessageBoxButton.OK, MessageBoxImage.Information); MessageBox.Show(Properties.Resources.textValidationOK, Properties.Resources.textValidation, MessageBoxButton.OK, MessageBoxImage.Information);
} }
} }
if (controlCache.TryGetValue(Properties.Resources.textOverview, out DetailBaseControl overviewControl) &&
overviewControl is OverViewDetailControl ovdc)
{
ovdc.RefreshMessageGrid();
}
}
private void ApplyCrewEffectsWarningSuppression()
{
// 4.1.23 no CREW effects warning for DE
Message crewaMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWA);
Message crewdMessage = _messages.Find(message => message.MessageNotificationClass == Message.NotificationClass.CREWD);
if (crewaMessage != null)
{
MessageViolation mv = crewaMessage.ViolationList.Find((x) => x.PropertyName.Equals("Effects") && (x.ViolationCode == (int)ValidationCode.TRUNCATE));
if ((mv != null) && !Core.IsDK)
crewaMessage.ViolationList.Remove(mv);
}
if(crewdMessage != null)
{
MessageViolation mvd = crewdMessage.ViolationList.Find((x) => x.PropertyName.Equals("Effects") && (x.ViolationCode == (int)ValidationCode.TRUNCATE));
if ((mvd != null) && !Core.IsDK)
crewdMessage.ViolationList.Remove(mvd);
}
}
private sealed class ValidationResult
{
internal ValidationResult(List<MessageViolation> violations, List<MessageError> errors, Dictionary<Message, MessageValidationCounts> counts)
{
Violations = violations;
Errors = errors;
Counts = counts;
}
internal List<MessageViolation> Violations { get; }
internal List<MessageError> Errors { get; }
internal Dictionary<Message, MessageValidationCounts> Counts { get; }
}
private sealed class MessageValidationCounts
{
internal int? ErrorCount { get; set; }
internal int? ViolationCount { get; set; }
internal int? PositionViolationCount { get; set; }
} }
private void _errorListDialog_RefreshClicked() private void _errorListDialog_RefreshClicked()

View File

@ -1051,8 +1051,7 @@ namespace ENI2.DetailViewControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present
@ -1122,8 +1121,7 @@ namespace ENI2.DetailViewControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present
@ -1194,8 +1192,7 @@ namespace ENI2.DetailViewControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); var worksheet = workbook.Worksheet(1);
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present
@ -1271,8 +1268,7 @@ namespace ENI2.DetailViewControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); var worksheet = workbook.Worksheet(1);
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present

View File

@ -370,11 +370,6 @@ namespace ENI2.DetailViewControls
this.Core.IsDirty = false; // ist ja schon gespeichert.. this.Core.IsDirty = false; // ist ja schon gespeichert..
} }
internal void RefreshMessageGrid()
{
this.dataGridMessages?.Items?.Refresh();
}
#endregion #endregion
#region private methods #region private methods

View File

@ -5,7 +5,6 @@
using bsmd.database; using bsmd.database;
using ClosedXML.Excel; using ClosedXML.Excel;
using ENI2.EditControls; using ENI2.EditControls;
using ENI2.Excel;
using ENI2.Util; using ENI2.Util;
using Microsoft.Win32; using Microsoft.Win32;
using System; using System;
@ -480,14 +479,87 @@ namespace ENI2.DetailViewControls
private void buttonImportFromExcel_Click(object sender, RoutedEventArgs e) private void buttonImportFromExcel_Click(object sender, RoutedEventArgs e)
{ {
int importWasteListCnt = ExcelLocalImportHelper.ImportWaste(_was); OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|*.xls;*.xlsx";
if (importWasteListCnt > 0) if (ofd.ShowDialog() ?? false)
{ {
this.dataGridWaste.Items.Refresh(); try
this.SublistElementChanged(Message.NotificationClass.WAS); {
MessageBox.Show(String.Format(Properties.Resources.textWasteImported, importWasteListCnt), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information); using (var workbook = new XLWorkbook(ofd.FileName))
} {
var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(3); // Skip first three rows
List<Waste> importWasteList = new List<Waste>();
int cnt = 0;
object o = null;
// Diese Funktion kann das "alte" Sheet Format nicht mehr einlesen!
foreach (var row in rows)
{
if (cnt >= 35) break; // Maximum 35 rows
if (worksheet.RangeUsed().ColumnCount() < 9)
{
throw new InvalidDataException("Sheet must have 9 Columns of data");
}
if (!row.Cell(2).IsEmpty()) o = row.Cell(2).Value; else o = null;
if ((o != null) && Int32.TryParse(o.ToString(), out int wasteType))
{
Waste waste = _was.GetWasteForType(wasteType);
if (waste == null)
{
waste = new Waste();
waste.WasteType = wasteType;
waste.WAS = this._was;
waste.IsDirty = true;
waste.Identifier = Waste.GetNewIdentifier(this._was.Waste);
this._was.Waste.Add(waste);
}
else
{
waste.IsDirty = true;
}
if (!row.Cell(5).IsEmpty()) waste.WasteDescription = row.Cell(5).GetString();
if (waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (!row.Cell(6).IsEmpty()) o = row.Cell(6).Value; else o = null;
if (o != null) waste.WasteDisposalAmount_MTQ = Convert.ToDouble(o);
if (!row.Cell(7).IsEmpty()) o = row.Cell(7).Value; else o = null;
if (o != null) waste.WasteCapacity_MTQ = Convert.ToDouble(o);
if (!row.Cell(8).IsEmpty()) o = row.Cell(8).Value; else o = null;
if (o != null) waste.WasteAmountRetained_MTQ = Convert.ToDouble(o);
if (!row.Cell(9).IsEmpty()) waste.WasteDisposalPort = row.Cell(9).GetString().ToUpper();
if (!row.Cell(10).IsEmpty()) o = row.Cell(10).Value; else o = null;
if (o != null) waste.WasteAmountGeneratedTillNextPort_MTQ = Convert.ToDouble(o);
importWasteList.Add(waste);
cnt++;
}
}
if (importWasteList.Count > 0)
{
this.dataGridWaste.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.WAS);
MessageBox.Show(String.Format(Properties.Resources.textWasteImported, importWasteList.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
}
} }

View File

@ -8,7 +8,7 @@
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ENI2</RootNamespace> <RootNamespace>ENI2</RootNamespace>
<AssemblyName>ENI2Test</AssemblyName> <AssemblyName>ENI2</AssemblyName>
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
@ -18,7 +18,7 @@
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<PublishUrl>eni_test\</PublishUrl> <PublishUrl>ENI2.publish\</PublishUrl>
<Install>true</Install> <Install>true</Install>
<InstallFrom>Web</InstallFrom> <InstallFrom>Web</InstallFrom>
<UpdateEnabled>true</UpdateEnabled> <UpdateEnabled>true</UpdateEnabled>
@ -28,16 +28,16 @@
<UpdatePeriodically>false</UpdatePeriodically> <UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired> <UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<InstallUrl>http://192.168.2.24/eni_test/</InstallUrl> <InstallUrl>http://192.168.2.24/eni2.publish/</InstallUrl>
<SupportUrl>http://www.textbausteine.net/</SupportUrl> <SupportUrl>http://www.textbausteine.net/</SupportUrl>
<ProductName>ENI Testversion</ProductName> <ProductName>ENI</ProductName>
<PublisherName>Informatikbüro Daniel Schick</PublisherName> <PublisherName>Informatikbüro Daniel Schick</PublisherName>
<SuiteName>NSW</SuiteName> <SuiteName>NSW</SuiteName>
<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>2</ApplicationRevision> <ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.2.14.2</ApplicationVersion> <ApplicationVersion>7.2.13.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -4,11 +4,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textCompareExcel}" Height="260" Width="600" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_grey.ico"> Title="{x:Static p:Resources.textCompareExcel}" Height="260" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_grey.ico">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="32" /> <RowDefinition Height="32" />

View File

@ -4,11 +4,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textCopyDeclaration}" Height="326" Width="440" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2Test;component/Resources/id_cards.ico"> Title="{x:Static p:Resources.textCopyDeclaration}" Height="326" Width="440" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2;component/Resources/id_cards.ico">
<Grid Margin="5"> <Grid Margin="5">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28" /> <RowDefinition Height="28" />
@ -34,28 +34,28 @@
<Label Name="labelCopy" Grid.Row="6" Grid.Column="0" Content="Copy" /> <Label Name="labelCopy" Grid.Row="6" Grid.Column="0" Content="Copy" />
<TextBox Name="textBoxVisitTransitId" Margin="2" Grid.Row="0" Grid.Column="1" TextChanged="textBoxVisitTransitId_TextChanged" VerticalContentAlignment="Center"/> <TextBox Name="textBoxVisitTransitId" Margin="2" Grid.Row="0" Grid.Column="1" TextChanged="textBoxVisitTransitId_TextChanged" VerticalContentAlignment="Center"/>
<Image Grid.Row="0" Grid.Column="2" Name="okCheckMark" Source="pack://application:,,,/Resources/check.png" Margin="2" Visibility="Hidden" /> <Image Grid.Row="0" Grid.Column="2" Name="okCheckMark" Source="pack://application:,,,/Resources/check.png" Margin="2" Visibility="Hidden" />
<xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" <xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
ClipValueToMinMax="True" ClipValueToMinMax="True"
ShowButtonSpinner="False" ShowButtonSpinner="False"
AllowSpin="True" AllowSpin="True"
AllowTextInput="True" AllowTextInput="True"
IsReadOnly="False" IsReadOnly="False"
MouseWheelActiveOnFocus="True" MouseWheelActiveOnFocus="True"
FormatString="G" FormatString="G"
Increment="1" Increment="1"
DisplayDefaultValueOnEmptyText="False" DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right" ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer" ParsingNumberStyle="Integer"
Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged" TextAlignment="Left"/> Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged" TextAlignment="Left"/>
<xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" <xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
ClipValueToMinMax="True" ClipValueToMinMax="True"
ShowButtonSpinner="False" ShowButtonSpinner="False"
AllowSpin="True" AllowSpin="True"
AllowTextInput="True" AllowTextInput="True"
IsReadOnly="False" IsReadOnly="False"
MouseWheelActiveOnFocus="True" MouseWheelActiveOnFocus="True"
FormatString="00000000" FormatString="00000000"
Increment="1" Increment="1"
DisplayDefaultValueOnEmptyText="False" DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right" ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer" ParsingNumberStyle="Integer"
@ -78,4 +78,3 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
</enictrl:EditWindowBase> </enictrl:EditWindowBase>

View File

@ -8,7 +8,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textCoreStatus}" Height="436" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_grey.ico" > Title="{x:Static p:Resources.textCoreStatus}" Height="436" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_grey.ico" >
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*"/> <ColumnDefinition Width="0.3*"/>
@ -22,7 +22,7 @@
<RowDefinition Height="80" /> <RowDefinition Height="80" />
<RowDefinition Height="28" /> <RowDefinition Height="28" />
<RowDefinition Height="28"> <RowDefinition Height="28">
</RowDefinition> </RowDefinition>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textCancelled}" /> <Label Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textCancelled}" />

View File

@ -9,7 +9,7 @@
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textEditRules}" Height="402" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2Test;component/Resources/mail_forward.png"> Title="{x:Static p:Resources.textEditRules}" Height="402" Width="800" WindowStyle="SingleBorderWindow" Background="AliceBlue" Icon="/ENI2;component/Resources/mail_forward.png">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="32" /> <RowDefinition Height="32" />
@ -76,8 +76,8 @@
<GroupBox Name="groupBoxConditionDetails" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" Margin="0" Header="{x:Static p:Resources.textCondition}"> <GroupBox Name="groupBoxConditionDetails" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="2" Margin="0" Header="{x:Static p:Resources.textCondition}">
<Grid Name="groupBoxConditionContainer"> <Grid Name="groupBoxConditionContainer">
</Grid> </Grid>
</GroupBox> </GroupBox>
</Grid> </Grid>

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textErrors}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_red.ico" Topmost="False"> Title="{x:Static p:Resources.textErrors}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_red.ico" Topmost="False">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />

View File

@ -7,7 +7,7 @@
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textMessageHistory}" Height="450" Width="800" Background="AliceBlue" Icon="/ENI2Test;component/Resources/clock_history.ico"> Title="{x:Static p:Resources.textMessageHistory}" Height="450" Width="800" Background="AliceBlue" Icon="/ENI2;component/Resources/clock_history.ico">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />
@ -15,8 +15,8 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<enictrl:ENIDataGrid Grid.Row="0" Grid.Column="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="0" Grid.Column="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="5,5,5,0" x:Name="dataGridMessageHistories" SelectionMode="Single" AutoGenerateColumns="False" Margin="5,5,5,0" x:Name="dataGridMessageHistories"
MouseDoubleClick="DataGridViolations_MouseDoubleClick" CanUserAddRows="False"> MouseDoubleClick="DataGridViolations_MouseDoubleClick" CanUserAddRows="False">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textType}" Binding="{Binding EntityName}" IsReadOnly="True" Width="0.05*" > <DataGridTextColumn Header="{x:Static p:Resources.textType}" Binding="{Binding EntityName}" IsReadOnly="True" Width="0.05*" >

View File

@ -4,12 +4,12 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textNewDGItem}" Height="350" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize" Title="{x:Static p:Resources.textNewDGItem}" Height="350" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize"
Icon="/ENI2Test;component/Resources/bullet_ball_yellow.ico" Loaded="EditWindowBase_Loaded"> Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Loaded="EditWindowBase_Loaded">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28" /> <RowDefinition Height="28" />

View File

@ -4,12 +4,12 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textNewWithId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2Test;component/Resources/id_card_add.ico"> Title="{x:Static p:Resources.textNewWithId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2;component/Resources/id_card_add.ico">
<Grid Margin="4"> <Grid Margin="4">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28" /> <RowDefinition Height="28" />
@ -30,29 +30,29 @@
<Label Name="labelENI" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textENI}" /> <Label Name="labelENI" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textENI}" />
<Label Name="labelETA" Grid.Row="3" Grid.Column="0" Content="ETA" /> <Label Name="labelETA" Grid.Row="3" Grid.Column="0" Content="ETA" />
<Label Name="labelHIS" Grid.Row="4" Grid.Column="0" Content="HIS" /> <Label Name="labelHIS" Grid.Row="4" Grid.Column="0" Content="HIS" />
<xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" <xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
ClipValueToMinMax="True" ClipValueToMinMax="True"
ShowButtonSpinner="False" ShowButtonSpinner="False"
AllowSpin="True" AllowSpin="True"
AllowTextInput="True" AllowTextInput="True"
IsReadOnly="False" IsReadOnly="False"
MouseWheelActiveOnFocus="True" MouseWheelActiveOnFocus="True"
FormatString="G" FormatString="G"
Increment="1" Increment="1"
DisplayDefaultValueOnEmptyText="False" DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right" ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer" ParsingNumberStyle="Integer"
Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged" Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged"
TextAlignment="Left" /> TextAlignment="Left" />
<xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" <xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2"
ClipValueToMinMax="True" ClipValueToMinMax="True"
ShowButtonSpinner="False" ShowButtonSpinner="False"
AllowSpin="True" AllowSpin="True"
AllowTextInput="True" AllowTextInput="True"
IsReadOnly="False" IsReadOnly="False"
MouseWheelActiveOnFocus="True" MouseWheelActiveOnFocus="True"
FormatString="00000000" FormatString="00000000"
Increment="1" Increment="1"
DisplayDefaultValueOnEmptyText="False" DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right" ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer" ParsingNumberStyle="Integer"

View File

@ -8,7 +8,7 @@
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
mc:Ignorable="d" mc:Ignorable="d"
Title="Search port area" Height="400" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize" Icon="/ENI2Test;component/Resources/bullet_ball_yellow.ico" Loaded="Window_Loaded"> Title="Search port area" Height="400" Width="600" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="CanResize" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Loaded="Window_Loaded">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28" /> <RowDefinition Height="28" />
@ -19,7 +19,7 @@
<RowDefinition Height="28" /> <RowDefinition Height="28" />
<RowDefinition Height="90" /> <RowDefinition Height="90" />
<RowDefinition Height="28" /> <RowDefinition Height="28" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="80" /> <ColumnDefinition Width="80" />

View File

@ -8,7 +8,7 @@
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textViolations}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2Test;component/Resources/bullet_ball_yellow.ico" Topmost="False"> Title="{x:Static p:Resources.textViolations}" Height="300" Width="600" Background="AliceBlue" Icon="/ENI2;component/Resources/bullet_ball_yellow.ico" Topmost="False">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*" /> <RowDefinition Height="*" />
@ -16,7 +16,7 @@
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<enictrl:ENIDataGrid Grid.Row="0" Grid.Column="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="0" Grid.Column="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="5,5,5,0" x:Name="dataGridViolations"> SelectionMode="Single" AutoGenerateColumns="False" Margin="5,5,5,0" x:Name="dataGridViolations">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding ViolationCode}" IsReadOnly="True" Width="0.05*" /> <DataGridTextColumn Header="{x:Static p:Resources.textCode}" Binding="{Binding ViolationCode}" IsReadOnly="True" Width="0.05*" />

View File

@ -4,11 +4,11 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ENI2.EditControls" xmlns:local="clr-namespace:ENI2.EditControls"
xmlns:enictrl="clr-namespace:ENI2.Controls" xmlns:enictrl="clr-namespace:ENI2.Controls"
xmlns:p="clr-namespace:ENI2.Properties" xmlns:p="clr-namespace:ENI2.Properties"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d" mc:Ignorable="d"
Title="{x:Static p:Resources.textNewVisitTransitId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2Test;component/Resources/id_card_new.ico"> Title="{x:Static p:Resources.textNewVisitTransitId}" Height="220" Width="350" WindowStyle="SingleBorderWindow" Background="AliceBlue" ResizeMode="NoResize" Icon="/ENI2;component/Resources/id_card_new.ico">
<Grid Margin="4"> <Grid Margin="4">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="28" /> <RowDefinition Height="28" />
@ -26,28 +26,28 @@
<Label Name="labelPoC" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textPortCall}" /> <Label Name="labelPoC" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textPortCall}" />
<Label Name="labelETA" Grid.Row="3" Grid.Column="0" Content="ETA" /> <Label Name="labelETA" Grid.Row="3" Grid.Column="0" Content="ETA" />
<Label Name="labelHIS" Grid.Row="4" Grid.Column="0" Content="HIS" /> <Label Name="labelHIS" Grid.Row="4" Grid.Column="0" Content="HIS" />
<xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="0" Grid.Column="1" <xctk:DoubleUpDown x:Name="doubleUpDownIMO" Margin="2" Grid.Row="0" Grid.Column="1"
ClipValueToMinMax="True" ClipValueToMinMax="True"
ShowButtonSpinner="False" ShowButtonSpinner="False"
AllowSpin="True" AllowSpin="True"
AllowTextInput="True" AllowTextInput="True"
IsReadOnly="False" IsReadOnly="False"
MouseWheelActiveOnFocus="True" MouseWheelActiveOnFocus="True"
FormatString="G" FormatString="G"
Increment="1" Increment="1"
DisplayDefaultValueOnEmptyText="False" DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right" ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer" ParsingNumberStyle="Integer"
Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged" TextAlignment="Left"/> Watermark="Enter IMO" ValueChanged="doubleUpDownIMO_ValueChanged" TextAlignment="Left"/>
<xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="1" Grid.Column="1" <xctk:DoubleUpDown x:Name="doubleUpDownENI" Margin="2" Grid.Row="1" Grid.Column="1"
ClipValueToMinMax="True" ClipValueToMinMax="True"
ShowButtonSpinner="False" ShowButtonSpinner="False"
AllowSpin="True" AllowSpin="True"
AllowTextInput="True" AllowTextInput="True"
IsReadOnly="False" IsReadOnly="False"
MouseWheelActiveOnFocus="True" MouseWheelActiveOnFocus="True"
FormatString="00000000" FormatString="00000000"
Increment="1" Increment="1"
DisplayDefaultValueOnEmptyText="False" DisplayDefaultValueOnEmptyText="False"
ButtonSpinnerLocation="Right" ButtonSpinnerLocation="Right"
ParsingNumberStyle="Integer" ParsingNumberStyle="Integer"

View File

@ -9,7 +9,6 @@ using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.IO;
namespace ENI2.Excel namespace ENI2.Excel
{ {
@ -23,7 +22,6 @@ namespace ENI2.Excel
protected CountryMode _countryMode = CountryMode.DE; protected CountryMode _countryMode = CountryMode.DE;
protected XLWorkbook _workBook; protected XLWorkbook _workBook;
protected FileStream _workBookStream;
protected Dictionary<string, IXLDefinedName> _nameDict; protected Dictionary<string, IXLDefinedName> _nameDict;
protected ILog _log; protected ILog _log;
@ -103,12 +101,6 @@ namespace ENI2.Excel
} }
} }
protected void OpenWorkbookReadOnly(string path)
{
_workBookStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
_workBook = new XLWorkbook(_workBookStream);
}
private static double? ParseAnyDouble(string val) private static double? ParseAnyDouble(string val)
{ {
double? result = null; double? result = null;
@ -220,11 +212,6 @@ namespace ENI2.Excel
_workBook.Dispose(); _workBook.Dispose();
_workBook = null; _workBook = null;
} }
if (_workBookStream != null)
{
_workBookStream.Dispose();
_workBookStream = null;
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -235,4 +222,4 @@ namespace ENI2.Excel
#endregion #endregion
} }
} }

View File

@ -53,8 +53,7 @@ namespace ENI2.Excel
{ {
File.Copy(targetPath, comparisonFileName, true); File.Copy(targetPath, comparisonFileName, true);
using (var sourceStream = new FileStream(sourcePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var sourceWorkbook = new XLWorkbook(sourcePath))
using (var sourceWorkbook = new XLWorkbook(sourceStream))
using (var comparisonWorkbook = new XLWorkbook(comparisonFileName)) using (var comparisonWorkbook = new XLWorkbook(comparisonFileName))
{ {
// Es werden Zellen der "used range" miteinander verglichen // Es werden Zellen der "used range" miteinander verglichen
@ -77,7 +76,6 @@ namespace ENI2.Excel
{ {
int maxRows = Math.Max(sourceRows, targetRows); int maxRows = Math.Max(sourceRows, targetRows);
int maxCols = Math.Max(sourceCols, targetCols); int maxCols = Math.Max(sourceCols, targetCols);
bool sheetHasDiffs = false;
for (int rowidx = 1; rowidx <= maxRows; rowidx++) for (int rowidx = 1; rowidx <= maxRows; rowidx++)
{ {
@ -113,7 +111,6 @@ namespace ENI2.Excel
var cellToHighlight = targetSheet.Cell(rowidx, colidx); var cellToHighlight = targetSheet.Cell(rowidx, colidx);
cellToHighlight.Style.Fill.BackgroundColor = diffColor; cellToHighlight.Style.Fill.BackgroundColor = diffColor;
counter++; counter++;
sheetHasDiffs = true;
} }
} }
else if (targetText == null) else if (targetText == null)
@ -123,7 +120,6 @@ namespace ENI2.Excel
var cellToHighlight = targetSheet.Cell(rowidx, colidx); var cellToHighlight = targetSheet.Cell(rowidx, colidx);
cellToHighlight.Style.Fill.BackgroundColor = diffColor; cellToHighlight.Style.Fill.BackgroundColor = diffColor;
counter++; counter++;
sheetHasDiffs = true;
} }
} }
else if ((sourceText != null) && (targetText != null)) else if ((sourceText != null) && (targetText != null))
@ -133,16 +129,10 @@ namespace ENI2.Excel
var cellToHighlight = targetSheet.Cell(rowidx, colidx); var cellToHighlight = targetSheet.Cell(rowidx, colidx);
cellToHighlight.Style.Fill.BackgroundColor = diffColor; cellToHighlight.Style.Fill.BackgroundColor = diffColor;
counter++; counter++;
sheetHasDiffs = true;
} }
} }
} }
} }
if (sheetHasDiffs)
{
targetSheet.SetTabColor(diffColor);
}
} }
else else
{ {
@ -162,4 +152,4 @@ namespace ENI2.Excel
return comparisonFileName; return comparisonFileName;
} }
} }
} }

View File

@ -4,7 +4,6 @@ using Microsoft.Win32;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Windows; using System.Windows;
namespace ENI2.Excel namespace ENI2.Excel
@ -27,8 +26,7 @@ namespace ENI2.Excel
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); var worksheet = workbook.Worksheet(1);
var rows = worksheet.RangeUsed().RowsUsed(); var rows = worksheet.RangeUsed().RowsUsed();
@ -42,7 +40,7 @@ namespace ENI2.Excel
List<LastTenPortFacilitiesCalled> importL10C = new List<LastTenPortFacilitiesCalled>(); List<LastTenPortFacilitiesCalled> importL10C = new List<LastTenPortFacilitiesCalled>();
foreach (var row in rows) foreach (var row in rows)
{ {
if (cnt >= 10) break; // Maximum 10 rows if (cnt >= 10) break; // Maximum 10 rows
@ -116,7 +114,7 @@ namespace ENI2.Excel
{ {
throw new InvalidDataException($"Error processing row {row.RowNumber()}: {ex.Message}", ex); throw new InvalidDataException($"Error processing row {row.RowNumber()}: {ex.Message}", ex);
} }
} }
} }
} }
catch (Exception ex) catch (Exception ex)
@ -146,8 +144,7 @@ namespace ENI2.Excel
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); var worksheet = workbook.Worksheet(1);
var rows = worksheet.RangeUsed().RowsUsed(); var rows = worksheet.RangeUsed().RowsUsed();
@ -230,7 +227,7 @@ namespace ENI2.Excel
poc30.MDH = mdh; poc30.MDH = mdh;
mdh.PortOfCallLast30Days.Add(poc30); mdh.PortOfCallLast30Days.Add(poc30);
importPoC30.Add(poc30); importPoC30.Add(poc30);
} }
} }
} }
catch (Exception ex) catch (Exception ex)
@ -245,89 +242,5 @@ namespace ENI2.Excel
#endregion #endregion
#region Waste from Excel
public static int ImportWaste(WAS was)
{
int cnt = 0;
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|*.xls;*.xlsx";
if (ofd.ShowDialog() ?? false)
{
try
{
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var workbook = new XLWorkbook(stream))
{
var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(3); // Skip first three rows
List<Waste> importWasteList = new List<Waste>();
object o = null;
// Diese Funktion kann das "alte" Sheet Format nicht mehr einlesen!
foreach (var row in rows)
{
if (cnt >= 35) break; // Maximum 35 rows
if (worksheet.RangeUsed().ColumnCount() < 9)
{
throw new InvalidDataException("Sheet must have 9 Columns of data");
}
if (!row.Cell(2).IsEmpty()) o = row.Cell(2).Value; else o = null;
if ((o != null) && Int32.TryParse(o.ToString(), out int wasteType))
{
Waste waste = was.GetWasteForType(wasteType);
if (waste == null)
{
waste = new Waste();
waste.WasteType = wasteType;
waste.WAS = was;
waste.IsDirty = true;
waste.Identifier = Waste.GetNewIdentifier(was.Waste);
was.Waste.Add(waste);
}
else
{
waste.IsDirty = true;
}
if (!row.Cell(5).IsEmpty()) waste.WasteDescription = row.Cell(5).GetString();
if (waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (!row.Cell(6).IsEmpty())
waste.WasteDisposalAmount_MTQ = row.Cell(6).GetDouble();
if (!row.Cell(7).IsEmpty())
waste.WasteCapacity_MTQ = row.Cell(7).GetDouble();
if (!row.Cell(8).IsEmpty()) waste.WasteAmountRetained_MTQ = row.Cell(8).GetDouble();
if (!row.Cell(9).IsEmpty())
waste.WasteDisposalPort = row.Cell(9).GetString().ToUpper();
if (!row.Cell(10).IsEmpty())
waste.WasteAmountGeneratedTillNextPort_MTQ = row.Cell(10).GetDouble();
importWasteList.Add(waste);
cnt++;
}
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
}
return cnt;
}
#endregion
} }
} }

View File

@ -32,7 +32,7 @@ namespace ENI2.Excel
public ExcelReader(string filePath, bool createNameFields = true) public ExcelReader(string filePath, bool createNameFields = true)
{ {
this.OpenWorkbookReadOnly(filePath); this._workBook = new XLWorkbook(filePath);
if (createNameFields) if (createNameFields)
this.InitNameFields(); this.InitNameFields();
@ -793,4 +793,4 @@ namespace ENI2.Excel
#endregion Dakosy-specific functions #endregion Dakosy-specific functions
} }
} }

View File

@ -26,7 +26,7 @@ namespace ENI2.Excel
if (isRefSheet) filename = @"Excel\Reference_Sheet_DE.xlsx"; if (isRefSheet) filename = @"Excel\Reference_Sheet_DE.xlsx";
string refFilePath = System.IO.Path.Combine(Environment.CurrentDirectory, filename); string refFilePath = System.IO.Path.Combine(Environment.CurrentDirectory, filename);
this.OpenWorkbookReadOnly(refFilePath); this._workBook = new XLWorkbook(refFilePath);
this.InitNameFields(); this.InitNameFields();
} }
@ -1426,4 +1426,4 @@ namespace ENI2.Excel
#endregion #endregion
} }
} }

View File

@ -8,11 +8,11 @@
xmlns:ctrl="clr-namespace:ENI2.Controls" xmlns:ctrl="clr-namespace:ENI2.Controls"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:util="clr-namespace:ENI2.Util" xmlns:util="clr-namespace:ENI2.Util"
xmlns:local="clr-namespace:ENI2" xmlns:local="clr-namespace:ENI2"
mc:Ignorable="d" mc:Ignorable="d"
Title="ENI 2 Testversion" Title="ENI 2"
Height="{util:SettingBinding Height}" Width="{util:SettingBinding Width}" Height="{util:SettingBinding Height}" Width="{util:SettingBinding Width}"
Icon="Resources/logo_schwarz.ico" Loaded="Window_Loaded" Closing="Window_Closing" Icon="Resources/logo_schwarz.ico" Loaded="Window_Loaded" Closing="Window_Closing"
SourceInitialized="Window_SourceInitialized"> SourceInitialized="Window_SourceInitialized">
<Window.CommandBindings> <Window.CommandBindings>
@ -23,7 +23,7 @@
<Window.Resources> <Window.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary <ResourceDictionary
Source="ControlTemplates.xaml"> Source="ControlTemplates.xaml">
</ResourceDictionary> </ResourceDictionary>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -128,8 +128,7 @@ namespace ENI2.SheetDisplayControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present

View File

@ -168,8 +168,7 @@ namespace ENI2.SheetDisplayControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present

View File

@ -146,8 +146,7 @@ namespace ENI2.SheetDisplayControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present

View File

@ -128,8 +128,7 @@ namespace ENI2.SheetDisplayControls
{ {
try try
{ {
using (var stream = new FileStream(ofd.FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) using (var workbook = new XLWorkbook(ofd.FileName))
using (var workbook = new XLWorkbook(stream))
{ {
var worksheet = workbook.Worksheet(1); // Get first worksheet var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present var rows = worksheet.RangeUsed().RowsUsed().Skip(1); // Skip header row if present

View File

@ -5,7 +5,6 @@
using bsmd.database; using bsmd.database;
using ClosedXML.Excel; using ClosedXML.Excel;
using ENI2.EditControls; using ENI2.EditControls;
using ENI2.Excel;
using Microsoft.Win32; using Microsoft.Win32;
using System; using System;
@ -515,14 +514,88 @@ namespace ENI2.SheetDisplayControls
private void buttonImportFromExcel_Click(object sender, RoutedEventArgs e) private void buttonImportFromExcel_Click(object sender, RoutedEventArgs e)
{ {
int importWasteListCnt = ExcelLocalImportHelper.ImportWaste(_was); OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|*.xls;*.xlsx";
if (importWasteListCnt > 0) if (ofd.ShowDialog() ?? false)
{ {
this.dataGridWaste.Items.Refresh(); try
this.SublistElementChanged(Message.NotificationClass.WAS); {
MessageBox.Show(String.Format(Properties.Resources.textWasteImported, importWasteListCnt), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information); using (var workbook = new XLWorkbook(ofd.FileName))
} {
var worksheet = workbook.Worksheet(1); // Get first worksheet
var rows = worksheet.RangeUsed().RowsUsed().Skip(3); // Skip first three rows
List<Waste> importWasteList = new List<Waste>();
int cnt = 0;
// Diese Funktion kann das "alte" Sheet Format nicht mehr einlesen!
foreach (var row in rows)
{
if (cnt >= 35) break; // Maximum 35 rows
if (worksheet.RangeUsed().ColumnCount() < 9)
{
throw new InvalidDataException("Sheet must have 9 Columns of data");
}
object o = null;
if (!row.Cell(2).IsEmpty()) o = row.Cell(2).Value; else o = null;
if ((o != null) && Int32.TryParse(o.ToString(), out int wasteType))
{
Waste waste = _was.GetWasteForType(wasteType);
if (waste == null)
{
waste = new Waste();
waste.WasteType = wasteType;
waste.WAS = this._was;
waste.IsDirty = true;
waste.Identifier = Waste.GetNewIdentifier(this._was.Waste);
this._was.Waste.Add(waste);
}
else
{
waste.IsDirty = true;
}
if (!row.Cell(5).IsEmpty()) waste.WasteDescription = row.Cell(5).GetString();
if (waste.WasteDescription.IsNullOrEmpty())
waste.WasteDescription = "-";
if (!row.Cell(6).IsEmpty()) o = row.Cell(6).Value; else o = null;
if (o != null) waste.WasteDisposalAmount_MTQ = Convert.ToDouble(o);
if (!row.Cell(7).IsEmpty()) o = row.Cell(7).Value; else o = null;
if (o != null) waste.WasteCapacity_MTQ = Convert.ToDouble(o);
if (!row.Cell(8).IsEmpty()) o = row.Cell(8).Value; else o = null;
if (o != null) waste.WasteAmountRetained_MTQ = Convert.ToDouble(o);
if (!row.Cell(9).IsEmpty()) waste.WasteDisposalPort = row.Cell(9).GetString().ToUpper();
if (!row.Cell(10).IsEmpty()) o = row.Cell(10).Value; else o = null;
if (o != null) waste.WasteAmountGeneratedTillNextPort_MTQ = Convert.ToDouble(o);
importWasteList.Add(waste);
cnt++;
}
}
if (importWasteList.Count > 0)
{
this.dataGridWaste.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.WAS);
MessageBox.Show(String.Format(Properties.Resources.textWasteImported, importWasteList.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
catch (Exception ex)
{
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
}
} }
#endregion #endregion

View File

@ -36,23 +36,7 @@ namespace bsmd.ExcelReadService
this._excelApp.DisplayAlerts = false; this._excelApp.DisplayAlerts = false;
this._excelWorkbooks = _excelApp.Workbooks; this._excelWorkbooks = _excelApp.Workbooks;
this._portcall = _excelWorkbooks.Open( this._portcall = _excelWorkbooks.Open(filePath, 0, true, 5, "", "", false, XlPlatform.xlWindows, "", false, false, 0, false, false, false);
filePath,
UpdateLinks: 0,
ReadOnly: true,
Format: 5,
Password: "",
WriteResPassword: "",
IgnoreReadOnlyRecommended: true,
Origin: XlPlatform.xlWindows,
Delimiter: "",
Editable: false,
Notify: false,
Converter: 0,
AddToMru: false,
Local: false,
CorruptLoad: false);
this._portcall.ChangeFileAccess(XlFileAccess.xlReadOnly);
_nameDict = new Dictionary<string, Name>(); _nameDict = new Dictionary<string, Name>();
int bookCnt = 0; int bookCnt = 0;
foreach(Name name in _portcall.Names) foreach(Name name in _portcall.Names)

View File

@ -431,6 +431,11 @@ namespace bsmd.database
/// </summary> /// </summary>
public int? ViolationCount { get; set; } public int? ViolationCount { get; set; }
/// <summary>
/// Number of violations during last validation that have the "identifier" set and are thus detected violations
/// from underlying list elements
/// </summary>
public int? PositionViolationCount { get; set; }
/// <summary> /// <summary>
/// Number of errors during last validation /// Number of errors during last validation

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.14")] [assembly: AssemblyInformationalVersion("7.2.13")]
[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.14.*")] [assembly: AssemblyVersion("7.2.13.*")]

View File

@ -97,22 +97,6 @@ namespace bsmd.database
#endregion #endregion
#region for extra waste validation
private static readonly HashSet<string> SpecialNextPortPrefixes = new HashSet<string>
{
"BE", "BG", "DK", "DE", "EE", "FI", "FR", "GR", "IR", "IT",
"HR", "LV", "LT", "LU", "MT", "NL", "AT", "PL", "PT", "RO",
"SE", "SK", "SL", "ES", "CZ", "HU", "CY", "NO", "IS", "GB", "GI"
};
private static readonly HashSet<string> SpecialNextPortExact = new HashSet<string>
{
"RUPRI", "RUULU", "RULED", "RUBLT", "RUKGD", "RUVYS"
};
#endregion
public enum LocodeMode public enum LocodeMode
{ {
STANDARD, STANDARD,
@ -147,20 +131,6 @@ namespace bsmd.database
public static LocodeValidHandler LocodeChecker { get { return _locodeChecker; } } public static LocodeValidHandler LocodeChecker { get { return _locodeChecker; } }
public static NationalityValidHandler NationalityChecker { get { return _nationalityChecker; } } public static NationalityValidHandler NationalityChecker { get { return _nationalityChecker; } }
/// <summary>
/// Used to test for special next port values for waste messages
/// </summary>
/// <param name="nextPort">a locode</param>
/// <returns>true if the next port is a special waste port</returns>
public static bool IsSpecialNextPort(string nextPort)
{
if (string.IsNullOrEmpty(nextPort) || nextPort.Length < 2)
return false;
return SpecialNextPortExact.Contains(nextPort) ||
SpecialNextPortPrefixes.Contains(nextPort.Substring(0, 2));
}
#region public static property validation #region public static property validation
public static void RegisterLocodeChecker(LocodeValidHandler handler) { _locodeChecker = handler; } public static void RegisterLocodeChecker(LocodeValidHandler handler) { _locodeChecker = handler; }

View File

@ -266,13 +266,11 @@ namespace bsmd.database
if (this.WasteAmountGeneratedTillNextPort_MTQ >= 10000) if (this.WasteAmountGeneratedTillNextPort_MTQ >= 10000)
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste generated till next port too high", null, this.Title, this.Identifier, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste generated till next port too high", null, this.Title, this.Identifier, this.Tablename));
// Removed this for version 7.2.14 (new rules depending on next port implemented in ENI / DetailRootControl.cs) if(this.WasteDisposalAmount_MTQ > this.WasteCapacity_MTQ)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Disposal greater than capacity!", null, this.Title, this.Identifier, this.Tablename));
// if(this.WasteDisposalAmount_MTQ > this.WasteCapacity_MTQ) if((this.WasteAmountGeneratedTillNextPort_MTQ + this.WasteAmountRetained_MTQ) > this.WasteCapacity_MTQ)
// violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Disposal greater than capacity!", null, this.Title, this.Identifier, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated+retained greater than capacity!", null, this.Title, this.Identifier, this.Tablename));
// if((this.WasteAmountGeneratedTillNextPort_MTQ + this.WasteAmountRetained_MTQ) > this.WasteCapacity_MTQ)
// violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated+retained greater than capacity!", null, this.Title, this.Identifier, this.Tablename));
} }
#endregion #endregion

View File

@ -76,7 +76,7 @@ namespace bsmd.database
wasteReceived.id = reader.GetGuid(0); wasteReceived.id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) wasteReceived.WasteCode = reader.GetString(1); if (!reader.IsDBNull(1)) wasteReceived.WasteCode = reader.GetString(1);
if (!reader.IsDBNull(2)) wasteReceived.WasteDescription = reader.GetString(2); if (!reader.IsDBNull(2)) wasteReceived.WasteDescription = reader.GetString(2);
if (!reader.IsDBNull(3)) wasteReceived.AmountWasteReceived_MTQ = (float)reader.GetDouble(3); if (!reader.IsDBNull(3)) wasteReceived.AmountWasteReceived_MTQ = (float)reader.GetDouble(3);
if (!reader.IsDBNull(4)) wasteReceived.Identifier = reader.GetString(4); if (!reader.IsDBNull(4)) wasteReceived.Identifier = reader.GetString(4);
result.Add(wasteReceived); result.Add(wasteReceived);
} }
@ -111,7 +111,7 @@ namespace bsmd.database
scmd.Parameters.AddWithValue("@P1", this.WAS_RCPT.Id); scmd.Parameters.AddWithValue("@P1", this.WAS_RCPT.Id);
scmd.Parameters.AddWithNullableValue("@P2", this.WasteCode); scmd.Parameters.AddWithNullableValue("@P2", this.WasteCode);
scmd.Parameters.AddWithNullableValue("@P3", this.WasteDescription); scmd.Parameters.AddWithNullableValue("@P3", this.WasteDescription);
scmd.Parameters.AddWithNullableValue("@P4", this.AmountWasteReceived_MTQ); scmd.Parameters.AddWithNullableValue("@P4", this.AmountWasteReceived_MTQ);
scmd.Parameters.AddWithNullableValue("@P5", this.Identifier); scmd.Parameters.AddWithNullableValue("@P5", this.Identifier);
if (this.IsNew) if (this.IsNew)

Binary file not shown.