Update To 3.0.1

This commit is contained in:
Daniel Schick 2016-03-05 08:27:06 +00:00
parent a457c61243
commit c28020e1ac
9 changed files with 78 additions and 11 deletions

View File

@ -0,0 +1,10 @@
PRINT N'Altering [dbo].[HAZA]...';
GO
ALTER TABLE [dbo].[HAZA] ADD [MOUBaltic] BIT NULL;
GO
PRINT N'Altering [dbo].[HAZD]...';
GO
ALTER TABLE [dbo].[HAZD] ADD [MOUBaltic] BIT NULL;
GO

View File

@ -23,6 +23,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>

View File

@ -41,6 +41,9 @@ namespace bsmd.database
[ShowReport]
public byte? INFShipClass { get; set; }
[ShowReport]
public bool? MOUBaltic { get; set; }
[ShowReport]
public bool? DPGClassificationIMDG { get; set; }
@ -100,6 +103,7 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P8", this.DPGClassificationIMSBC);
scmd.Parameters.AddWithNullableValue("@P9", this.DPGClassificationMARPOL_ANNEX_I);
scmd.Parameters.AddWithNullableValue("@P10", this.TransmissionType);
scmd.Parameters.AddWithNullableValue("@P11", this.MOUBaltic);
if (this.IsNew)
{
@ -109,13 +113,15 @@ namespace bsmd.database
{
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, NoDPGOnBoardOnDeparture, DPGManifestOnBoardOnDeparture, " +
"INFShipClass, DPGClassificationIMDG, DPGClassificationIGC, DPGClassificationIBC, DPGClassificationIMSBC, " +
"DPGClassificationMARPOL_ANNEX_I, TransmissionType) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10)", this.Tablename);
"DPGClassificationMARPOL_ANNEX_I, TransmissionType, MOUBaltic) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)",
this.Tablename);
}
else
{
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, NoDPGOnBoardOnArrival, DPGManifestOnBoardOnArrival, " +
"INFShipClass, DPGClassificationIMDG, DPGClassificationIGC, DPGClassificationIBC, DPGClassificationIMSBC, " +
"DPGClassificationMARPOL_ANNEX_I, TransmissionType) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10)", this.Tablename);
"DPGClassificationMARPOL_ANNEX_I, TransmissionType, MOUBaltic) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)",
this.Tablename);
}
}
else
@ -125,13 +131,13 @@ namespace bsmd.database
{
scmd.CommandText = string.Format("UPDATE {0} SET NODPGOnBoardOnDeparture = @P2, DPGManifestOnBoardOnDeparture = @P3, " +
"INFShipClass = @P4, DPGClassificationIMDG = @P5, DPGClassificationIGC = @P6, DPGClassificationIBC = @P7, " +
"DPGClassificationIMSBC = @P8, DPGClassificationMARPOL_ANNEX_I = @P9, TransmissionType = @P10 WHERE Id = @ID", this.Tablename);
"DPGClassificationIMSBC = @P8, DPGClassificationMARPOL_ANNEX_I = @P9, TransmissionType = @P10, MOUBaltic = @P11 WHERE Id = @ID", this.Tablename);
}
else
{
scmd.CommandText = string.Format("UPDATE {0} SET NODPGOnBoardOnArrival = @P2, DPGManifestOnBoardOnArrival = @P3, " +
"INFShipClass = @P4, DPGClassificationIMDG = @P5, DPGClassificationIGC = @P6, DPGClassificationIBC = @P7, " +
"DPGClassificationIMSBC = @P8, DPGClassificationMARPOL_ANNEX_I = @P9, TransmissionType = @P10 WHERE Id = @ID", this.Tablename);
"DPGClassificationIMSBC = @P8, DPGClassificationMARPOL_ANNEX_I = @P9, TransmissionType = @P10, MOUBaltic = @P11 WHERE Id = @ID", this.Tablename);
}
}
}
@ -140,13 +146,13 @@ namespace bsmd.database
{
string query = string.Format("SELECT Id, NoDPGOnBoardOnArrival, DPGManifestOnBoardOnArrival, INFShipClass, " +
"DPGClassificationIMDG, DPGClassificationIGC, DPGClassificationIBC, DPGClassificationIMSBC, " +
"DPGClassificationMARPOL_ANNEX_I, TransmissionType FROM {0} ", this.Tablename);
"DPGClassificationMARPOL_ANNEX_I, TransmissionType, MOUBaltic FROM {0} ", this.Tablename);
if (this.IsDeparture)
{
query = string.Format("SELECT Id, NoDPGOnBoardOnDeparture, DPGManifestOnBoardOnDeparture, INFShipClass, " +
"DPGClassificationIMDG, DPGClassificationIGC, DPGClassificationIBC, DPGClassificationIMSBC, " +
"DPGClassificationMARPOL_ANNEX_I, TransmissionType FROM {0} ", this.Tablename);
"DPGClassificationMARPOL_ANNEX_I, TransmissionType, MOUBaltic FROM {0} ", this.Tablename);
}
switch (filter)
@ -182,6 +188,7 @@ namespace bsmd.database
if (!reader.IsDBNull(7)) haz.DPGClassificationIMSBC = reader.GetBoolean(7);
if (!reader.IsDBNull(8)) haz.DPGClassificationMARPOL_ANNEX_I = reader.GetBoolean(8);
if (!reader.IsDBNull(9)) haz.TransmissionType = reader.GetString(9);
if (!reader.IsDBNull(10)) haz.MOUBaltic = reader.GetBoolean(10);
result.Add(haz);
}

View File

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

View File

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

View File

@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View File

@ -22,6 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>

View File

@ -263,6 +263,42 @@ namespace bsmd.herberg.FormService
break;
#endregion
#region AGNT
case "Agency":
{
if(theMessage.Elements.Count == 0)
{
AGNT newAGNT = new AGNT();
newAGNT.MessageHeader = theMessage;
theMessage.MessageNotificationClass = Message.NotificationClass.AGNT;
theMessage.Elements.Add(newAGNT);
}
AGNT agnt = theMessage.Elements[0] as AGNT;
derivedMessage = agnt;
if(agnt != null)
{
try
{
if (vDict.ContainsKey("Name")) agnt.AgentCompanyName = vDict["Name"];
if (vDict.ContainsKey("NameStreetandNumber")) agnt.AgentStreetAndNumber = vDict["NameStreetandNumber"];
if (vDict.ContainsKey("PostalCode")) agnt.AgentPostalCode = vDict["PostalCode"];
if (vDict.ContainsKey("City")) agnt.AgentCity = vDict["City"];
if (vDict.ContainsKey("Country")) agnt.AgentCountry = vDict["Country"];
if (vDict.ContainsKey("ContactLastName")) agnt.AgentLastName = vDict["ContactLastName"];
if (vDict.ContainsKey("ContactFirstName")) agnt.AgentFirstName = vDict["ContactFirstName"];
if (vDict.ContainsKey("Phone")) agnt.AgentPhone = vDict["Phone"];
if (vDict.ContainsKey("Fax")) agnt.AgentFax = vDict["Fax"];
if (vDict.ContainsKey("Email")) agnt.AgentEMail = vDict["Email"];
}
catch (Exception ex)
{
_log.ErrorFormat("Error reading AGNT fields: {0}", ex.Message);
}
}
}
break;
#endregion
#region NAME
case "NAME":
{
@ -397,7 +433,7 @@ namespace bsmd.herberg.FormService
if (vDict.ContainsKey("ISMCompanyCountry")) stat.ISMCompanyCountry = vDict["ISMCompanyCountry"];
if (stat.Flag.IsNullOrEmpty() && vDict.ContainsKey("CountryCodeOfRegistry"))
stat.Flag = vDict["CountryCodeOfRegistry"];
if (vDict.ContainsKey("TransportMode")) stat.TransportMode = vDict["TransportMode"];
}
catch (Exception ex)
{
@ -834,6 +870,11 @@ namespace bsmd.herberg.FormService
{
info.FumigatedBulkCargo = (byte)Enums.FumigatedBulkCargo.N;
}
if (vDict.ContainsKey("PortArea")) info.PortArea = vDict["PortArea"];
if (vDict.ContainsKey("BowThrusterPower")) info.BowThrusterPower = vDict["BowThrusterPower"];
if (vDict.ContainsKey("SternThrusterPower")) info.SternThrusterPower = vDict["SternThrusterPower"];
if (vDict.ContainsKey("DeadWeightSummer_TNE")) info.DeplacementSummerDraught_TNE = Extensions.TryParseDouble(vDict["DeadWeightSummer_TNE"]);
}
catch(Exception ex)
{
@ -1404,6 +1445,7 @@ namespace bsmd.herberg.FormService
{
if (vDict.ContainsKey("TransmissionType")) haz.TransmissionType = vDict["TransmissionType"];
if (vDict.ContainsKey("NoDPGOnBoard")) haz.NoDPGOnBoardOnArrival = vDict["NoDPGOnBoard"].Equals("Y");
if (vDict.ContainsKey("MOUBaltic")) haz.MOUBaltic = vDict["MOUBaltic"].Equals("Y");
if (vDict.ContainsKey("DPGManifestOnBoard")) haz.DPGManifestOnBoardOnArrival = vDict["DPGManifestOnBoard"].Equals("Y");
if (vDict.ContainsKey("INFShipClass")) haz.INFShipClass = (byte)Enum.Parse(typeof(Enums.INFShipClass), vDict["INFShipClass"], true);
if (vDict.ContainsKey("DPGClassificationIMDG")) haz.DPGClassificationIMDG = vDict["DPGClassificationIMDG"].Equals("1");
@ -1471,6 +1513,9 @@ namespace bsmd.herberg.FormService
if (aDict.ContainsKey("NetQuantity_KGM")) imdgPosition.NetQuantity_KGM = Extensions.TryParseDouble(aDict["NetQuantity_KGM"]);
if (aDict.ContainsKey("GrossQuantity_KGM")) imdgPosition.GrossQuantity_KGM = Extensions.TryParseDouble(aDict["GrossQuantity_KGM"]);
if (aDict.ContainsKey("Volume_MTQ")) imdgPosition.Volume_MTQ = Extensions.TryParseDouble(aDict["Volume_MTQ"]);
if (aDict.ContainsKey("Bay")) imdgPosition.Bay = aDict["Bay"];
if (aDict.ContainsKey("Row")) imdgPosition.Row = aDict["Row"];
if (aDict.ContainsKey("Tier")) imdgPosition.Tier = aDict["Tier"];
if (aDict.ContainsKey("GeneralCargoIBC")) imdgPosition.GeneralCargoIBC = aDict["GeneralCargoIBC"].Equals("Y");
if (aDict.ContainsKey("ContainerNumber")) imdgPosition.ContainerNumber = aDict["ContainerNumber"];
if (aDict.ContainsKey("VehicleLicenseNumber")) imdgPosition.VehicleLicenseNumber = aDict["VehicleLicenseNumber"];

View File

@ -578,6 +578,8 @@ namespace bsmd.hisnord
_nsw.conveyance.Info.DeadWeightSummer_TNESpecified = info.DeplacementSummerDraught_TNE.HasValue;
if (info.FumigatedBulkCargo.HasValue)
_nsw.conveyance.Info.FumigatedBulkCargo = (info.FumigatedBulkCargo.Value == 1) ? yorntype.Y : yorntype.N;
else
_nsw.conveyance.Info.FumigatedBulkCargo = yorntype.N;
_nsw.conveyance.Info.RequestedPositionInPortOfCall = info.RequestedPositionInPortOfCall;
if (info.ShippingArea.HasValue)
_nsw.conveyance.Info.ShippingArea = (shippingareatype)info.ShippingArea.Value;
@ -929,7 +931,7 @@ namespace bsmd.hisnord
_sec.CSOLastName = sec.CSOLastName;
_sec.CSOPhone = sec.CSOPhone;
if (sec.CurrentShipSecurityLevel.HasValue)
_sec.CurrentShipSecurityLevel = (posint13type) (sec.CurrentShipSecurityLevel.Value + 1); // HRO Enumeration is 1-based
_sec.CurrentShipSecurityLevel = (posint13type) (sec.CurrentShipSecurityLevel.Value - 1); // HRO Enumeration is 1-based
if (sec.GeneralDescriptionOfCargo.HasValue)
_sec.GeneralDescriptionOfCargo = (cargodescriptiontype)sec.GeneralDescriptionOfCargo.Value;
if (sec.ISSCDateOfExpiration.HasValue)
@ -960,7 +962,7 @@ namespace bsmd.hisnord
_sec.Last10Ports[i].PortFacilityPortName = sec.LastTenPortFacilitesCalled[i].PortFacilityPortName;
_sec.Last10Ports[i].PortFacilitySecurityMattersToReport = sec.LastTenPortFacilitesCalled[i].PortFacilitySecurityMattersToReport;
if (sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.HasValue)
_sec.Last10Ports[i].PortFacilityShipSecurityLevel = (posint13type) (sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.Value + 1);
_sec.Last10Ports[i].PortFacilityShipSecurityLevel = (posint13type) (sec.LastTenPortFacilitesCalled[i].PortFacilityShipSecurityLevel.Value - 1);
}
}