5.0.12 / AIS Service aktueller Stand / Work in Progress

This commit is contained in:
Daniel Schick 2018-07-29 06:05:20 +00:00
parent d035c3c06f
commit 7efb1f89de
31 changed files with 478 additions and 299 deletions

View File

@ -123,9 +123,13 @@ namespace LS100PortProxy
_connections.Add(connection); _connections.Add(connection);
_log.InfoFormat("new connection from {0}, total connections: {1}", socket.RemoteEndPoint.ToString(), _connections.Count); _log.InfoFormat("new connection from {0}, total connections: {1}", socket.RemoteEndPoint.ToString(), _connections.Count);
} }
catch (SocketException) { /* tu was */ } catch (SocketException ex)
{ /* tu was? */
_log.WarnFormat("Exception on server socket:{0}", ex.Message);
}
Thread.Sleep(250); Thread.Sleep(250);
} }
_log.Info("Server connection closed");
this._serverSocket.Close(); this._serverSocket.Close();
} }
@ -169,13 +173,24 @@ namespace LS100PortProxy
aChunk = null; aChunk = null;
} }
} }
else if(connection.Socket.Poll(500, SelectMode.SelectError)) {
_log.WarnFormat("This Socket has an error, breaking the " +
"forever loop");
lock (_connections)
{
connection.chunks.Clear();
}
break;
}
else else
{ {
_log.WarnFormat("something has happened with this consumer connection, breaking the forever loop");
// dump queue in this case, packets cannot be sent.. // dump queue in this case, packets cannot be sent..
lock (_connections) lock (_connections)
{ {
connection.chunks.Clear(); connection.chunks.Clear();
} }
break;
} }
Thread.Sleep(50); Thread.Sleep(50);
@ -230,7 +245,11 @@ namespace LS100PortProxy
{ {
try try
{ {
if ((this.client == null) || !this.client.Connected) this.ConnectClient(); if ((this.client == null) || !this.client.Connected)
{
this.ConnectClient();
}
if ((this.client != null) && this.client.Connected && this.clientStream.CanRead) if ((this.client != null) && this.client.Connected && this.clientStream.CanRead)
{ {
while (this.clientStream.CanRead && !this.shouldStop) while (this.clientStream.CanRead && !this.shouldStop)
@ -305,7 +324,10 @@ namespace LS100PortProxy
} }
} }
if (this.client != null) if (this.client != null)
{
_log.Info("closing client connection");
this.client.Close(); this.client.Close();
} }
} }
} }
}

5
AIS/SQL/readme.txt Normal file
View File

@ -0,0 +1,5 @@
Anmeldeinformationen auf 192.168.2.3 (SMWET01)
user id "shipinfo" PW "baffi123" DB "schiffsmeldedienst"
user id "mkuehn" PW "baffi1234" DB "schiffsmeldedienst"
user id "mkuehn" PW "baffi1234" DB "dgzrsSQL"

View File

@ -83,6 +83,8 @@ namespace bsmd.AISService.AIS
set { this.station = value; } set { this.station = value; }
} }
public bool IsNew { get; set; }
#endregion #endregion
#region abstract method signatures #region abstract method signatures
@ -166,6 +168,8 @@ namespace bsmd.AISService.AIS
break; break;
} }
if (result != null) result.IsNew = true;
return result; return result;
} }

View File

@ -84,6 +84,11 @@ namespace bsmd.AISService.AIS
/// </summary> /// </summary>
public string LogfilePath { get; set; } public string LogfilePath { get; set; }
/// <summary>
/// Delete positions after this many days
/// </summary>
public int PurgeDays { get; set; } = 30;
/// <summary> /// <summary>
/// outputs assembly version /// outputs assembly version
/// </summary> /// </summary>

View File

@ -112,7 +112,6 @@ namespace bsmd.AISService.AIS
public int CommState { get { return this.commstate; } } public int CommState { get { return this.commstate; } }
#endregion #endregion
#region static methods #region static methods

View File

@ -27,6 +27,7 @@ public class AIS_QueueManager
private List<TelnetDataHandler> telnetHandlerList = new List<TelnetDataHandler>(); private List<TelnetDataHandler> telnetHandlerList = new List<TelnetDataHandler>();
private List<AIS_Target> dbUpdateQueue = new List<AIS_Target>(); private List<AIS_Target> dbUpdateQueue = new List<AIS_Target>();
private System.Timers.Timer dbUpdateTimer = new System.Timers.Timer(); private System.Timers.Timer dbUpdateTimer = new System.Timers.Timer();
private bool isStarted = false; private bool isStarted = false;
private Mutex dbSingleMutex = new Mutex(); private Mutex dbSingleMutex = new Mutex();
@ -55,6 +56,7 @@ public class AIS_QueueManager
AIS_Target.dbUpdateInterval = new TimeSpan(0, 0, configuration.DBMinPosReportTimeDifference); AIS_Target.dbUpdateInterval = new TimeSpan(0, 0, configuration.DBMinPosReportTimeDifference);
this.dbUpdateTimer.Interval = configuration.DBUpdateInterval; this.dbUpdateTimer.Interval = configuration.DBUpdateInterval;
this.dbUpdateTimer.Elapsed += new ElapsedEventHandler(dbUpdateTimer_Elapsed); this.dbUpdateTimer.Elapsed += new ElapsedEventHandler(dbUpdateTimer_Elapsed);
} }
#endregion #endregion
@ -210,12 +212,12 @@ public class AIS_QueueManager
protected void OnAISQueueChanged(AIS_Target target) protected void OnAISQueueChanged(AIS_Target target)
{ {
if (this.AISQueueChanged != null) this.AISQueueChanged(target); this.AISQueueChanged?.Invoke(target);
} }
protected void OnDBUpdateRequired(AIS_Target target) protected void OnDBUpdateRequired(AIS_Target target)
{ {
if (this.DBUpdateRequired != null) this.DBUpdateRequired(target); this.DBUpdateRequired?.Invoke(target);
} }
#endregion #endregion

View File

@ -158,7 +158,13 @@ namespace bsmd.AISService.AIS
BitArray bits = AIS.DecodeBinary(this.data); BitArray bits = AIS.DecodeBinary(this.data);
Status result = Status.OK; Status result = Status.OK;
if (bits.Count < 424)
{
_log.WarnFormat("AISStaticData truncated: {0}/424", bits.Count);
result = Status.PARSE_ERROR;
}
else
{
try try
{ {
int type = AIS.GetInt(bits, 0, 5); int type = AIS.GetInt(bits, 0, 5);
@ -210,7 +216,8 @@ namespace bsmd.AISService.AIS
this.eta = new DateTime(DateTime.Now.Year, this.etamonth, this.etaday, this.etahour, this.etaminute, 0); this.eta = new DateTime(DateTime.Now.Year, this.etamonth, this.etaday, this.etahour, this.etaminute, 0);
} }
} }
catch(Exception e) { catch (Exception e)
{
_log.WarnFormat("ETA timestamp creation failed: {0}", e.Message); _log.WarnFormat("ETA timestamp creation failed: {0}", e.Message);
} }
this.maxpresetstaticdraught = AIS.GetInt(bits, 294, 301); this.maxpresetstaticdraught = AIS.GetInt(bits, 294, 301);
@ -220,7 +227,7 @@ namespace bsmd.AISService.AIS
{ {
int cval = AIS.GetInt(bits, 302 + (6 * i), 307 + (6 * i)); int cval = AIS.GetInt(bits, 302 + (6 * i), 307 + (6 * i));
char ch = AIS.GetAISChar(cval); char ch = AIS.GetAISChar(cval);
if (ch == '@') ch = ' '; if (ch == '@') break; //ch = ' '; // alles nach einem @ nicht mehr beachten
sb_destination.Append(ch); sb_destination.Append(ch);
} }
this.destination = sb_destination.ToString().Trim(); this.destination = sb_destination.ToString().Trim();
@ -235,6 +242,7 @@ namespace bsmd.AISService.AIS
_log.WarnFormat("Error decoding AIS static data: {0}", e.Message); _log.WarnFormat("Error decoding AIS static data: {0}", e.Message);
result = Status.PARSE_ERROR; result = Status.PARSE_ERROR;
} }
}
return result; return result;
} }

View File

@ -121,6 +121,8 @@ namespace bsmd.AISService.AIS
_log.Info("closing inactive TcpClient"); _log.Info("closing inactive TcpClient");
this.lastRead = DateTime.Now; // reset timer this.lastRead = DateTime.Now; // reset timer
} }
System.Threading.Thread.Sleep(250); // wait a bit
} }
return result; return result;

View File

@ -107,7 +107,7 @@ namespace bsmd.AISService.AIS
var line = frame.GetFileLineNumber(); var line = frame.GetFileLineNumber();
_log.WarnFormat("Exception in telnet reader thread: {0}, top frame ln {1}", ex.Message, line); _log.WarnFormat("Exception in telnet reader thread: {0}, top frame ln {1}", ex.Message, line);
} }
Thread.Sleep(100); // Thread.Sleep(100);
} }
aisTelnet.Close(); aisTelnet.Close();
} }

View File

@ -1,16 +1,11 @@
// Copyright (c) 2008-2018 schick Informatik // Copyright (c) 2008-2018 schick Informatik
// Description: // Description: Windows Service Main File
// //
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using System.ServiceProcess; using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;
using bsmd.AISService.AIS; using bsmd.AISService.AIS;
using bsmd.AISService.DB; using bsmd.AISService.DB;

View File

@ -37,6 +37,9 @@
<setting name="ConnectionString" serializeAs="String"> <setting name="ConnectionString" serializeAs="String">
<value /> <value />
</setting> </setting>
<setting name="PurgeInterval" serializeAs="String">
<value>30</value>
</setting>
</bsmd.AISService.Properties.Settings> </bsmd.AISService.Properties.Settings>
</applicationSettings> </applicationSettings>
</configuration> </configuration>

View File

@ -3,9 +3,6 @@
// //
using System; using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Text;
using bsmd.AISService.AIS; using bsmd.AISService.AIS;
using log4net; using log4net;
@ -37,12 +34,15 @@ namespace bsmd.AISService.DB
aisStation.OnAir = true; aisStation.OnAir = true;
} }
if (!pr.IsNew) return pr.Id;
string query = string.Format("INSERT INTO aisposreport (Id, MMSI, NavStatus, ROT, COG, SOG, Accuracy, Longitude, Latitude, Heading, Timestamp, Reserved, Spare, Raim, CommState, AISStationId) VALUES ('{0}', {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, '{10}', {11},{12},{13},{14},'{15}')", string query = string.Format("INSERT INTO aisposreport (Id, MMSI, NavStatus, ROT, COG, SOG, Accuracy, Longitude, Latitude, Heading, Timestamp, Reserved, Spare, Raim, CommState, AISStationId) VALUES ('{0}', {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, '{10}', {11},{12},{13},{14},'{15}')",
pr.Id, pr.MMSI, pr.NavStatusVal, pr.ROTVal, pr.COGVal, pr.SOGVal, pr.Accuracy, pr.Id, pr.MMSI, pr.NavStatusVal, pr.ROTVal, pr.COGVal, pr.SOGVal, pr.Accuracy,
pr.LongitudeVal, pr.LatitudeVal, pr.TrueHeading ?? 511, pr.DBTimestamp, pr.Reserved, pr.Spare, pr.Raim, pr.CommState, pr.LongitudeVal, pr.LatitudeVal, pr.TrueHeading ?? 511, pr.DBTimestamp, pr.Reserved, pr.Spare, pr.Raim, pr.CommState,
(aisStation != null) ? aisStation.Id : Guid.Empty); (aisStation != null) ? aisStation.Id : Guid.Empty);
con.ExecuteNonQuery(query); con.ExecuteNonQuery(query);
pr.IsNew = false;
return pr.Id; return pr.Id;
} }
@ -51,13 +51,17 @@ namespace bsmd.AISService.DB
{ {
// Trace.WriteLine("saving class B pos report"); // Trace.WriteLine("saving class B pos report");
AIS_ClassB pr = target.LastPosReport as AIS_ClassB; AIS_ClassB pr = target.LastPosReport as AIS_ClassB;
aisStation.UpdateWithPositionReport(pr.MMSI, pr.Latitude, pr.Longitude, pr.Timestamp); aisStation.UpdateWithPositionReport(pr.MMSI, pr.Latitude, pr.Longitude, pr.Timestamp);
if (!pr.IsNew) return pr.Id;
string query = string.Format("INSERT INTO aisposreport (Id, MMSI, NavStatus, ROT, COG, SOG, Accuracy, Longitude, Latitude, Heading, Timestamp, Reserved, Spare, Raim, CommState, AISStationId) VALUES ('{0}', {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, '{10}', {11}, {12}, {13}, {14}, '{15}')", string query = string.Format("INSERT INTO aisposreport (Id, MMSI, NavStatus, ROT, COG, SOG, Accuracy, Longitude, Latitude, Heading, Timestamp, Reserved, Spare, Raim, CommState, AISStationId) VALUES ('{0}', {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, '{10}', {11}, {12}, {13}, {14}, '{15}')",
pr.Id, pr.MMSI, 0, 0, pr.CogVal, pr.SogVal, 0, pr.LongitudeVal, pr.LatitudeVal, pr.Id, pr.MMSI, 0, 0, pr.CogVal, pr.SogVal, 0, pr.LongitudeVal, pr.LatitudeVal,
pr.TrueHeading ?? 511, pr.DBTimestamp, pr.Reserved, pr.Spare, pr.Raim, pr.CommState, (aisStation != null) ? aisStation.Id : Guid.Empty); pr.TrueHeading ?? 511, pr.DBTimestamp, pr.Reserved, pr.Spare, pr.Raim, pr.CommState, (aisStation != null) ? aisStation.Id : Guid.Empty);
con.ExecuteNonQuery(query); con.ExecuteNonQuery(query);
pr.IsNew = false;
return pr.Id; return pr.Id;
} }
@ -74,6 +78,11 @@ namespace bsmd.AISService.DB
return null; return null;
} }
public static int ClearPosReports(DBConnector con, int olderThanDays)
{
string query = string.Format("DELETE FROM aisposreport WHERE[Timestamp] < DATEADD(day, -{0}, GETDATE())", olderThanDays);
return con.ExecuteNonQuery(query);
}
} }
} }

View File

@ -45,7 +45,7 @@ namespace bsmd.AISService
return 1; return 1;
} }
} }
else if(Debugger.IsAttached) else if(Debugger.IsAttached) // wenn man "live" profilern will muss man hier immer rein
{ {
AISService aisService = new AISService(); AISService aisService = new AISService();
aisService.DebugStart(); aisService.DebugStart();

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.2.0.0")]

View File

@ -12,7 +12,7 @@ namespace bsmd.AISService.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@ -31,5 +31,14 @@ namespace bsmd.AISService.Properties {
return ((string)(this["ConnectionString"])); return ((string)(this["ConnectionString"]));
} }
} }
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("30")]
public int PurgeInterval {
get {
return ((int)(this["PurgeInterval"]));
}
}
} }
} }

View File

@ -5,5 +5,8 @@
<Setting Name="ConnectionString" Type="System.String" Scope="Application"> <Setting Name="ConnectionString" Type="System.String" Scope="Application">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="PurgeInterval" Type="System.Int32" Scope="Application">
<Value Profile="(Default)">30</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -20,4 +20,5 @@
<DBMinPosReportTimeDifference>120</DBMinPosReportTimeDifference> <DBMinPosReportTimeDifference>120</DBMinPosReportTimeDifference>
<StationIsOfflineTimeDifferenceSecs>120</StationIsOfflineTimeDifferenceSecs> <StationIsOfflineTimeDifferenceSecs>120</StationIsOfflineTimeDifferenceSecs>
<TargetStaleMins>20</TargetStaleMins> <TargetStaleMins>20</TargetStaleMins>
<PurgeDays>30</PurgeDays>
</AIS_Configuration> </AIS_Configuration>

View File

@ -26,13 +26,13 @@ namespace ENI2
#region Fields #region Fields
private MessageCore _core; private MessageCore _core;
private List<MessageGroup> _listBoxList = new List<MessageGroup>(); private readonly List<MessageGroup> _listBoxList = new List<MessageGroup>();
private List<Message> _messages; private List<Message> _messages;
private Dictionary<string, DetailBaseControl> controlCache = new Dictionary<string, DetailBaseControl>(); private readonly Dictionary<string, DetailBaseControl> controlCache = new Dictionary<string, DetailBaseControl>();
private Dictionary<Message.NotificationClass, string> messageClassControlDict = new Dictionary<Message.NotificationClass, string>(); private readonly Dictionary<Message.NotificationClass, string> messageClassControlDict = new Dictionary<Message.NotificationClass, string>();
private Guid userId = Guid.NewGuid(); // remove THIS!! private Guid userId = Guid.NewGuid(); // remove THIS!!
private object messageListLock = new object(); private readonly object messageListLock = new object();
private HighlightService highlightService = new HighlightService(); private readonly HighlightService highlightService = new HighlightService();
// 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;
@ -54,7 +54,7 @@ namespace ENI2
public bool HasUnsavedChanges public bool HasUnsavedChanges
{ {
get { return (this.buttonSave.Visibility == Visibility.Visible); } // schwach aber es wird's tun get { return this.buttonSave.Visibility == Visibility.Visible; } // schwach aber es wird's tun
} }
#endregion #endregion
@ -260,10 +260,6 @@ namespace ENI2
foreach (Message existingMessage in existingMessages) foreach (Message existingMessage in existingMessages)
{ {
if (existingMessage is ISublistContainer)
{
((ISublistContainer)existingMessage).DeleteElements();
}
// Bearbeitungsinformationen für bestehende ID-Beantragung beibehalten, falls bereits vorhanden // Bearbeitungsinformationen für bestehende ID-Beantragung beibehalten, falls bereits vorhanden
@ -283,6 +279,11 @@ namespace ENI2
continue; continue;
} }
if (existingMessage is ISublistContainer sublistContainer)
{
(sublistContainer).DeleteElements();
}
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(existingMessage); DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Delete(existingMessage);
} }
@ -343,8 +344,7 @@ namespace ENI2
Util.UIHelper.SetBusyState(); Util.UIHelper.SetBusyState();
DetailBaseControl currentControl = this.detailView.Children[0] as DetailBaseControl; if (this.detailView.Children[0] is DetailBaseControl currentControl)
if (currentControl != null)
{ {
foreach (Message message in currentControl.ControlMessages) foreach (Message message in currentControl.ControlMessages)
{ {
@ -498,10 +498,8 @@ namespace ENI2
private void DetailControl_RequestSendValidation() private void DetailControl_RequestSendValidation()
{ {
List<MessageViolation> violationList = null;
List<MessageError> errorList = null;
this.Validate(false, out violationList, out errorList); this.Validate(false, out List<MessageViolation> violationList, out List<MessageError> errorList);
foreach (Message aMessage in this._messages) foreach (Message aMessage in this._messages)
{ {
@ -577,9 +575,7 @@ namespace ENI2
private void DetailControl_RequestValidate() private void DetailControl_RequestValidate()
{ {
List<MessageError> errorList = null; this.Validate(true, out List<MessageViolation> violationList, out List<MessageError> errorList);
List<MessageViolation> violationList = null;
this.Validate(true, out violationList, out errorList);
} }
private void Validate(bool showMessages, out List<MessageViolation> vViolations, out List<MessageError> vErrors) private void Validate(bool showMessages, out List<MessageViolation> vViolations, out List<MessageError> vErrors)
@ -659,8 +655,8 @@ namespace ENI2
if(this._errorListDialog == null) if(this._errorListDialog == null)
{ {
this._errorListDialog = new ErrorListDialog(); this._errorListDialog = new ErrorListDialog();
this._errorListDialog.Closed += (o, e) => { this._errorListDialog = null; }; this._errorListDialog.Closed += (o, e) => this._errorListDialog = null;
this._errorListDialog.Loaded += (o, e) => { this._errorListDialog.RefreshVisible = true; }; this._errorListDialog.Loaded += (o, e) => this._errorListDialog.RefreshVisible = true;
this._errorListDialog.ErrorSelected += _errorListDialog_ErrorSelected; this._errorListDialog.ErrorSelected += _errorListDialog_ErrorSelected;
this._errorListDialog.RefreshClicked += _errorListDialog_RefreshClicked; this._errorListDialog.RefreshClicked += _errorListDialog_RefreshClicked;
this._errorListDialog.IsModal = false; this._errorListDialog.IsModal = false;
@ -674,8 +670,8 @@ namespace ENI2
if(this._violationListDialog == null) if(this._violationListDialog == null)
{ {
this._violationListDialog = new ViolationListDialog(); this._violationListDialog = new ViolationListDialog();
this._violationListDialog.Closed += (o, e) => { this._violationListDialog = null; }; this._violationListDialog.Closed += (o, e) => this._violationListDialog = null;
this._violationListDialog.Loaded += (o, e) => { this._violationListDialog.RefreshVisible = true; }; this._violationListDialog.Loaded += (o, e) => this._violationListDialog.RefreshVisible = true;
this._violationListDialog.ViolationSelected += _errorListDialog_ErrorSelected; this._violationListDialog.ViolationSelected += _errorListDialog_ErrorSelected;
this._violationListDialog.RefreshClicked += _errorListDialog_RefreshClicked; this._violationListDialog.RefreshClicked += _errorListDialog_RefreshClicked;
this._violationListDialog.IsModal = false; this._violationListDialog.IsModal = false;

View File

@ -78,9 +78,11 @@ namespace ENI2.DetailViewControls
bpol = this._bpolMessage.Elements[0] as BPOL; bpol = this._bpolMessage.Elements[0] as BPOL;
if (bpol == null) if (bpol == null)
{ {
bpol = new BPOL(); bpol = new BPOL
bpol.MessageCore = this.Core; {
bpol.MessageHeader = this._bpolMessage; MessageCore = this.Core,
MessageHeader = this._bpolMessage
};
_bpolMessage.Elements.Add(bpol); _bpolMessage.Elements.Add(bpol);
} }
@ -148,8 +150,10 @@ namespace ENI2.DetailViewControls
private void DataGridPortOfItinerary_CreateRequested() private void DataGridPortOfItinerary_CreateRequested()
{ {
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog(); EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog
epid.PortOfItinerary = new PortOfItinerary(); {
PortOfItinerary = new PortOfItinerary()
};
epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries); epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries);
epid.PortOfItinerary.BPOL = this._bpol; epid.PortOfItinerary.BPOL = this._bpol;
@ -159,9 +163,11 @@ namespace ENI2.DetailViewControls
if(!this._bpol.PortOfItineraries.Contains(epid.PortOfItinerary)) if(!this._bpol.PortOfItineraries.Contains(epid.PortOfItinerary))
this._bpol.PortOfItineraries.Add(epid.PortOfItinerary); this._bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh(); this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary(); epid.PortOfItinerary = new PortOfItinerary
epid.PortOfItinerary.BPOL = _bpol; {
epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries); BPOL = _bpol,
Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries)
};
this.SublistElementChanged(Message.NotificationClass.BPOL); this.SublistElementChanged(Message.NotificationClass.BPOL);
}; };
@ -176,8 +182,7 @@ namespace ENI2.DetailViewControls
private void DataGridPortOfItinerary_DeleteRequested(DatabaseEntity obj) private void DataGridPortOfItinerary_DeleteRequested(DatabaseEntity obj)
{ {
PortOfItinerary poi = obj as PortOfItinerary; if (obj is PortOfItinerary poi)
if (poi != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
_bpol.PortOfItineraries.Remove(poi); _bpol.PortOfItineraries.Remove(poi);
@ -190,8 +195,10 @@ namespace ENI2.DetailViewControls
private void DataGridPortOfItinerary_EditRequested(DatabaseEntity obj) private void DataGridPortOfItinerary_EditRequested(DatabaseEntity obj)
{ {
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog(); EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog
epid.PortOfItinerary = obj as PortOfItinerary; {
PortOfItinerary = obj as PortOfItinerary
};
epid.AddClicked += () => epid.AddClicked += () =>
{ {
@ -199,9 +206,11 @@ namespace ENI2.DetailViewControls
if(!_bpol.PortOfItineraries.Contains(epid.PortOfItinerary)) if(!_bpol.PortOfItineraries.Contains(epid.PortOfItinerary))
_bpol.PortOfItineraries.Add(epid.PortOfItinerary); _bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh(); this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary(); epid.PortOfItinerary = new PortOfItinerary
epid.PortOfItinerary.BPOL = this._bpol; {
epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries); BPOL = this._bpol,
Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries)
};
this.SublistElementChanged(Message.NotificationClass.BPOL); this.SublistElementChanged(Message.NotificationClass.BPOL);
}; };
@ -231,17 +240,19 @@ namespace ENI2.DetailViewControls
{ {
foreach (LastTenPortFacilitiesCalled l10fc in _sec.LastTenPortFacilitesCalled) foreach (LastTenPortFacilitiesCalled l10fc in _sec.LastTenPortFacilitesCalled)
{ {
if (l10fc.PortFacilityDateOfDeparture.HasValue && //if (l10fc.PortFacilityDateOfDeparture.HasValue &&
((DateTime.Now - l10fc.PortFacilityDateOfDeparture.Value).TotalDays < 31)) //((DateTime.Now - l10fc.PortFacilityDateOfDeparture.Value).TotalDays < 31))
//{
PortOfItinerary poi = new PortOfItinerary
{ {
PortOfItinerary poi = new PortOfItinerary(); Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries),
poi.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries); BPOL = this._bpol,
poi.BPOL = this._bpol; PortOfItineraryETA = l10fc.PortFacilityDateOfArrival,
poi.PortOfItineraryETA = l10fc.PortFacilityDateOfArrival; PortOfItineraryLocode = l10fc.PortFacilityPortLoCode,
poi.PortOfItineraryLocode = l10fc.PortFacilityPortLoCode; PortOfItineraryName = l10fc.PortFacilityPortName
poi.PortOfItineraryName = l10fc.PortFacilityPortName; };
this._bpol.PortOfItineraries.Add(poi); this._bpol.PortOfItineraries.Add(poi);
} //}
} }
if (this._bpol.PortOfItineraries.Count > 0) if (this._bpol.PortOfItineraries.Count > 0)
{ {
@ -258,8 +269,10 @@ namespace ENI2.DetailViewControls
private void DataGridPassengerList_CreateRequested() private void DataGridPassengerList_CreateRequested()
{ {
EditPASDialog epd = new EditPASDialog(); EditPASDialog epd = new EditPASDialog
epd.PAS = new PAS(); {
PAS = new PAS()
};
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements); epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
epd.PAS.MessageHeader = this._pasMessage; epd.PAS.MessageHeader = this._pasMessage;
@ -269,9 +282,11 @@ namespace ENI2.DetailViewControls
if(!this._pasMessage.Elements.Contains(epd.PAS)) if(!this._pasMessage.Elements.Contains(epd.PAS))
this._pasMessage.Elements.Add(epd.PAS); this._pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh(); this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS(); epd.PAS = new PAS
epd.PAS.MessageHeader = this._pasMessage; {
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements); MessageHeader = this._pasMessage,
Identifier = PAS.GetNewIdentifier(_pasMessage.Elements)
};
this.SublistElementChanged(Message.NotificationClass.PAS); this.SublistElementChanged(Message.NotificationClass.PAS);
}; };
@ -286,8 +301,7 @@ namespace ENI2.DetailViewControls
private void DataGridPassengerList_DeleteRequested(DatabaseEntity obj) private void DataGridPassengerList_DeleteRequested(DatabaseEntity obj)
{ {
PAS pas = obj as PAS; if (obj is PAS pas)
if (pas != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
_pasMessage.Elements.Remove(pas); _pasMessage.Elements.Remove(pas);
@ -304,8 +318,10 @@ namespace ENI2.DetailViewControls
private void DataGridPassengerList_EditRequested(DatabaseEntity obj) private void DataGridPassengerList_EditRequested(DatabaseEntity obj)
{ {
EditPASDialog epd = new EditPASDialog(); EditPASDialog epd = new EditPASDialog
epd.PAS = obj as PAS; {
PAS = obj as PAS
};
epd.AddClicked += () => epd.AddClicked += () =>
{ {
@ -313,9 +329,11 @@ namespace ENI2.DetailViewControls
if(!_pasMessage.Elements.Contains(epd.PAS)) if(!_pasMessage.Elements.Contains(epd.PAS))
_pasMessage.Elements.Add(epd.PAS); _pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh(); this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS(); epd.PAS = new PAS
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements); {
epd.PAS.MessageHeader = _pasMessage; Identifier = PAS.GetNewIdentifier(_pasMessage.Elements),
MessageHeader = _pasMessage
};
this.SublistElementChanged(Message.NotificationClass.PAS); this.SublistElementChanged(Message.NotificationClass.PAS);
}; };
@ -340,8 +358,10 @@ namespace ENI2.DetailViewControls
private void DataGridCrewList_CreateRequested() private void DataGridCrewList_CreateRequested()
{ {
EditCREWDialog ecd = new EditCREWDialog(); EditCREWDialog ecd = new EditCREWDialog
ecd.CREW = new CREW(); {
CREW = new CREW()
};
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements); ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements);
ecd.CREW.MessageHeader = this._crewMessage; ecd.CREW.MessageHeader = this._crewMessage;
@ -351,9 +371,11 @@ namespace ENI2.DetailViewControls
if(!this._crewMessage.Elements.Contains(ecd.CREW)) if(!this._crewMessage.Elements.Contains(ecd.CREW))
this._crewMessage.Elements.Add(ecd.CREW); this._crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh(); this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW(); ecd.CREW = new CREW
ecd.CREW.MessageHeader = this._crewMessage; {
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements); MessageHeader = this._crewMessage,
Identifier = CREW.GetNewIdentifier(_crewMessage.Elements)
};
this.SublistElementChanged(Message.NotificationClass.CREW); this.SublistElementChanged(Message.NotificationClass.CREW);
}; };
@ -368,8 +390,7 @@ namespace ENI2.DetailViewControls
private void DataGridCrewList_DeleteRequested(DatabaseEntity obj) private void DataGridCrewList_DeleteRequested(DatabaseEntity obj)
{ {
CREW crew = obj as CREW; if (obj is CREW crew)
if (crew != null)
{ {
// are you sure dialog is in base class // are you sure dialog is in base class
_crewMessage.Elements.Remove(crew); _crewMessage.Elements.Remove(crew);
@ -386,8 +407,10 @@ namespace ENI2.DetailViewControls
private void DataGridCrewList_EditRequested(DatabaseEntity obj) private void DataGridCrewList_EditRequested(DatabaseEntity obj)
{ {
EditCREWDialog ecd = new EditCREWDialog(); EditCREWDialog ecd = new EditCREWDialog
ecd.CREW = obj as CREW; {
CREW = obj as CREW
};
ecd.AddClicked += () => ecd.AddClicked += () =>
{ {
@ -395,9 +418,11 @@ namespace ENI2.DetailViewControls
if(!_crewMessage.Elements.Contains(ecd.CREW)) if(!_crewMessage.Elements.Contains(ecd.CREW))
_crewMessage.Elements.Add(ecd.CREW); _crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh(); this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW(); ecd.CREW = new CREW
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements); {
ecd.CREW.MessageHeader = _crewMessage; Identifier = CREW.GetNewIdentifier(_crewMessage.Elements),
MessageHeader = _crewMessage
};
this.SublistElementChanged(Message.NotificationClass.CREW); this.SublistElementChanged(Message.NotificationClass.CREW);
}; };
@ -433,8 +458,10 @@ namespace ENI2.DetailViewControls
private void buttonImportExcelCrew_Click(object sender, RoutedEventArgs e) private void buttonImportExcelCrew_Click(object sender, RoutedEventArgs e)
{ {
OpenFileDialog ofd = new OpenFileDialog(); OpenFileDialog ofd = new OpenFileDialog
ofd.Filter = "Excel Files|*.xls;*.xlsx"; {
Filter = "Excel Files|*.xls;*.xlsx"
};
if (ofd.ShowDialog() ?? false) if (ofd.ShowDialog() ?? false)
{ {
FileStream stream = null; FileStream stream = null;
@ -505,8 +532,10 @@ namespace ENI2.DetailViewControls
private void buttonImportExcelPassenger_Click(object sender, RoutedEventArgs e) private void buttonImportExcelPassenger_Click(object sender, RoutedEventArgs e)
{ {
OpenFileDialog ofd = new OpenFileDialog(); OpenFileDialog ofd = new OpenFileDialog
ofd.Filter = "Excel Files|*.xls;*.xlsx"; {
Filter = "Excel Files|*.xls;*.xlsx"
};
if (ofd.ShowDialog() ?? false) if (ofd.ShowDialog() ?? false)
{ {
FileStream stream = null; FileStream stream = null;

View File

@ -28,7 +28,7 @@ namespace ENI2.DetailViewControls
private Message _noanodMessage; private Message _noanodMessage;
private Timer _checkStatusTimer; private Timer _checkStatusTimer;
private DateTime _startStatusCheck; private DateTime _startStatusCheck;
private object _collectionLock = new object(); private readonly object _collectionLock = new object();
public OverViewDetailControl() public OverViewDetailControl()
{ {
@ -81,11 +81,13 @@ namespace ENI2.DetailViewControls
this.comboBoxInitialHis.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(Message.NSWProvider)); this.comboBoxInitialHis.ItemsSource = Util.EnumHelper.GetAllValuesAndDescription(typeof(Message.NSWProvider));
this.comboBoxInitialHis.DataContext = this.Core; this.comboBoxInitialHis.DataContext = this.Core;
Binding vtBinding = new Binding(); Binding vtBinding = new Binding
vtBinding.Source = this.Core; {
vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId"); Source = this.Core,
vtBinding.Mode = BindingMode.TwoWay; Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId"),
vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; Mode = BindingMode.TwoWay,
UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
};
BindingOperations.SetBinding(textBoxDisplayId, TextBox.TextProperty, vtBinding); BindingOperations.SetBinding(textBoxDisplayId, TextBox.TextProperty, vtBinding);
if (this.Core.Cancelled ?? false) this.ShowCancelledLabel(); if (this.Core.Cancelled ?? false) this.ShowCancelledLabel();
@ -96,41 +98,53 @@ namespace ENI2.DetailViewControls
// Command Bindings verwenden. Hier ist das erklärt: https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/commanding-overview#code-snippet-2 // Command Bindings verwenden. Hier ist das erklärt: https://docs.microsoft.com/en-us/dotnet/framework/wpf/advanced/commanding-overview#code-snippet-2
this.dataGridMessages.ContextMenu = new ContextMenu(); this.dataGridMessages.ContextMenu = new ContextMenu();
MenuItem sendItem = new MenuItem(); MenuItem sendItem = new MenuItem
sendItem.Header = Properties.Resources.textSendToNSW; {
sendItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/mail_forward.png")) }; Header = Properties.Resources.textSendToNSW,
Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/mail_forward.png")) }
};
//sendItem.Command = //sendItem.Command =
sendItem.Click += new RoutedEventHandler(this.contextSendMessage); sendItem.Click += this.contextSendMessage;
this.dataGridMessages.ContextMenu.Items.Add(sendItem); this.dataGridMessages.ContextMenu.Items.Add(sendItem);
MenuItem resetItem = new MenuItem(); MenuItem resetItem = new MenuItem
resetItem.Header = Properties.Resources.textReset; {
resetItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/mail_delete.png")) }; Header = Properties.Resources.textReset,
resetItem.Click += new RoutedEventHandler(this.contextResetMessage); Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/mail_delete.png")) }
};
resetItem.Click += this.contextResetMessage;
this.dataGridMessages.ContextMenu.Items.Add(resetItem); this.dataGridMessages.ContextMenu.Items.Add(resetItem);
MenuItem systemErrorItem = new MenuItem(); MenuItem systemErrorItem = new MenuItem
systemErrorItem.Header = Properties.Resources.textSystemErrors; {
systemErrorItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/hand_red_card.png")) }; Header = Properties.Resources.textSystemErrors,
systemErrorItem.Click += new RoutedEventHandler(this.buttonSystemErrors_Click); Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/hand_red_card.png")) }
};
systemErrorItem.Click += this.buttonSystemErrors_Click;
this.dataGridMessages.ContextMenu.Items.Add(systemErrorItem); this.dataGridMessages.ContextMenu.Items.Add(systemErrorItem);
MenuItem errorItem = new MenuItem(); MenuItem errorItem = new MenuItem
errorItem.Header = Properties.Resources.textErrors; {
errorItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/error.png")) }; Header = Properties.Resources.textErrors,
errorItem.Click += new RoutedEventHandler(this.buttonErrors_Click); Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/error.png")) }
};
errorItem.Click += this.buttonErrors_Click;
this.dataGridMessages.ContextMenu.Items.Add(errorItem); this.dataGridMessages.ContextMenu.Items.Add(errorItem);
MenuItem vioItem = new MenuItem(); MenuItem vioItem = new MenuItem
vioItem.Header = Properties.Resources.textViolations; {
vioItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/sign_warning.png")) }; Header = Properties.Resources.textViolations,
vioItem.Click += new RoutedEventHandler(this.buttonWarnings_Click); Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/sign_warning.png")) }
};
vioItem.Click += this.buttonWarnings_Click;
this.dataGridMessages.ContextMenu.Items.Add(vioItem); this.dataGridMessages.ContextMenu.Items.Add(vioItem);
MenuItem pdfItem = new MenuItem(); MenuItem pdfItem = new MenuItem
pdfItem.Header = Properties.Resources.textCreatePDF; {
pdfItem.Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/document_pdf.png")) }; Header = Properties.Resources.textCreatePDF,
pdfItem.Click += new RoutedEventHandler(this.buttonCreatePDF_Click); Icon = new Image { Source = new BitmapImage(new Uri("pack://application:,,,/Resources/document_pdf.png")) }
};
pdfItem.Click += this.buttonCreatePDF_Click;
this.dataGridMessages.ContextMenu.Items.Add(pdfItem); this.dataGridMessages.ContextMenu.Items.Add(pdfItem);
#endregion #endregion
@ -169,9 +183,11 @@ namespace ENI2.DetailViewControls
if (ata == null) if (ata == null)
{ {
ata = new ATA(); ata = new ATA
ata.MessageCore = this.Core; {
ata.MessageHeader = this._ataMessage; MessageCore = this.Core,
MessageHeader = this._ataMessage
};
_ataMessage.Elements.Add(ata); _ataMessage.Elements.Add(ata);
} }
@ -197,9 +213,11 @@ namespace ENI2.DetailViewControls
if (atd == null) if (atd == null)
{ {
atd = new ATD(); atd = new ATD
atd.MessageCore = this.Core; {
atd.MessageHeader = this._atdMessage; MessageCore = this.Core,
MessageHeader = this._atdMessage
};
_atdMessage.Elements.Add(atd); _atdMessage.Elements.Add(atd);
} }
@ -225,9 +243,11 @@ namespace ENI2.DetailViewControls
if (noa_nod == null) if (noa_nod == null)
{ {
noa_nod = new NOA_NOD(); noa_nod = new NOA_NOD
noa_nod.MessageCore = this.Core; {
noa_nod.MessageHeader = this._noanodMessage; MessageCore = this.Core,
MessageHeader = this._noanodMessage
};
_noanodMessage.Elements.Add(noa_nod); _noanodMessage.Elements.Add(noa_nod);
} }
@ -390,8 +410,10 @@ namespace ENI2.DetailViewControls
this.labelBSMDStatusInternal.DataContext = this.Core; this.labelBSMDStatusInternal.DataContext = this.Core;
this.labelBSMDStatusInternal.GetBindingExpression(Label.ContentProperty)?.UpdateTarget(); this.labelBSMDStatusInternal.GetBindingExpression(Label.ContentProperty)?.UpdateTarget();
//MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId)); //MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId));
ShowIdDialog sid = new ShowIdDialog(); ShowIdDialog sid = new ShowIdDialog
sid.DisplayId = this.Core.DisplayId; {
DisplayId = this.Core.DisplayId
};
sid.Show(); sid.Show();
this.Core.IsDirty = false; // ist ja schon gespeichert.. this.Core.IsDirty = false; // ist ja schon gespeichert..
} }
@ -419,8 +441,7 @@ namespace ENI2.DetailViewControls
{ {
if (sender != null) if (sender != null)
{ {
DataGrid grid = sender as DataGrid; if ((sender is DataGrid grid) && (grid.SelectedItems?.Count == 1))
if ((grid != null) && (grid.SelectedItems != null) && (grid.SelectedItems.Count == 1))
{ {
DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow; DataGridRow dgr = grid.ItemContainerGenerator.ContainerFromItem(grid.SelectedItem) as DataGridRow;
Message selectedMessage = grid.SelectedItem as Message; Message selectedMessage = grid.SelectedItem as Message;
@ -492,6 +513,17 @@ namespace ENI2.DetailViewControls
MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmReset, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question); MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmReset, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
{ {
// Testen, ob der Reset an dasselbe HIS geht wie da wo die Meldung ursprünglich angelegt wurde
foreach(Message selectedMessage in this.dataGridMessages.SelectedItems)
{
if (selectedMessage.HIS != this.Core.InitialHIS)
{
string abortMsg = string.Format(Properties.Resources.textMessageHisNotMatching, selectedMessage.HIS, selectedMessage.MessageNotificationClassDisplay, this.Core.InitialHIS);
MessageBox.Show(abortMsg, Properties.Resources.textErrorMessage, MessageBoxButton.OK, MessageBoxImage.Exclamation);
return;
}
}
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems) foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{ {
selectedMessage.Reset = true; selectedMessage.Reset = true;
@ -517,6 +549,14 @@ namespace ENI2.DetailViewControls
} }
else else
{ {
if(this.Core.InitialHIS != _message.HIS)
{
MessageBoxResult noMatchResult = MessageBox.Show(Properties.Resources.textHISNotMatching, Properties.Resources.textConfirm,
MessageBoxButton.OK, MessageBoxImage.Exclamation);
// todo: Hier den "Egal!" Fall berücksichtigen?
return;
}
MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmCancel, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question); MessageBoxResult result = MessageBox.Show(Properties.Resources.textConfirmCancel, Properties.Resources.textConfirm, MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
{ {
@ -575,10 +615,7 @@ namespace ENI2.DetailViewControls
if (elapsedSec < Properties.Settings.Default.RequestTimeout) if (elapsedSec < Properties.Settings.Default.RequestTimeout)
{ {
// not yet.. (calling ui thread async) // not yet.. (calling ui thread async)
this.Dispatcher.BeginInvoke(new Action(() => this.Dispatcher.BeginInvoke(new Action(() => this.labelBusyTimeElapsed.Content = string.Format(Properties.Resources.textSecondsElapsed, elapsedSec.ToString("N0"))));
{
this.labelBusyTimeElapsed.Content = string.Format(Properties.Resources.textSecondsElapsed, elapsedSec.ToString("N0"));
}));
} }
else else
{ {
@ -597,9 +634,11 @@ namespace ENI2.DetailViewControls
this.Dispatcher.BeginInvoke(new Action(() => this.Dispatcher.BeginInvoke(new Action(() =>
{ {
MessageCore reloadedCore = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreById(this.Core.Id.Value); MessageCore reloadedCore = DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).GetMessageCoreById(this.Core.Id.Value);
CoreStatusInfoDialog csid = new CoreStatusInfoDialog(); CoreStatusInfoDialog csid = new CoreStatusInfoDialog
csid.IsModal = false; {
csid.Core = reloadedCore; IsModal = false,
Core = reloadedCore
};
csid.Show(); csid.Show();
this.busyIndicator.IsBusy = false; this.busyIndicator.IsBusy = false;
this.OnRequestReload(); this.OnRequestReload();
@ -617,17 +656,16 @@ namespace ENI2.DetailViewControls
{ {
// reload Core and all message classes // reload Core and all message classes
// container class needs to dismiss all created controls // container class needs to dismiss all created controls
this.Dispatcher.BeginInvoke(new Action(() => this.Dispatcher.BeginInvoke(new Action(() => this.OnRequestReload()));
{
this.OnRequestReload();
}));
} }
private void buttonInfoCore_Click(object sender, RoutedEventArgs e) private void buttonInfoCore_Click(object sender, RoutedEventArgs e)
{ {
SimplePropertyViewDialog spvd = new SimplePropertyViewDialog(); SimplePropertyViewDialog spvd = new SimplePropertyViewDialog
spvd.IsModal = false; {
spvd.DisplayObject = this.Core; IsModal = false,
DisplayObject = this.Core
};
spvd.Show(); spvd.Show();
//CoreStatusInfoDialog csid = new CoreStatusInfoDialog(); //CoreStatusInfoDialog csid = new CoreStatusInfoDialog();
@ -642,8 +680,10 @@ namespace ENI2.DetailViewControls
if (this.dataGridMessages.SelectedItems.Count > 0) if (this.dataGridMessages.SelectedItems.Count > 0)
{ {
Message selectedMessage = this.dataGridMessages.SelectedItems[0] as Message; Message selectedMessage = this.dataGridMessages.SelectedItems[0] as Message;
ErrorListDialog eld = new ErrorListDialog(); ErrorListDialog eld = new ErrorListDialog
eld.Errors = selectedMessage.ErrorList; {
Errors = selectedMessage.ErrorList
};
eld.ShowDialog(); eld.ShowDialog();
} }
} }
@ -653,8 +693,10 @@ namespace ENI2.DetailViewControls
if (this.dataGridMessages.SelectedItems.Count > 0) if (this.dataGridMessages.SelectedItems.Count > 0)
{ {
Message selectedMessage = this.dataGridMessages.SelectedItems[0] as Message; Message selectedMessage = this.dataGridMessages.SelectedItems[0] as Message;
ViolationListDialog vld = new ViolationListDialog(); ViolationListDialog vld = new ViolationListDialog
vld.Violations = selectedMessage.ViolationList; {
Violations = selectedMessage.ViolationList
};
vld.ShowDialog(); vld.ShowDialog();
} }
} }
@ -707,8 +749,10 @@ namespace ENI2.DetailViewControls
if (this.dataGridMessages.SelectedItems.Count > 0) if (this.dataGridMessages.SelectedItems.Count > 0)
{ {
Message selectedMessage = this.dataGridMessages.SelectedItems[0] as Message; Message selectedMessage = this.dataGridMessages.SelectedItems[0] as Message;
SystemErrorDialog sed = new SystemErrorDialog(); SystemErrorDialog sed = new SystemErrorDialog
sed.SystemErrors = selectedMessage.SystemErrorList; {
SystemErrors = selectedMessage.SystemErrorList
};
sed.ShowDialog(); sed.ShowDialog();
} }
} }

View File

@ -149,7 +149,7 @@
<Button Name="buttonImportFromL10P" Margin="2" Content="{x:Static p:Resources.textCopyFromL10P}" Width="220" VerticalAlignment="Center" Click="buttonImportFromL10P_Click" Background="Transparent" /> <Button Name="buttonImportFromL10P" Margin="2" Content="{x:Static p:Resources.textCopyFromL10P}" Width="220" VerticalAlignment="Center" Click="buttonImportFromL10P_Click" Background="Transparent" />
</StackPanel> </StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridShip2ShipActivities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridShip2ShipActivities" 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.textLocationName}" Binding="{Binding ShipToShipActivityLocationName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" /> <DataGridTextColumn Header="{x:Static p:Resources.textLocationName}" Binding="{Binding ShipToShipActivityLocationName, Mode=TwoWay}" IsReadOnly="True" Width="0.1*" />

View File

@ -35,8 +35,8 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion> <MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision> <ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>5.0.11.%2a</ApplicationVersion> <ApplicationVersion>5.0.12.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>
@ -52,6 +52,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<CodeAnalysisRuleSet>..\..\..\..\mtc\puls200.frame\frame.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>

View File

@ -2195,6 +2195,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to You must select the same HIS where this message / declaration was first created.
/// </summary>
public static string textHISNotMatching {
get {
return ResourceManager.GetString("textHISNotMatching", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to IBC item. /// Looks up a localized string similar to IBC item.
/// </summary> /// </summary>
@ -2870,6 +2879,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to HIS {0} of message {1} and current target {2} do not match: Reset aborted.
/// </summary>
public static string textMessageHisNotMatching {
get {
return ResourceManager.GetString("textMessageHisNotMatching", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Message reset at {0}. /// Looks up a localized string similar to Message reset at {0}.
/// </summary> /// </summary>

View File

@ -1651,4 +1651,10 @@
<data name="textWasteImported" xml:space="preserve"> <data name="textWasteImported" xml:space="preserve">
<value>{0} waste positions imported</value> <value>{0} waste positions imported</value>
</data> </data>
<data name="textHISNotMatching" xml:space="preserve">
<value>You must select the same HIS where this message / declaration was first created</value>
</data>
<data name="textMessageHisNotMatching" xml:space="preserve">
<value>HIS {0} of message {1} and current target {2} do not match: Reset aborted</value>
</data>
</root> </root>

Binary file not shown.

View File

@ -11,15 +11,14 @@ using System.IO;
using System.ServiceProcess; using System.ServiceProcess;
using System.Timers; using System.Timers;
namespace bsmd.ExcelReadService namespace bsmd.ExcelReadService
{ {
public partial class ExcelReadService : ServiceBase public partial class ExcelReadService : ServiceBase
{ {
private Timer _timer; private Timer _timer;
private object _timerlock = new object(); private readonly object _timerlock = new object();
private bool processRunning = false; private bool processRunning = false;
private ILog _log = LogManager.GetLogger(typeof(ExcelReadService)); private readonly ILog _log = LogManager.GetLogger(typeof(ExcelReadService));
public ExcelReadService() public ExcelReadService()
{ {
@ -43,8 +42,10 @@ namespace bsmd.ExcelReadService
private void Init(string[] args) private void Init(string[] args)
{ {
this._timer = new Timer(); this._timer = new Timer
this._timer.Interval = Properties.Settings.Default.SleepSeconds * 1000; {
Interval = Properties.Settings.Default.SleepSeconds * 1000
};
this._timer.Elapsed += _timer_Elapsed; this._timer.Elapsed += _timer_Elapsed;
this._timer.Enabled = true; this._timer.Enabled = true;
} }
@ -65,7 +66,7 @@ namespace bsmd.ExcelReadService
string messageId = ""; string messageId = "";
string attachmentLocalPath = null; string attachmentLocalPath = null;
string mailSender = ""; string mailSender = "";
string receiptSubject = "NSW Sheet Service Status INFO"; const string receiptSubject = "NSW Sheet Service Status INFO";
string mailSubject = ""; string mailSubject = "";
Dictionary<Guid, ReportingParty> reportingPartyDict = DBManager.Instance.GetReportingPartyDict(); Dictionary<Guid, ReportingParty> reportingPartyDict = DBManager.Instance.GetReportingPartyDict();
@ -130,8 +131,10 @@ namespace bsmd.ExcelReadService
{ {
try try
{ {
ImportHeader importHeader = new ImportHeader(); ImportHeader importHeader = new ImportHeader
importHeader.ImportDate = DateTime.Now; {
ImportDate = DateTime.Now
};
readResult = Util.ProcessSheet(reader, out readMessage, out messageCore); readResult = Util.ProcessSheet(reader, out readMessage, out messageCore);
if (readResult) if (readResult)
{ {

View File

@ -1118,7 +1118,10 @@ namespace bsmd.ExcelReadService
if(transportMode != null) if(transportMode != null)
{ {
if (transportMode.Contains("maritime", StringComparison.OrdinalIgnoreCase)) stat.TransportMode = "1"; if (transportMode.Contains("maritime", StringComparison.OrdinalIgnoreCase)) stat.TransportMode = "1";
if (transportMode.Equals("1")) stat.TransportMode = transportMode;
if (transportMode.Contains("inland", StringComparison.OrdinalIgnoreCase)) stat.TransportMode = "8"; if (transportMode.Contains("inland", StringComparison.OrdinalIgnoreCase)) stat.TransportMode = "8";
if (transportMode.Equals("8")) stat.TransportMode = transportMode;
} }
reader.Conf.ConfirmText("STAT.TransportMode", transportMode, stat.TransportMode.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK); reader.Conf.ConfirmText("STAT.TransportMode", transportMode, stat.TransportMode.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);

View File

@ -22,6 +22,7 @@
<IISExpressWindowsAuthentication /> <IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode /> <IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile /> <UseGlobalApplicationHostFile />
<Use64BitIISExpress />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
@ -33,6 +34,7 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<ExcludeGeneratedDebugSymbol>true</ExcludeGeneratedDebugSymbol> <ExcludeGeneratedDebugSymbol>true</ExcludeGeneratedDebugSymbol>
<PublishDatabases>false</PublishDatabases> <PublishDatabases>false</PublishDatabases>
<CodeAnalysisRuleSet>..\..\..\..\mtc\puls200.frame\frame.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

View File

@ -3,6 +3,12 @@
<PropertyGroup> <PropertyGroup>
<UseIISExpress>true</UseIISExpress> <UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig> <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
</PropertyGroup> </PropertyGroup>
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>

View File

@ -22,11 +22,6 @@ 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[] 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[] 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" };
public WAS() public WAS()
{ {
this.tablename = "[dbo].[WAS]"; this.tablename = "[dbo].[WAS]";
@ -35,13 +30,13 @@ namespace bsmd.database
#region Properties #region Properties
public static int[] DKWasteCodes { get { return dkWasteCodes; } } public static int[] DKWasteCodes { get; } = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2300, 2309, 3000, 5100, 5200, 5300, 2300 };
public static string[] DKWasteTypes { get { return dkWasteTypes; } } public static string[] DKWasteTypes { get; } = { "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" };
public static int[] RequiredCodes { get { return requiredCodes; } } public static int[] RequiredCodes { get; } = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2309, 3000, 5100, 5200, 5300 };
public static string[] RequiredTypes { get { return requiredTypes; } } public static string[] RequiredTypes { get; } = { "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" };
[ShowReport] [ShowReport]
[ENI2Validation] [ENI2Validation]
@ -131,9 +126,11 @@ namespace bsmd.database
} }
else else
{ {
WasteDisposalServiceProvider newWDSP = new WasteDisposalServiceProvider(); WasteDisposalServiceProvider newWDSP = new WasteDisposalServiceProvider
newWDSP.WAS = this; {
newWDSP.WasteDisposalServiceProviderName = serviceProviderName; WAS = this,
WasteDisposalServiceProviderName = serviceProviderName
};
foundList.Add(newWDSP); foundList.Add(newWDSP);
} }
} }
@ -178,7 +175,7 @@ namespace bsmd.database
} }
else else
{ {
scmd.Parameters.AddWithValue(@"ID", this.Id); scmd.Parameters.AddWithValue("ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET WasteDisposalValidExemption = @P2, LastWasteDisposalPort = @P3, " + scmd.CommandText = string.Format("UPDATE {0} SET WasteDisposalValidExemption = @P2, LastWasteDisposalPort = @P3, " +
"ConfirmationOfCorrectness = @P4, LastWasteDisposalDate = @P5, WasteDisposalDelivery = @P6, ConfirmationOfSufficiency = @P7 " + "ConfirmationOfCorrectness = @P4, LastWasteDisposalDate = @P5, WasteDisposalDelivery = @P6, ConfirmationOfSufficiency = @P7 " +
"WHERE Id = @ID", this.Tablename); "WHERE Id = @ID", this.Tablename);
@ -212,9 +209,11 @@ namespace bsmd.database
while (reader.Read()) while (reader.Read())
{ {
WAS was = new WAS(); WAS was = new WAS
{
id = reader.GetGuid(0)
};
was.id = reader.GetGuid(0);
if (!reader.IsDBNull(1)) was.WasteDisposalValidExemption = reader.GetBoolean(1); if (!reader.IsDBNull(1)) was.WasteDisposalValidExemption = reader.GetBoolean(1);
if (!reader.IsDBNull(2)) was.LastWasteDisposalPort = reader.GetString(2); if (!reader.IsDBNull(2)) was.LastWasteDisposalPort = reader.GetString(2);
if (!reader.IsDBNull(3)) was.ConfirmationOfCorrectness = reader.GetBoolean(3); if (!reader.IsDBNull(3)) was.ConfirmationOfCorrectness = reader.GetBoolean(3);
@ -326,7 +325,7 @@ namespace bsmd.database
bool entryMissing = false; bool entryMissing = false;
int missingType = 0; int missingType = 0;
foreach(int wasteCode in requiredCodes) foreach(int wasteCode in RequiredCodes)
{ {
bool codeFound = false; bool codeFound = false;
foreach(Waste w in this.Waste) foreach(Waste w in this.Waste)
@ -375,16 +374,18 @@ namespace bsmd.database
} }
if (!wasteTypeFound) if (!wasteTypeFound)
{ {
Waste newWaste = new Waste(); Waste newWaste = new Waste
newWaste.WasteType = wType; {
newWaste.WasteAmountGeneratedTillNextPort_MTQ = 0; WasteType = wType,
newWaste.WasteAmountRetained_MTQ = 0; WasteAmountGeneratedTillNextPort_MTQ = 0,
newWaste.WasteCapacity_MTQ = 0; WasteAmountRetained_MTQ = 0,
newWaste.WasteDisposalAmount_MTQ = 0; WasteCapacity_MTQ = 0,
newWaste.Identifier = ""; WasteDisposalAmount_MTQ = 0,
newWaste.WasteDisposalPort = "ZZUKN"; Identifier = "",
newWaste.WasteDescription = "-"; WasteDisposalPort = "ZZUKN",
newWaste.WAS = this; WasteDescription = "-",
WAS = this
};
this.Waste.Add(newWaste); this.Waste.Add(newWaste);
result.Add(newWaste); result.Add(newWaste);
} }
@ -399,7 +400,7 @@ namespace bsmd.database
public void AddMissingWaste() public void AddMissingWaste()
{ {
foreach (int wasteCode in WAS.requiredCodes) foreach (int wasteCode in WAS.RequiredCodes)
{ {
Waste foundWaste = null; Waste foundWaste = null;
foreach (Waste waste in this.Waste) foreach (Waste waste in this.Waste)
@ -412,17 +413,19 @@ namespace bsmd.database
} }
if (foundWaste == null) if (foundWaste == null)
{ {
Waste newWaste = new Waste(); Waste newWaste = new Waste
newWaste.Identifier = DatabaseEntity.GetNewIdentifier(this.Waste); {
newWaste.WAS = this; Identifier = DatabaseEntity.GetNewIdentifier(this.Waste),
newWaste.WasteAmountGeneratedTillNextPort_MTQ = 0; WAS = this,
newWaste.WasteAmountRetained_MTQ = 0; WasteAmountGeneratedTillNextPort_MTQ = 0,
newWaste.WasteCapacity_MTQ = 0; WasteAmountRetained_MTQ = 0,
newWaste.WasteDescription = (wasteCode == 1300) ? "-" : ""; WasteCapacity_MTQ = 0,
newWaste.WasteDisposalAmount_MTQ = 0; WasteDescription = (wasteCode == 1300) ? "-" : "",
newWaste.WasteDisposalPort = "ZZUKN"; WasteDisposalAmount_MTQ = 0,
newWaste.WasteDisposedAtLastPort_MTQ = 0; WasteDisposalPort = "ZZUKN",
newWaste.WasteType = wasteCode; WasteDisposedAtLastPort_MTQ = 0,
WasteType = wasteCode
};
this.Waste.Add(newWaste); this.Waste.Add(newWaste);
} }
else else

View File

@ -23,6 +23,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess> <UseVSHostingProcess>false</UseVSHostingProcess>
<CodeAnalysisRuleSet>..\..\..\..\mtc\puls200.frame\frame.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>