Neue PatchVersion 25.10.15

This commit is contained in:
Daniel Schick 2015-10-25 20:02:28 +00:00
parent ab5e751720
commit 167451f545
11 changed files with 471 additions and 434 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>-r -c "AA9074D7-2607-445E-A0B9-D07890B6DC23"</StartArguments> <StartArguments>-r -c "8ECF90D2-1F1F-4CDD-A7C7-8E1BB3EF7105"</StartArguments>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -32,18 +32,18 @@ namespace bsmd.database
[ShowReport] [ShowReport]
public string PortFacilityPortLoCode { get; set; } public string PortFacilityPortLoCode { get; set; }
[ShowReport] [ShowReport]
[Validation2(ValidationCode.NOT_NULL)] [Validation(ValidationCode.NOT_NULL)]
public DateTime? PortFacilityDateOfArrival { get; set; } public DateTime? PortFacilityDateOfArrival { get; set; }
[ShowReport] [ShowReport]
[Validation2(ValidationCode.NOT_NULL)] [Validation(ValidationCode.NOT_NULL)]
public DateTime? PortFacilityDateOfDeparture { get; set; } public DateTime? PortFacilityDateOfDeparture { get; set; }
[ShowReport] [ShowReport]
[Validation2(ValidationCode.NOT_NULL)] [Validation(ValidationCode.NOT_NULL)]
public byte? PortFacilityShipSecurityLevel { get; set; } public byte? PortFacilityShipSecurityLevel { get; set; }
[ShowReport] [ShowReport]
public string PortFacilitySecurityMattersToReport { get; set; } public string PortFacilitySecurityMattersToReport { get; set; }
[ShowReport] [ShowReport]
[Validation2(ValidationCode.GISIS)] [Validation(ValidationCode.GISIS)]
public string PortFacilityGISISCode { get; set; } public string PortFacilityGISISCode { get; set; }
public string Identifier { get; set; } public string Identifier { get; set; }

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")] [assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("2.4.0")] [assembly: AssemblyInformationalVersion("2.4.1")]
[assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")] [assembly: AssemblyCopyright("Copyright © 2014-2015 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -4,6 +4,6 @@
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.4.0.*")] [assembly: AssemblyVersion("2.4.1.*")]
// wenn das nicht auskommentiert wird erhalten wir eine Warnung // wenn das nicht auskommentiert wird erhalten wir eine Warnung
// [assembly: AssemblyFileVersion("1.0.0.*")] // [assembly: AssemblyFileVersion("1.0.0.*")]

View File

@ -224,6 +224,8 @@ namespace bsmd.database
newWaste.WasteCapacity_MTQ = 0; newWaste.WasteCapacity_MTQ = 0;
newWaste.WasteDisposalAmount_MTQ = 0; newWaste.WasteDisposalAmount_MTQ = 0;
newWaste.Identifier = ""; newWaste.Identifier = "";
newWaste.WasteDisposalPort = "ZZUKN";
newWaste.WasteDescription = "-";
newWaste.WAS = this; newWaste.WAS = this;
this.Waste.Add(newWaste); this.Waste.Add(newWaste);
result.Add(newWaste); result.Add(newWaste);

View File

@ -895,12 +895,21 @@ namespace bsmd.dbh
{ {
RootHAZA rootHAZA = new RootHAZA(); RootHAZA rootHAZA = new RootHAZA();
HAZ haz = message.Elements[0] as HAZ; HAZ haz = message.Elements[0] as HAZ;
rootHAZA.Items = new object[4];
if(haz.DPGManifestOnBoardOnArrival.HasValue) if (haz.NoDPGOnBoardOnArrival ?? false)
rootHAZA.Items[0] = haz.DPGManifestOnBoardOnArrival.Value ? RootHAZADPGManifestOnBoardOnArrival.Y : RootHAZADPGManifestOnBoardOnArrival.N; {
rootHAZA.Items = new object[1];
rootHAZA.Items[0] = RootHAZANoDPGOnBoardOnArrival.Y;
}
else
{
rootHAZA.Items = new object[3];
// if(haz.DPGManifestOnBoardOnArrival.HasValue)
rootHAZA.Items[0] = (haz.DPGManifestOnBoardOnArrival ?? false) ? RootHAZADPGManifestOnBoardOnArrival.Y : RootHAZADPGManifestOnBoardOnArrival.N;
#region HAZ positions #region HAZ positions
RootHAZADPGOnArrival dpgOnArrival = new RootHAZADPGOnArrival(); RootHAZADPGOnArrival dpgOnArrival = new RootHAZADPGOnArrival();
#region IMDG #region IMDG
@ -1090,6 +1099,7 @@ namespace bsmd.dbh
#endregion #endregion
rootHAZA.Items[1] = dpgOnArrival; rootHAZA.Items[1] = dpgOnArrival;
#endregion #endregion
if (haz.INFShipClass.HasValue) if (haz.INFShipClass.HasValue)
@ -1097,9 +1107,7 @@ namespace bsmd.dbh
RootHAZAINFShipClass infShipClass = (RootHAZAINFShipClass)haz.INFShipClass.Value; RootHAZAINFShipClass infShipClass = (RootHAZAINFShipClass)haz.INFShipClass.Value;
rootHAZA.Items[2] = infShipClass; rootHAZA.Items[2] = infShipClass;
} }
}
if (haz.NoDPGOnBoardOnArrival ?? false)
rootHAZA.Items[3] = RootHAZANoDPGOnBoardOnArrival.Y;
item = rootHAZA; item = rootHAZA;
} }
@ -1112,12 +1120,22 @@ namespace bsmd.dbh
{ {
RootHAZD rootHAZD = new RootHAZD(); RootHAZD rootHAZD = new RootHAZD();
HAZ haz = message.Elements[0] as HAZ; HAZ haz = message.Elements[0] as HAZ;
rootHAZD.Items = new object[4];
if (haz.NoDPGOnBoardOnArrival ?? false)
{
rootHAZD.Items = new object[1];
rootHAZD.Items[3] = RootHAZDNoDPGOnBoardOnDeparture.Y;
}
else
{
rootHAZD.Items = new object[3];
if (haz.DPGManifestOnBoardOnArrival.HasValue) if (haz.DPGManifestOnBoardOnArrival.HasValue)
rootHAZD.Items[0] = haz.DPGManifestOnBoardOnArrival.Value ? RootHAZDDPGManifestOnBoardOnDeparture.Y : RootHAZDDPGManifestOnBoardOnDeparture.N; rootHAZD.Items[0] = haz.DPGManifestOnBoardOnArrival.Value ? RootHAZDDPGManifestOnBoardOnDeparture.Y : RootHAZDDPGManifestOnBoardOnDeparture.N;
#region HAZ positions #region HAZ positions
RootHAZDDPGOnDeparture dpgOnDeparture = new RootHAZDDPGOnDeparture(); RootHAZDDPGOnDeparture dpgOnDeparture = new RootHAZDDPGOnDeparture();
#region IMDG #region IMDG
@ -1307,6 +1325,7 @@ namespace bsmd.dbh
#endregion #endregion
rootHAZD.Items[1] = dpgOnDeparture; rootHAZD.Items[1] = dpgOnDeparture;
#endregion #endregion
if (haz.INFShipClass.HasValue) if (haz.INFShipClass.HasValue)
@ -1315,8 +1334,8 @@ namespace bsmd.dbh
rootHAZD.Items[2] = infShipClass; rootHAZD.Items[2] = infShipClass;
} }
if (haz.NoDPGOnBoardOnArrival ?? false) }
rootHAZD.Items[3] = RootHAZDNoDPGOnBoardOnDeparture.Y;
item = rootHAZD; item = rootHAZD;
} }

View File

@ -35,11 +35,13 @@ namespace bsmd.herberg.FormService
this.EventLog.Log = "Application"; this.EventLog.Log = "Application";
this.Init(args); this.Init(args);
this.EventLog.WriteEntry("FormService started.", EventLogEntryType.Information); this.EventLog.WriteEntry("FormService started.", EventLogEntryType.Information);
this._log.Info("Starting EU-NOAD FormService.");
this.DoOnce(); this.DoOnce();
} }
protected override void OnStop() protected override void OnStop()
{ {
this._log.Info("Stopping EU-NOAD FormService.");
} }
public void Init(string[] args) public void Init(string[] args)

View File

@ -6,12 +6,7 @@ using System.Runtime.InteropServices;
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("bsmd.herberg.FormService")] [assembly: AssemblyTitle("bsmd.herberg.FormService")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("Imports Herberg Fleettracker form data")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("bsmd.herberg.FormService")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible // Setting ComVisible to false makes the types in this assembly not visible
@ -21,16 +16,3 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM // The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("663d14d2-42ce-4efd-9915-82254b211d81")] [assembly: Guid("663d14d2-42ce-4efd-9915-82254b211d81")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -651,9 +651,11 @@ namespace bsmd.herberg.FormService
#region CREW #region CREW
case "CREW": case "CREW":
{ {
Dictionary<string, string> keysInMessage = new Dictionary<string, string>();
foreach (int key in nDict.Keys) foreach (int key in nDict.Keys)
{ {
Dictionary<string, string> pDict = nDict[key]; Dictionary<string, string> pDict = nDict[key];
keysInMessage.Add(key.ToString(), key.ToString());
CREW crew = theMessage.GetSublistElementWithIdentifier(key.ToString()) as CREW; CREW crew = theMessage.GetSublistElementWithIdentifier(key.ToString()) as CREW;
if (crew == null) if (crew == null)
{ {
@ -680,9 +682,18 @@ namespace bsmd.herberg.FormService
{ {
_log.ErrorFormat("Error reading CREW fields: {0}", ex.Message); _log.ErrorFormat("Error reading CREW fields: {0}", ex.Message);
} }
saveMessages.Add(crew); saveMessages.Add(crew);
} }
// check for missing messages (crew deleted in EU-NOAD)
foreach (CREW crew in theMessage.Elements)
{
if (!keysInMessage.ContainsKey(crew.Identifier))
{
_log.InfoFormat("CREW {0} {1}, Ident {2} not found in EU-NOAD message, removing!",
crew.CrewMemberLastName ?? "", crew.CrewMemberFirstName ?? "", crew.Identifier);
DBManager.Instance.Delete(crew);
}
}
} }
break; break;
#endregion #endregion
@ -816,9 +827,11 @@ namespace bsmd.herberg.FormService
#region PAS #region PAS
case "PAS": case "PAS":
{ {
Dictionary<string, string> keysInMessage = new Dictionary<string, string>();
foreach (int key in nDict.Keys) foreach (int key in nDict.Keys)
{ {
Dictionary<string, string> pDict = nDict[key]; Dictionary<string, string> pDict = nDict[key];
keysInMessage.Add(key.ToString(), key.ToString());
PAS pas = theMessage.GetSublistElementWithIdentifier(key.ToString()) as PAS; PAS pas = theMessage.GetSublistElementWithIdentifier(key.ToString()) as PAS;
if (pas == null) if (pas == null)
{ {
@ -852,6 +865,16 @@ namespace bsmd.herberg.FormService
saveMessages.Add(pas); saveMessages.Add(pas);
} }
// check for missing messages (passenger deleted in EU-NOAD)
foreach (PAS pas in theMessage.Elements)
{
if (!keysInMessage.ContainsKey(pas.Identifier))
{
_log.InfoFormat("PAS {0} {1}, Ident {2} not found in EU-NOAD message, removing!",
pas.PassengerLastName ?? "", pas.PassengerFirstName ?? "", pas.Identifier);
DBManager.Instance.Delete(pas);
}
}
} }
break; break;
#endregion #endregion

View File

@ -62,6 +62,15 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\bsmd.database\Properties\AssemblyProductInfo.cs">
<Link>Properties\AssemblyProductInfo.cs</Link>
</Compile>
<Compile Include="..\bsmd.database\Properties\AssemblyProjectInfo.cs">
<Link>Properties\AssemblyProjectInfo.cs</Link>
</Compile>
<Compile Include="..\bsmd.database\Properties\AssemblyProjectKeyInfo.cs">
<Link>Properties\AssemblyProjectKeyInfo.cs</Link>
</Compile>
<Compile Include="Enums.cs" /> <Compile Include="Enums.cs" />
<Compile Include="FormService.cs"> <Compile Include="FormService.cs">
<SubType>Component</SubType> <SubType>Component</SubType>