Merge branch 'feature/excel_ref_export' of ssh://lager/mnt/ext/git/git_bsmd into feature/excel_ref_export
This commit is contained in:
commit
5ee9e632c8
@ -1527,10 +1527,10 @@ namespace ENI2.Excel
|
||||
s2sActivity.ShipToShipActivityLocationLoCode = reader.ReadLoCode(s2sLocode);
|
||||
s2sActivity.ShipToShipActivityLocationCoordinatesLatitude = (int?)reader.ReadNumber(s2sLatitude);
|
||||
// keine "0" (d.h. fehlerhafte Koordinaten) ins ANSW übergeben falls im Sheet nichts ist aber der Reader das aus irgendeinem Grund liest
|
||||
if (s2sActivity.ShipToShipActivityLocationCoordinatesLatitude.HasValue && s2sActivity.ShipToShipActivityLocationCoordinatesLatitude.Value == 0)
|
||||
if (s2sActivity.ShipToShipActivityLocationCoordinatesLatitude == 0)
|
||||
s2sActivity.ShipToShipActivityLocationCoordinatesLatitude = null;
|
||||
s2sActivity.ShipToShipActivityLocationCoordinatesLongitude = (int?)reader.ReadNumber(s2sLongitude);
|
||||
if (s2sActivity.ShipToShipActivityLocationCoordinatesLongitude.HasValue && s2sActivity.ShipToShipActivityLocationCoordinatesLongitude.Value == 0)
|
||||
if (s2sActivity.ShipToShipActivityLocationCoordinatesLongitude == 0)
|
||||
s2sActivity.ShipToShipActivityLocationCoordinatesLongitude = null;
|
||||
s2sActivity.ShipToShipActivityDateFrom = reader.ReadDate(s2sFromDate);
|
||||
s2sActivity.ShipToShipActivityDateTo = reader.ReadDate(s2sToDate);
|
||||
|
||||
@ -82,7 +82,11 @@ namespace ENI2.Excel
|
||||
this.WriteHAZ(message, false);
|
||||
break;
|
||||
case Message.NotificationClass.INFO:
|
||||
if (message.Elements[0] is INFO info) this.WriteMessage(info);
|
||||
if (message.Elements[0] is INFO info)
|
||||
{
|
||||
this.WriteMessage(info);
|
||||
this.WriteINFO(info);
|
||||
}
|
||||
break;
|
||||
case Message.NotificationClass.LADG:
|
||||
this.WriteLADG(message);
|
||||
@ -123,7 +127,11 @@ namespace ENI2.Excel
|
||||
this.WriteSERV(message);
|
||||
break;
|
||||
case Message.NotificationClass.STAT:
|
||||
if (message.Elements[0] is STAT stat) this.WriteMessage(stat);
|
||||
if (message.Elements[0] is STAT stat)
|
||||
{
|
||||
this.WriteMessage(stat);
|
||||
WriteText("STAT.TransportMode", stat.TransportModeDisplay);
|
||||
}
|
||||
break;
|
||||
case Message.NotificationClass.STO:
|
||||
this.WriteSTO(message);
|
||||
@ -159,7 +167,7 @@ namespace ENI2.Excel
|
||||
|
||||
WriteCore(core);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
@ -263,9 +271,9 @@ namespace ENI2.Excel
|
||||
{
|
||||
switch (ladg.CargoHandlingType)
|
||||
{
|
||||
case 1: WriteText(lnCHT, "load"); break;
|
||||
case 2: WriteText(lnCHT, "discharge"); break;
|
||||
case 3: WriteText(lnCHT, "transit"); break;
|
||||
case 0: WriteText(lnCHT, "load"); break;
|
||||
case 1: WriteText(lnCHT, "discharge"); break;
|
||||
case 2: WriteText(lnCHT, "transit"); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@ -393,27 +401,29 @@ namespace ENI2.Excel
|
||||
case 2: WriteText(shipClass, "INF3"); break;
|
||||
}
|
||||
|
||||
string className = isArrival ? "HAZA" : "HAZD";
|
||||
|
||||
#region IMDB
|
||||
|
||||
for (int i = 0; i < Math.Min(haz.IMDGPositions.Count, 10); i++)
|
||||
{
|
||||
string imdg_unno = string.Format("HAZA.IMDG.UNNumber_{0}", i + 1);
|
||||
string imdg_properShippingName = string.Format("HAZA.IMDG.ProperShippingName_{0}", i + 1);
|
||||
string imdg_imoClass = string.Format("HAZA.IMDG.IMOClass_{0}", i + 1);
|
||||
string imdg_packingGroup = string.Format("HAZA.IMDG.PackingGroup_{0}", i + 1);
|
||||
string imdg_marinePollutant = string.Format("HAZA.IMDG.MarinePollutant_{0}", i + 1);
|
||||
string imdg_flashpoint = string.Format("HAZA.IMDG.Flashpoint_CEL_{0}", i + 1);
|
||||
string imdg_numberOfPackages = string.Format("HAZA.IMDG.NumberOfPackages_{0}", i + 1);
|
||||
string imdg_packageType = string.Format("HAZA.IMDG.PackageType_{0}", i + 1);
|
||||
string imdg_limitedQuantities = string.Format("HAZA.IMDG.LimitedQuantities_{0}", i + 1);
|
||||
string imdg_exceptedQuantities = string.Format("HAZA.IMDG.ExceptedQuantities_{0}", i + 1);
|
||||
string imdg_netQuantity = string.Format("HAZA.IMDG.NetQuantity_KGM_{0}", i + 1);
|
||||
string imdg_grossQuantity = string.Format("HAZA.IMDG.GrossQuantity_KGM_{0}", i + 1);
|
||||
string imdg_number = string.Format("HAZA.IMDG.Number_{0}", i + 1);
|
||||
string imdg_stowagePosition = string.Format("HAZA.IMDG.StowagePosition_{0}", i + 1);
|
||||
string imdg_portOfLoading = string.Format("HAZA.IMDG.PortOfLoading_{0}", i + 1);
|
||||
string imdg_portOfDischarge = string.Format("HAZA.IMDG.PortOfDischarge_{0}", i + 1);
|
||||
string imdg_containerNumber = string.Format("HAZA.IMDG.ContainerNumber_{0}", i + 1);
|
||||
string imdg_unno = string.Format("{1}.IMDG.UNNumber_{0}", i + 1, className);
|
||||
string imdg_properShippingName = string.Format("{1}.IMDG.ProperShippingName_{0}", i + 1, className);
|
||||
string imdg_imoClass = string.Format("{1}.IMDG.IMOClass_{0}", i + 1, className);
|
||||
string imdg_packingGroup = string.Format("{1}.IMDG.PackingGroup_{0}", i + 1, className);
|
||||
string imdg_marinePollutant = string.Format("{1}.IMDG.MarinePollutant_{0}", i + 1, className);
|
||||
string imdg_flashpoint = string.Format("{1}.IMDG.Flashpoint_CEL_{0}", i + 1, className);
|
||||
string imdg_numberOfPackages = string.Format("{1}.IMDG.NumberOfPackages_{0}", i + 1, className);
|
||||
string imdg_packageType = string.Format("{1}.IMDG.PackageType_{0}", i + 1, className);
|
||||
string imdg_limitedQuantities = string.Format("{1}.IMDG.LimitedQuantities_{0}", i + 1, className);
|
||||
string imdg_exceptedQuantities = string.Format("{1}.IMDG.ExceptedQuantities_{0}", i + 1, className);
|
||||
string imdg_netQuantity = string.Format("{1}.IMDG.NetQuantity_KGM_{0}", i + 1, className);
|
||||
string imdg_grossQuantity = string.Format("{1}.IMDG.GrossQuantity_KGM_{0}", i + 1, className);
|
||||
string imdg_number = string.Format("{1}.IMDG.Number_{0}", i + 1, className);
|
||||
string imdg_stowagePosition = string.Format("{1}.IMDG.StowagePosition_{0}", i + 1, className);
|
||||
string imdg_portOfLoading = string.Format("{1}.IMDG.PortOfLoading_{0}", i + 1, className);
|
||||
string imdg_portOfDischarge = string.Format("{1}.IMDG.PortOfDischarge_{0}", i + 1, className);
|
||||
string imdg_containerNumber = string.Format("{1}.IMDG.ContainerNumber_{0}", i + 1, className);
|
||||
IMDGPosition imdgPosition = haz.IMDGPositions[i];
|
||||
WriteText(imdg_unno, imdgPosition.UNNumber);
|
||||
WriteText(imdg_properShippingName, imdgPosition.ProperShippingName);
|
||||
@ -451,13 +461,13 @@ namespace ENI2.Excel
|
||||
|
||||
for (int i = 0; i < Math.Min(haz.IBCPositions.Count, 5); i++)
|
||||
{
|
||||
string ibc_productName = string.Format("HAZA.IBC.ProductName_{0}", i + 1);
|
||||
string ibc_pollutionCategory = string.Format("HAZA.IBC.PollutionCategory_{0}", i + 1);
|
||||
string ibc_flash = string.Format("HAZA.IBC.FlashpointInformation_{0}", i + 1);
|
||||
string ibc_quantity = string.Format("HAZA.IBC.Quantity_KGM_{0}", i + 1);
|
||||
string ibc_stowagePosition = string.Format("HAZA.IBC.StowagePosition_{0}", i + 1);
|
||||
string ibc_portOfLoading = string.Format("HAZA.IBC.PortOfLoading_{0}", i + 1);
|
||||
string ibc_portOfDischarge = string.Format("HAZA.IBC.PortOfDischarge_{0}", i + 1);
|
||||
string ibc_productName = string.Format("{1}.IBC.ProductName_{0}", i + 1, className);
|
||||
string ibc_pollutionCategory = string.Format("{1}.IBC.PollutionCategory_{0}", i + 1, className);
|
||||
string ibc_flash = string.Format("{1}.IBC.FlashpointInformation_{0}", i + 1, className);
|
||||
string ibc_quantity = string.Format("{1}.IBC.Quantity_KGM_{0}", i + 1, className);
|
||||
string ibc_stowagePosition = string.Format("{1}.IBC.StowagePosition_{0}", i + 1, className);
|
||||
string ibc_portOfLoading = string.Format("{1}.IBC.PortOfLoading_{0}", i + 1, className);
|
||||
string ibc_portOfDischarge = string.Format("{1}.IBC.PortOfDischarge_{0}", i + 1, className);
|
||||
IBCPosition ibcPosition = haz.IBCPositions[i];
|
||||
WriteText(ibc_productName, ibcPosition.ProductName);
|
||||
if(ibcPosition.PollutionCategory.HasValue)
|
||||
@ -484,11 +494,11 @@ namespace ENI2.Excel
|
||||
|
||||
for (int i = 0; i < Math.Min(haz.IGCPositions.Count, 5); i++)
|
||||
{
|
||||
string igc_productName = string.Format("HAZA.IGC.ProductName_{0}", i + 1);
|
||||
string igc_quantity = string.Format("HAZA.IGC.Quantity_KGM_{0}", i + 1);
|
||||
string igc_stowagePosition = string.Format("HAZA.IGC.StowagePosition_{0}", i + 1);
|
||||
string igc_portOfLoading = string.Format("HAZA.IGC.PortOfLoading_{0}", i + 1);
|
||||
string igc_portOfDischarge = string.Format("HAZA.IGC.PortOfDischarge_{0}", i + 1);
|
||||
string igc_productName = string.Format("{1}.IGC.ProductName_{0}", i + 1, className);
|
||||
string igc_quantity = string.Format("{1}.IGC.Quantity_KGM_{0}", i + 1, className);
|
||||
string igc_stowagePosition = string.Format("{1}.IGC.StowagePosition_{0}", i + 1, className);
|
||||
string igc_portOfLoading = string.Format("{1}.IGC.PortOfLoading_{0}", i + 1, className);
|
||||
string igc_portOfDischarge = string.Format("{1}.IGC.PortOfDischarge_{0}", i + 1, className);
|
||||
IGCPosition igcPosition = haz.IGCPositions[i];
|
||||
WriteText(igc_productName, igcPosition.ProductName);
|
||||
if (igcPosition.Quantity_KGM.HasValue)
|
||||
@ -504,12 +514,12 @@ namespace ENI2.Excel
|
||||
|
||||
for (int i = 0; i < Math.Min(haz.IMSBCPositions.Count, 5); i++)
|
||||
{
|
||||
string imsbc_bcsn = string.Format("HAZA.IMSBC.BulkCargoShippingName_{0}", i + 1);
|
||||
string imsbc_mhb = string.Format("HAZA.IMSBC.MHB_{0}", i + 1);
|
||||
string imsbc_quantity = string.Format("HAZA.IMSBC.Quantity_KGM_{0}", i + 1);
|
||||
string imsbc_stowagePosition = string.Format("HAZA.IMSBC.StowagePosition_{0}", i + 1);
|
||||
string imsbc_portOfLoading = string.Format("HAZA.IMSBC.PortOfLoading_{0}", i + 1);
|
||||
string imsbc_portOfDischarge = string.Format("HAZA.IMSBC.PortOfDischarge_{0}", i + 1);
|
||||
string imsbc_bcsn = string.Format("{1}.IMSBC.BulkCargoShippingName_{0}", i + 1, className);
|
||||
string imsbc_mhb = string.Format("{1}.IMSBC.MHB_{0}", i + 1, className);
|
||||
string imsbc_quantity = string.Format("{1}.IMSBC.Quantity_KGM_{0}", i + 1, className);
|
||||
string imsbc_stowagePosition = string.Format("{1}.IMSBC.StowagePosition_{0}", i + 1, className);
|
||||
string imsbc_portOfLoading = string.Format("{1}.IMSBC.PortOfLoading_{0}", i + 1, className);
|
||||
string imsbc_portOfDischarge = string.Format("{1}.IMSBC.PortOfDischarge_{0}", i + 1, className);
|
||||
IMSBCPosition imsbcPosition = haz.IMSBCPositions[i];
|
||||
WriteText(imsbc_bcsn, imsbcPosition.BulkCargoShippingName);
|
||||
WriteBoolean(imsbc_mhb, imsbcPosition.MHB);
|
||||
@ -526,12 +536,12 @@ namespace ENI2.Excel
|
||||
|
||||
for (int i = 0; i < Math.Min(haz.MARPOLPositions.Count, 5); i++)
|
||||
{
|
||||
string marpol_name = string.Format("HAZA.MARPOL.Name_{0}", i + 1);
|
||||
string marpol_flash = string.Format("HAZA.MARPOL.Flashpoint_CEL_{0}", i + 1);
|
||||
string marpol_quantity = string.Format("HAZA.MARPOL.Quantity_KGM_{0}", i + 1);
|
||||
string marpol_stowagePosition = string.Format("HAZA.MARPOL.StowagePosition_{0}", i + 1);
|
||||
string marpol_portOfLoading = string.Format("HAZA.MARPOL.PortOfLoading_{0}", i + 1);
|
||||
string marpol_portOfDischarge = string.Format("HAZA.MARPOL.PortOfDischarge_{0}", i + 1);
|
||||
string marpol_name = string.Format("{1}.MARPOL.Name_{0}", i + 1, className);
|
||||
string marpol_flash = string.Format("{1}.MARPOL.Flashpoint_CEL_{0}", i + 1, className);
|
||||
string marpol_quantity = string.Format("{1}.MARPOL.Quantity_KGM_{0}", i + 1, className);
|
||||
string marpol_stowagePosition = string.Format("{1}.MARPOL.StowagePosition_{0}", i + 1, className);
|
||||
string marpol_portOfLoading = string.Format("{1}.MARPOL.PortOfLoading_{0}", i + 1, className);
|
||||
string marpol_portOfDischarge = string.Format("{1}.MARPOL.PortOfDischarge_{0}", i + 1, className);
|
||||
MARPOL_Annex_I_Position marpolPosition = haz.MARPOLPositions[i];
|
||||
WriteText(marpol_name, marpolPosition.Name);
|
||||
WriteText(marpol_flash, marpolPosition.Flashpoint_CEL);
|
||||
@ -961,6 +971,28 @@ namespace ENI2.Excel
|
||||
|
||||
#endregion
|
||||
|
||||
#region INFO
|
||||
|
||||
private void WriteINFO(INFO info)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
this.WriteBoolean("INFO.FumigatedBulkCargo", info.FumigatedBulkCargoBool);
|
||||
|
||||
if (info.ShippingArea.HasValue)
|
||||
{
|
||||
switch (info.ShippingArea.Value)
|
||||
{
|
||||
case 0: this.WriteText("INFO.ShippingArea", "NORTH_BALTIC_SEA"); break;
|
||||
case 1: this.WriteText("INFO.ShippingArea", "EUROPE"); break;
|
||||
case 2: this.WriteText("INFO.ShippingArea", "OVERSEAS"); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region write simple things
|
||||
|
||||
@ -67,7 +67,7 @@ namespace bsmd.database
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.FumigatedBulkCargo.HasValue) return (this.FumigatedBulkCargo.Value != 0);
|
||||
if (this.FumigatedBulkCargo.HasValue) return this.FumigatedBulkCargo.Value != 0;
|
||||
return null;
|
||||
}
|
||||
set
|
||||
@ -148,7 +148,7 @@ namespace bsmd.database
|
||||
}
|
||||
else
|
||||
{
|
||||
scmd.Parameters.AddWithValue(@"ID", this.Id);
|
||||
scmd.Parameters.AddWithValue("ID", this.Id);
|
||||
scmd.CommandText = string.Format("UPDATE {0} SET ShippingArea = @P2, RequestedPositionInPortOfCall = @P3, " +
|
||||
"SpecialRequirementsOfShipAtBerth = @P4, ConstructionCharacteristicsOfShip = @P5, FumigatedBulkCargo = @P6," +
|
||||
"DeplacementSummerDraught_TNE = @P7, PortArea = @P8, BowThrusterPower = @P9, SternThrusterPower = @P10, " +
|
||||
|
||||
@ -61,6 +61,7 @@ namespace bsmd.database
|
||||
// nach Util verschoben
|
||||
[MaxLength(255)]
|
||||
[ENI2Validation]
|
||||
[LookupName("PRE72H.PlannedWorks")]
|
||||
public string PlannedWorks { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -124,7 +125,7 @@ namespace bsmd.database
|
||||
}
|
||||
else
|
||||
{
|
||||
scmd.Parameters.AddWithValue(@"ID", this.Id);
|
||||
scmd.Parameters.AddWithValue("ID", this.Id);
|
||||
scmd.CommandText = string.Format("UPDATE {0} SET Tanker = @P2, TankerHullConfiguration = @P3, " +
|
||||
"ConditionCargoBallastTanks = @P4, NatureOfCargo = @P5, VolumeOfCargo = @P6," +
|
||||
"PlannedOperations = @P7, PlannedWorks = @P8, DateOfLastExpandedInspection = @P9, " +
|
||||
@ -191,7 +192,7 @@ namespace bsmd.database
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V741, "TankerHullConfiguration", null, this.Title, null, this.Tablename));
|
||||
if (!this.ConditionCargoBallastTanks.HasValue)
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V741, "ConditionCargoBallastTanks", null, this.Title, null, this.Tablename));
|
||||
if (this.VolumeOfCargo.HasValue && this.VolumeOfCargo.Value == 0)
|
||||
if (this.VolumeOfCargo == 0)
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.DOUBLE_GT_ZERO, "VolumeOfCargo must be > 0", null, this.Title, null, this.Tablename));
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@ namespace bsmd.database
|
||||
[MaxLength(50)]
|
||||
[ENI2Validation]
|
||||
[DataMember]
|
||||
[LookupName("STAT.CallSign")]
|
||||
public string CallSign { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -49,6 +50,7 @@ namespace bsmd.database
|
||||
[MaxLength(50)]
|
||||
[ENI2Validation]
|
||||
[DataMember]
|
||||
[LookupName("STAT.MMSINumber")]
|
||||
public string MMSINumber { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -56,6 +58,7 @@ namespace bsmd.database
|
||||
[MaxLength(2)]
|
||||
[ENI2Validation]
|
||||
[DataMember]
|
||||
[LookupName("STAT.Flag")]
|
||||
public string Flag { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -84,6 +87,7 @@ namespace bsmd.database
|
||||
[MaxLength(5)]
|
||||
[ENI2Validation]
|
||||
[DataMember]
|
||||
[LookupName("STAT.PortOfRegistry")]
|
||||
public string PortOfRegistry { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -138,6 +142,7 @@ namespace bsmd.database
|
||||
[MaxLength(10)]
|
||||
[ENI2Validation]
|
||||
[DataMember]
|
||||
[LookupName("STAT.ISMCompanyId")]
|
||||
public string ISMCompanyId { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
@ -333,7 +338,7 @@ namespace bsmd.database
|
||||
|
||||
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
|
||||
{
|
||||
if (this.GrossTonnage.HasValue && (this.GrossTonnage.Value >= 500) && (this.ISMCompanyName.IsNullOrEmpty() || this.ISMCompanyId.IsNullOrEmpty()))
|
||||
if (this.GrossTonnage >= 500 && (this.ISMCompanyName.IsNullOrEmpty() || this.ISMCompanyId.IsNullOrEmpty()))
|
||||
violations.Add(RuleEngine.CreateViolation(ValidationCode.V821, "ISMCompanyId/Name must be provided", null, this.Title, null, this.Tablename));
|
||||
// Neue Regeln vom 1.4.2019
|
||||
if (this.LengthOverall_MTR.HasValue && ((this.LengthOverall_MTR.Value < 10) || (this.LengthOverall_MTR.Value > 500)))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user