|
|
|
|
@ -60,6 +60,38 @@ namespace ENI2.Import
|
|
|
|
|
{ if (ScanLADG(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.MDH) && notificationClasses.Contains(Message.NotificationClass.MDH))
|
|
|
|
|
{ if (ScanMDH(message, messages, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.NAME) && notificationClasses.Contains(Message.NotificationClass.NAME))
|
|
|
|
|
{ if (ScanNAME(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.NOA_NOD) && notificationClasses.Contains(Message.NotificationClass.NOA_NOD))
|
|
|
|
|
{ if (ScanNOA_NOD(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.PAS) && notificationClasses.Contains(Message.NotificationClass.PAS))
|
|
|
|
|
{ if (ScanPAS(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.PASD) && notificationClasses.Contains(Message.NotificationClass.PASD))
|
|
|
|
|
{ if (ScanPASD(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.POBA) && notificationClasses.Contains(Message.NotificationClass.POBA))
|
|
|
|
|
{ if (ScanPOBA(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.POBD) && notificationClasses.Contains(Message.NotificationClass.POBD))
|
|
|
|
|
{ if (ScanPOBD(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.PRE72H) && notificationClasses.Contains(Message.NotificationClass.PRE72H))
|
|
|
|
|
{ if (ScanPRE72H(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.SEC) && notificationClasses.Contains(Message.NotificationClass.SEC))
|
|
|
|
|
{ if (ScanSEC(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.SERV) && notificationClasses.Contains(Message.NotificationClass.SERV))
|
|
|
|
|
{ if (ScanSERV(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.STAT) && notificationClasses.Contains(Message.NotificationClass.STAT))
|
|
|
|
|
{ if (ScanSTAT(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.STO) && notificationClasses.Contains(Message.NotificationClass.STO))
|
|
|
|
|
{ if (ScanSTO(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.TIEFA) && notificationClasses.Contains(Message.NotificationClass.TIEFA))
|
|
|
|
|
{ if (ScanTIEFA(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.TIEFD) && notificationClasses.Contains(Message.NotificationClass.TIEFD))
|
|
|
|
|
{ if (ScanTIEFD(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.TOWA) && notificationClasses.Contains(Message.NotificationClass.TOWA))
|
|
|
|
|
{ if (ScanTOWA(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.TOWD) && notificationClasses.Contains(Message.NotificationClass.TOWD))
|
|
|
|
|
{ if (ScanTOWD(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
if ((message.MessageNotificationClass == Message.NotificationClass.WAS) && notificationClasses.Contains(Message.NotificationClass.WAS))
|
|
|
|
|
{ if (ScanWAS(message, messageCore, reader)) SaveMessage(message); break; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -129,9 +161,8 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region TIEFA
|
|
|
|
|
|
|
|
|
|
private static void ScanTIEFA(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanTIEFA(Message tiefaMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message tiefaMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.TIEFA);
|
|
|
|
|
if (tiefaMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
TIEFA newTIEFA = new TIEFA();
|
|
|
|
|
@ -139,21 +170,18 @@ namespace ENI2.Import
|
|
|
|
|
tiefaMessage.Elements.Add(newTIEFA);
|
|
|
|
|
}
|
|
|
|
|
TIEFA tiefa = tiefaMessage.Elements[0] as TIEFA;
|
|
|
|
|
Util.ScanMessage(tiefa, reader);
|
|
|
|
|
ScanMessage(tiefa, reader);
|
|
|
|
|
if (!tiefa.DraughtUponArrival_DMT.HasValue && tiefaMessage.IsNew)
|
|
|
|
|
messages.Remove(tiefaMessage);
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmNumber("TIEFA.DraughtUponArrival_DMT_DK", tiefa.DraughtUponArrival_DMT, tiefa.DraughtUponArrival_DMT.HasValue ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region TIEFD
|
|
|
|
|
|
|
|
|
|
private static void ScanTIEFD(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanTIEFD(Message tiefdMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message tiefdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.TIEFD);
|
|
|
|
|
if(tiefdMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
TIEFD newTIEFD = new TIEFD();
|
|
|
|
|
@ -161,21 +189,18 @@ namespace ENI2.Import
|
|
|
|
|
tiefdMessage.Elements.Add(newTIEFD);
|
|
|
|
|
}
|
|
|
|
|
TIEFD tiefd = tiefdMessage.Elements[0] as TIEFD;
|
|
|
|
|
Util.ScanMessage(tiefd, reader);
|
|
|
|
|
ScanMessage(tiefd, reader);
|
|
|
|
|
if (!tiefd.DraughtUponDeparture_DMT.HasValue && tiefdMessage.IsNew)
|
|
|
|
|
messages.Remove(tiefdMessage);
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmNumber("TIEFD.DraughtUponDeparture_DMT_DK", tiefd.DraughtUponDeparture_DMT, tiefd.DraughtUponDeparture_DMT.HasValue ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region NAME
|
|
|
|
|
|
|
|
|
|
private static void ScanNAME(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanNAME(Message nameMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message nameMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.NAME);
|
|
|
|
|
if (nameMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
NAME newNAME = new NAME();
|
|
|
|
|
@ -183,9 +208,10 @@ namespace ENI2.Import
|
|
|
|
|
nameMessage.Elements.Add(newNAME);
|
|
|
|
|
}
|
|
|
|
|
NAME name = nameMessage.Elements[0] as NAME;
|
|
|
|
|
Util.ScanMessage(name, reader);
|
|
|
|
|
ExcelUtil.ScanMessage(name, reader);
|
|
|
|
|
if (name.NameOfMaster.IsNullOrEmpty() && name.IsNew)
|
|
|
|
|
messages.Remove(nameMessage);
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@ -254,9 +280,8 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region POBA
|
|
|
|
|
|
|
|
|
|
private static void ScanPOBA(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanPOBA(Message pobaMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message pobaMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.POBA);
|
|
|
|
|
if(pobaMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
POBA newPoba = new POBA();
|
|
|
|
|
@ -265,25 +290,19 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
POBA poba = pobaMessage.Elements[0] as POBA;
|
|
|
|
|
Util.ScanMessage(poba, reader);
|
|
|
|
|
ScanMessage(poba, reader);
|
|
|
|
|
if (((poba.TotalPersonsOnBoardUponArrival ?? 0) == 0) && poba.IsNew)
|
|
|
|
|
messages.Remove(pobaMessage);
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmNumber("POBA.TotalCrewMembersOnBoardUponArrival_DK", poba.TotalCrewMembersOnBoardUponArrival,
|
|
|
|
|
(poba.TotalCrewMembersOnBoardUponArrival.HasValue && poba.TotalCrewMembersOnBoardUponArrival > 0) ?
|
|
|
|
|
ExcelReader.ReadState.OK : ExcelReader.ReadState.WARN);
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmNumber("POBA.TotalPassengersOnBoardUponArrival_DK", poba.TotalPassengersOnBoardUponArrival,
|
|
|
|
|
ExcelReader.ReadState.OK);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region POBD
|
|
|
|
|
|
|
|
|
|
private static void ScanPOBD(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanPOBD(Message pobdMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message pobdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.POBD);
|
|
|
|
|
if(pobdMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
POBD newPobd = new POBD();
|
|
|
|
|
@ -292,17 +311,11 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
POBD pobd = pobdMessage.Elements[0] as POBD;
|
|
|
|
|
Util.ScanMessage(pobd, reader);
|
|
|
|
|
ScanMessage(pobd, reader);
|
|
|
|
|
if (((pobd.TotalPersonsOnBoardUponDeparture ?? 0) == 0) && pobd.IsNew)
|
|
|
|
|
messages.Remove(pobdMessage);
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmNumber("POBD.TotalCrewMembersOnBoardUponDeparture_DK", pobd.TotalCrewMembersOnBoardUponDeparture,
|
|
|
|
|
(pobd.TotalCrewMembersOnBoardUponDeparture.HasValue && pobd.TotalCrewMembersOnBoardUponDeparture > 0) ?
|
|
|
|
|
ExcelReader.ReadState.OK : ExcelReader.ReadState.WARN);
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmNumber("POBD.TotalPassengersOnBoardUponDeparture_DK", pobd.TotalPassengersOnBoardUponDeparture,
|
|
|
|
|
ExcelReader.ReadState.OK);
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@ -859,9 +872,8 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region STAT
|
|
|
|
|
|
|
|
|
|
private static void ScanSTAT(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanSTAT(Message statMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message statMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.STAT);
|
|
|
|
|
if(statMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
STAT newSTAT = new STAT();
|
|
|
|
|
@ -869,21 +881,14 @@ namespace ENI2.Import
|
|
|
|
|
statMessage.Elements.Add(newSTAT);
|
|
|
|
|
}
|
|
|
|
|
STAT stat = statMessage.Elements[0] as STAT;
|
|
|
|
|
Util.ScanMessage(stat, reader);
|
|
|
|
|
ScanMessage(stat, reader);
|
|
|
|
|
|
|
|
|
|
stat.PortOfRegistry = reader.ReadLoCode("STAT.PortOfRegistry");
|
|
|
|
|
stat.Flag = reader.ReadNationality("STAT.Flag");
|
|
|
|
|
|
|
|
|
|
stat.MMSINumber = reader.ReadTextNoWhitespace("STAT.MMSINumber");
|
|
|
|
|
reader.Conf.ConfirmText("STAT.MMSINumber", stat.MMSINumber, (stat.MMSINumber.IsNullOrEmpty() || (stat.MMSINumber.Length != 9)) ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
stat.CallSign = reader.ReadTextNoWhitespace("STAT.CallSign");
|
|
|
|
|
reader.Conf.ConfirmText("STAT.CallSign", stat.CallSign, stat.CallSign.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
stat.ISMCompanyId = reader.ReadTextNoWhitespace("STAT.ISMCompanyId");
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText("STAT.ISMCompanyId", stat.ISMCompanyId, (stat.ISMCompanyId.IsNullOrEmpty() || (stat.ISMCompanyId.Length != 7)) ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
if (!stat.ISMCompanyId.IsNullOrEmpty() && stat.ISMCompanyId.Length < 7)
|
|
|
|
|
{
|
|
|
|
|
while (stat.ISMCompanyId.Length < 7)
|
|
|
|
|
@ -899,26 +904,19 @@ namespace ENI2.Import
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
if (!stat.ShipType.IsNullOrEmpty() && stat.ShipType.Length > 3)
|
|
|
|
|
reader.Conf.ConfirmText("STAT.ShipType", stat.ShipType, ExcelReader.ReadState.WARN);
|
|
|
|
|
|
|
|
|
|
// Vessel Email as HerbergEmail sichern
|
|
|
|
|
messageCore.HerbergEmailContactReportingVessel = reader.ReadText("ShipMail");
|
|
|
|
|
reader.Conf.ConfirmText("ShipMail", messageCore.HerbergEmailContactReportingVessel, messageCore.HerbergEmailContactReportingVessel.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
// wird nicht wieder entfernt (core ist auch da!)
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region NOA_NOD
|
|
|
|
|
|
|
|
|
|
private static void ScanNOA_NOD(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanNOA_NOD(Message noa_nodMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message noa_nodMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.NOA_NOD);
|
|
|
|
|
if (noa_nodMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
NOA_NOD newNoa_nod = new NOA_NOD();
|
|
|
|
|
@ -934,19 +932,11 @@ namespace ENI2.Import
|
|
|
|
|
{
|
|
|
|
|
if (eta.HasValue)
|
|
|
|
|
noa_nod.ETAToKielCanal = eta;
|
|
|
|
|
//else
|
|
|
|
|
// noa_nod.ETAToKielCanal = messageCore.ETAKielCanal;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (eta.HasValue)
|
|
|
|
|
noa_nod.ETAToPortOfCall = eta;
|
|
|
|
|
//else
|
|
|
|
|
// noa_nod.ETAToPortOfCall = messageCore.ETA;
|
|
|
|
|
|
|
|
|
|
// Zeit muss zurückkonvertiert werden, da toUniversalTime() kodiert
|
|
|
|
|
if(noa_nod.ETAToPortOfCall.HasValue)
|
|
|
|
|
reader.Conf.ConfirmDate("NOA_NOD.ETAToPortOfCall", noa_nod.ETAToPortOfCall.Value.ToLocalTime(), ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
for (int i = 1; i <= noa_nod.NumberOfExcelRows; i++)
|
|
|
|
|
{
|
|
|
|
|
@ -965,15 +955,8 @@ namespace ENI2.Import
|
|
|
|
|
callPurpose.Identifier = i.ToString();
|
|
|
|
|
noa_nod.CallPurposes.Add(callPurpose);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
callPurpose.CallPurposeCode = ((int?)reader.ReadNumber(callPurposeCodeKey)) ?? 0;
|
|
|
|
|
callPurpose.CallPurposeDescription = callPurposeDescription;
|
|
|
|
|
ExcelReader.ReadState aReadState = ExcelReader.ReadState.OK;
|
|
|
|
|
if (callPurposeDescription.IsNullOrEmpty()) aReadState = ExcelReader.ReadState.WARN;
|
|
|
|
|
else if (callPurposeDescription.Length > 90) aReadState = ExcelReader.ReadState.FAIL;
|
|
|
|
|
reader.Conf.ConfirmText(callPurposeDescriptionKey, callPurposeDescription, aReadState);
|
|
|
|
|
if (i == 1)
|
|
|
|
|
reader.Conf.ConfirmText("NOA_NOD.CallPuposeDescription_1_DK", callPurposeDescription, callPurposeDescription.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -996,39 +979,19 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText("NOA_NOD.LastPort", lastPort, noa_nod.LastPort.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
string nextPort = reader.ReadText("NOA_NOD.NextPort")?.Trim().ToUpper();
|
|
|
|
|
bool isValidSSNPort = false;
|
|
|
|
|
if (!nextPort.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
if (nextPort.Length > 5)
|
|
|
|
|
nextPort = nextPort.Substring(0, 5); //trunc
|
|
|
|
|
else
|
|
|
|
|
isValidSSNPort = !LocodeDB.SSNPortNameFromLocode(nextPort).IsNullOrEmpty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(string.IsNullOrEmpty(nextPort))
|
|
|
|
|
reader.Conf.ConfirmText("NOA_NOD.NextPort", nextPort, ExcelReader.ReadState.WARN);
|
|
|
|
|
else
|
|
|
|
|
reader.Conf.ConfirmText("NOA_NOD.NextPort", nextPort, isValidSSNPort ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL);
|
|
|
|
|
if (!nextPort.IsNullOrEmpty() && (nextPort.Length > 5))
|
|
|
|
|
nextPort = nextPort.Substring(0, 5); //trunc
|
|
|
|
|
|
|
|
|
|
noa_nod.NextPort = nextPort;
|
|
|
|
|
|
|
|
|
|
if(messageCore.IsTransit)
|
|
|
|
|
{
|
|
|
|
|
noa_nod.ETDFromKielCanal = reader.ReadDateTime("NOA_NOD.ETDDateFromPortOfCall", "NOA_NOD.ETDTimeFromPortOfCall");
|
|
|
|
|
if(noa_nod.ETDFromKielCanal.HasValue)
|
|
|
|
|
reader.Conf.ConfirmDate("NOA_NOD.ETDFromPortOfCall", noa_nod.ETDFromKielCanal.Value.ToLocalTime(), ExcelReader.ReadState.OK);
|
|
|
|
|
else
|
|
|
|
|
reader.Conf.ConfirmDate("NOA_NOD.ETDFromPortOfCall", null, ExcelReader.ReadState.FAIL);
|
|
|
|
|
} else
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
noa_nod.ETDFromPortOfCall = reader.ReadDateTime("NOA_NOD.ETDDateFromPortOfCall", "NOA_NOD.ETDTimeFromPortOfCall");
|
|
|
|
|
if(noa_nod.ETDFromPortOfCall.HasValue)
|
|
|
|
|
reader.Conf.ConfirmDate("NOA_NOD.ETDFromPortOfCall", noa_nod.ETDFromPortOfCall.Value.ToLocalTime(), ExcelReader.ReadState.OK);
|
|
|
|
|
else
|
|
|
|
|
reader.Conf.ConfirmDate("NOA_NOD.ETDFromPortOfCall", null, ExcelReader.ReadState.FAIL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
noa_nod.ETDFromLastPort = reader.ReadDateTime("NOA_NOD.ETDDateFromLastPort", "NOA_NOD.ETDTimeFromLastPort");
|
|
|
|
|
@ -1036,6 +999,7 @@ namespace ENI2.Import
|
|
|
|
|
// DK
|
|
|
|
|
noa_nod.IsAnchored = reader.ReadBoolean("NOA_NOD.IsAnchored", reader.Mode == ExcelReader.CountryMode.DE);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@ -1063,9 +1027,8 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region WAS
|
|
|
|
|
|
|
|
|
|
private static void ScanWAS(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanWAS(Message wasMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message wasMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.WAS);
|
|
|
|
|
if (wasMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
WAS newWAS = new WAS();
|
|
|
|
|
@ -1075,7 +1038,7 @@ namespace ENI2.Import
|
|
|
|
|
WAS was = wasMessage.Elements[0] as WAS;
|
|
|
|
|
was.DeleteElements();
|
|
|
|
|
|
|
|
|
|
Util.ScanMessage(was, reader);
|
|
|
|
|
ScanMessage(was, reader);
|
|
|
|
|
|
|
|
|
|
was.WasteDisposalDelivery = reader.ReadDelivery("WAS.WasteDisposalDelivery");
|
|
|
|
|
was.LastWasteDisposalPort = reader.ReadLoCode("WAS.LastWasteDisposalPort");
|
|
|
|
|
@ -1090,22 +1053,14 @@ namespace ENI2.Import
|
|
|
|
|
wdsp.WAS = was;
|
|
|
|
|
was.WasteDisposalServiceProvider.Add(wdsp);
|
|
|
|
|
}
|
|
|
|
|
((WasteDisposalServiceProvider) was.WasteDisposalServiceProvider[0]).WasteDisposalServiceProviderName = wastedispServProvName;
|
|
|
|
|
((WasteDisposalServiceProvider) was.WasteDisposalServiceProvider[0]).WasteDisposalDelivery = was.WasteDisposalDelivery;
|
|
|
|
|
was.WasteDisposalServiceProvider[0].WasteDisposalServiceProviderName = wastedispServProvName;
|
|
|
|
|
was.WasteDisposalServiceProvider[0].WasteDisposalDelivery = was.WasteDisposalDelivery;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ExcelReader.ReadState readState = ExcelReader.ReadState.WARN;
|
|
|
|
|
if (!wastedispServProvName.IsNullOrEmpty()) {
|
|
|
|
|
if (wastedispServProvName.Length > 90) readState = ExcelReader.ReadState.FAIL;
|
|
|
|
|
else readState = ExcelReader.ReadState.OK;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText("WAS.WasteDisposalServiceProviderName", wastedispServProvName, readState);
|
|
|
|
|
|
|
|
|
|
// Waste 1 - 15
|
|
|
|
|
for (int i = 1; i <= was.NumberOfExcelRows; i++)
|
|
|
|
|
{
|
|
|
|
|
string wastetype = string.Format("WAS.WasteType_{0}", i);
|
|
|
|
|
//string wastetype = string.Format("WAS.WasteType_{0}", i);
|
|
|
|
|
string wasteCode = string.Format("WAS.WasteCode_{0}", i);
|
|
|
|
|
string wasteDescription = string.Format("WAS.WasteDescription_{0}", i);
|
|
|
|
|
string wasteAmount = string.Format("WAS.WasteDisposalAmount_MTQ_{0}", i);
|
|
|
|
|
@ -1128,17 +1083,6 @@ namespace ENI2.Import
|
|
|
|
|
if (waste.WasteType.HasValue && (waste.WasteType == 2313))
|
|
|
|
|
waste.WasteType = 2600;
|
|
|
|
|
|
|
|
|
|
if (reader.Mode == ExcelReader.CountryMode.DE)
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(wastetype, waste.WasteTypeDisplay, ExcelReader.ReadState.OK);
|
|
|
|
|
reader.Conf.ConfirmNumber(wasteCode, waste.WasteType, ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else if (reader.Mode == ExcelReader.CountryMode.DK)
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(wastetype, WAS.DKWasteTypes[i - 1], ExcelReader.ReadState.OK);
|
|
|
|
|
reader.Conf.ConfirmNumber(wasteCode, WAS.DKWasteCodes[i - 1], ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Waste description Spezialfälle für DK
|
|
|
|
|
waste.WasteDescription = reader.ReadText(wasteDescription);
|
|
|
|
|
if (waste.WasteDescription.IsNullOrEmpty())
|
|
|
|
|
@ -1172,70 +1116,26 @@ namespace ENI2.Import
|
|
|
|
|
waste.WasteType = 2300;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText(wasteDescription, waste.WasteDescription, waste.WasteDescription.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
waste.WasteDisposalAmount_MTQ = reader.ReadNumberDefaultZero(wasteAmount);
|
|
|
|
|
waste.WasteCapacity_MTQ = reader.ReadNumberDefaultZero(wasteCapacity);
|
|
|
|
|
waste.WasteAmountRetained_MTQ = reader.ReadNumberDefaultZero(wasteRetained);
|
|
|
|
|
|
|
|
|
|
waste.WasteDisposalPort = reader.ReadLoCode(wastePort);
|
|
|
|
|
bool isLocode;
|
|
|
|
|
ExcelReader.ReadState rs;
|
|
|
|
|
|
|
|
|
|
if (waste.WasteDisposalPort.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
waste.WasteDisposalPort = "ZZUKN";
|
|
|
|
|
rs = ExcelReader.ReadState.WARN;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
isLocode = (LocodeDB.PortNameFromLocode(waste.WasteDisposalPort) != null);
|
|
|
|
|
rs = isLocode ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL;
|
|
|
|
|
}
|
|
|
|
|
reader.Conf.ConfirmText(wastePort, waste.WasteDisposalPort, rs);
|
|
|
|
|
|
|
|
|
|
waste.WasteAmountGeneratedTillNextPort_MTQ = reader.ReadNumberDefaultZero(amountGen);
|
|
|
|
|
waste.WasteDisposedAtLastPort_MTQ = reader.ReadNumberDefaultZero(wasteDis);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if ((reader.Mode == ExcelReader.CountryMode.DE) &&
|
|
|
|
|
((i == 6) || (i == 8) || (i == 9)))
|
|
|
|
|
{
|
|
|
|
|
waste.WasteDescription = "-";
|
|
|
|
|
waste.WasteDisposalAmount_MTQ = 0;
|
|
|
|
|
waste.WasteCapacity_MTQ = 0;
|
|
|
|
|
waste.WasteAmountRetained_MTQ = 0;
|
|
|
|
|
waste.WasteDisposalPort = "ZZUKN";
|
|
|
|
|
waste.WasteAmountGeneratedTillNextPort_MTQ = 0;
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if(i==15) // falls letzte Zeile leer, entfernen: Christin 22.3.17
|
|
|
|
|
{
|
|
|
|
|
if ((waste.WasteDescription.IsNullOrEmpty() || waste.WasteDescription == "-") &&
|
|
|
|
|
((waste.WasteDisposalAmount_MTQ ?? 0) == 0) &&
|
|
|
|
|
(((waste.WasteType ?? 0) == 1300) || !waste.WasteType.HasValue))
|
|
|
|
|
was.Waste.Remove(waste);
|
|
|
|
|
|
|
|
|
|
// 24.3.: - Für Waste-Type 15: Wenn in dieser Zeile andere Werte enthalten, als die nachfolgenden, ist die ganze Zeile rot zu markieren.
|
|
|
|
|
bool highlightRow15 = waste.WasteType != null;
|
|
|
|
|
highlightRow15 &= (waste.WasteDisposalAmount_MTQ > 0);
|
|
|
|
|
highlightRow15 &= (waste.WasteCapacity_MTQ > 0);
|
|
|
|
|
highlightRow15 &= (waste.WasteAmountRetained_MTQ > 0);
|
|
|
|
|
highlightRow15 &= (waste.WasteDisposalPort != "ZZUKN");
|
|
|
|
|
highlightRow15 &= (waste.WasteAmountGeneratedTillNextPort_MTQ > 0);
|
|
|
|
|
highlightRow15 &= (waste.WasteDisposedAtLastPort_MTQ > 0);
|
|
|
|
|
|
|
|
|
|
if(highlightRow15)
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.HighlightCellWithState(wastetype, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wasteCode, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wasteDescription, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wasteAmount, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wasteCapacity, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wasteRetained, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wastePort, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(amountGen, ExcelReader.ReadState.FAIL);
|
|
|
|
|
reader.Conf.HighlightCellWithState(wasteDis, ExcelReader.ReadState.FAIL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!waste.WasteType.HasValue)
|
|
|
|
|
@ -1245,7 +1145,7 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
was.AddMissingWaste();
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
@ -1344,7 +1244,7 @@ namespace ENI2.Import
|
|
|
|
|
string[] crew = crewNameString.Split(';');
|
|
|
|
|
if (crew.Length == 1)
|
|
|
|
|
crew = crewNameString.Split(',');
|
|
|
|
|
ExcelReader.ReadState readState = ExcelReader.ReadState.OK;
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < crew.Length; j++)
|
|
|
|
|
{
|
|
|
|
|
if (!(poc30d.GetSublistElementWithIdentifier((j + 1).ToString()) is PortOfCallLast30DaysCrewJoinedShip poc30dCrew))
|
|
|
|
|
@ -1356,8 +1256,6 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
poc30dCrew.PortOfCallLast30DaysCrewJoinedShipName = crew[j];
|
|
|
|
|
if (crew[j].Length > 90)
|
|
|
|
|
readState = ExcelReader.ReadState.FAIL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1467,17 +1365,17 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region SEC
|
|
|
|
|
|
|
|
|
|
private static void ScanSEC(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanSEC(Message secMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message secMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.SEC);
|
|
|
|
|
if (secMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
SEC newSEC = new SEC();
|
|
|
|
|
newSEC.MessageHeader = secMessage;
|
|
|
|
|
secMessage.Elements.Add(newSEC);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SEC sec = secMessage.Elements[0] as SEC;
|
|
|
|
|
Util.ScanMessage(sec, reader);
|
|
|
|
|
ScanMessage(sec, reader);
|
|
|
|
|
|
|
|
|
|
reader.ReadBoolean("SEC.AreMatterToReport"); // das berücksichtigen wir derzeit nicht in der DB (implizit)
|
|
|
|
|
|
|
|
|
|
@ -1491,20 +1389,13 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string shipsecLevel = reader.ReadText("SEC.CurrentShipSecurityLevel");
|
|
|
|
|
if (shipsecLevel.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText("SEC.CurrentShipSecurityLevel", null, ExcelReader.ReadState.FAIL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (!shipsecLevel.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
if (shipsecLevel.Contains('1')) sec.CurrentShipSecurityLevel = 1;
|
|
|
|
|
if (shipsecLevel.Contains('2')) sec.CurrentShipSecurityLevel = 2;
|
|
|
|
|
if (shipsecLevel.Contains('3')) sec.CurrentShipSecurityLevel = 3;
|
|
|
|
|
reader.Conf.ConfirmText("SEC.CurrentShipSecurityLevel", shipsecLevel, sec.CurrentShipSecurityLevel.HasValue ? ExcelReader.ReadState.OK : ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText("SEC.ISSCType", isscType, sec.ISSCType.HasValue ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL);
|
|
|
|
|
|
|
|
|
|
string isscIssuerType = reader.ReadText("SEC.ISSCIssuerType");
|
|
|
|
|
if(isscIssuerType != null)
|
|
|
|
|
{
|
|
|
|
|
@ -1514,7 +1405,6 @@ namespace ENI2.Import
|
|
|
|
|
sec.ISSCIssuerType = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText("SEC.ISSCIssuerType", isscIssuerType, sec.ISSCIssuerType.HasValue ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL);
|
|
|
|
|
sec.GeneralDescriptionOfCargo = reader.ReadGeneralDescriptionOfCargo("SEC.GeneralDescriptionOfCargo");
|
|
|
|
|
|
|
|
|
|
bool? secKielArrival = reader.ReadBoolean("SEC.KielCanalPassagePlanned_Arrival");
|
|
|
|
|
@ -1535,9 +1425,6 @@ namespace ENI2.Import
|
|
|
|
|
if (!sec.KielCanalPassagePlannedIncomming.HasValue && !sec.KielCanalPassagePlannedOutgoing.HasValue)
|
|
|
|
|
sec.KielCanalPassagePlanned = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Last10PortFacilitesCalled
|
|
|
|
|
for (int i = 1; i <= 10; i++)
|
|
|
|
|
{
|
|
|
|
|
@ -1559,24 +1446,17 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
l10fc.PortFacilityPortName = reader.ReadText(portName);
|
|
|
|
|
reader.Conf.ConfirmText(portName, l10fc.PortFacilityPortName, ExcelReader.ReadState.OK);
|
|
|
|
|
l10fc.PortFacilityPortCountry = reader.ReadText(portCountry);
|
|
|
|
|
reader.Conf.ConfirmText(portCountry, l10fc.PortFacilityPortCountry, ExcelReader.ReadState.OK);
|
|
|
|
|
l10fc.PortFacilityPortLoCode = reader.ReadLoCode(portLocode);
|
|
|
|
|
l10fc.PortFacilityDateOfArrival = reader.ReadDate(portDateOfArrival);
|
|
|
|
|
l10fc.PortFacilityDateOfDeparture = reader.ReadDate(portDateOfDeparture);
|
|
|
|
|
|
|
|
|
|
string sLevel = reader.ReadText(portShipSecLevel);
|
|
|
|
|
if(sLevel.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(portShipSecLevel, null, ExcelReader.ReadState.FAIL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if(!sLevel.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
if (sLevel.Contains('1')) l10fc.PortFacilityShipSecurityLevel = 1;
|
|
|
|
|
if (sLevel.Contains('2')) l10fc.PortFacilityShipSecurityLevel = 2;
|
|
|
|
|
if (sLevel.Contains('3')) l10fc.PortFacilityShipSecurityLevel = 3;
|
|
|
|
|
reader.Conf.ConfirmText(portShipSecLevel, sLevel, l10fc.PortFacilityShipSecurityLevel.HasValue ? ExcelReader.ReadState.OK : ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
l10fc.PortFacilityGISISCode = reader.ReadTextNoWhitespace(portGISISCode);
|
|
|
|
|
@ -1587,17 +1467,8 @@ namespace ENI2.Import
|
|
|
|
|
{
|
|
|
|
|
while (l10fc.PortFacilityGISISCode.Length < 4) l10fc.PortFacilityGISISCode = "0" + l10fc.PortFacilityGISISCode;
|
|
|
|
|
}
|
|
|
|
|
if (l10fc.PortFacilityGISISCode.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(portGISISCode, l10fc.PortFacilityGISISCode, ExcelReader.ReadState.FAIL);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(portGISISCode, l10fc.PortFacilityGISISCode, l10fc.PortFacilityGISISCode.IsDigitsOnly() ? ExcelReader.ReadState.OK : ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
l10fc.PortFacilitySecurityMattersToReport = reader.ReadText(portSecMatters);
|
|
|
|
|
reader.Conf.ConfirmText(portSecMatters, l10fc.PortFacilitySecurityMattersToReport, l10fc.PortFacilitySecurityMattersToReport.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL :ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
// keinen "leeren" Hafen anlegen, wenn der Eintrag leer war (trifft anscheinend bei Neubauten zu, siehe E-Mail Christin vom 20./22.6.17
|
|
|
|
|
if (l10fc.PortFacilityPortName.IsNullOrEmpty() && l10fc.PortFacilityPortLoCode.IsNullOrEmpty() && l10fc.PortFacilityPortCountry.IsNullOrEmpty())
|
|
|
|
|
@ -1632,7 +1503,6 @@ namespace ENI2.Import
|
|
|
|
|
sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Remove(s2sActivity);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
reader.Conf.ConfirmText(s2sName, s2sActivity.ShipToShipActivityLocationName, ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
s2sActivity.ShipToShipActivityLocationLoCode = reader.ReadLoCode(s2sLocode);
|
|
|
|
|
s2sActivity.ShipToShipActivityLocationCoordinatesLatitude = (int?)reader.ReadNumber(s2sLatitude);
|
|
|
|
|
@ -1647,9 +1517,9 @@ namespace ENI2.Import
|
|
|
|
|
s2sActivity.ShipToShipActivityTypeCode = (int?) reader.ReadNumber(s2sActivityString);
|
|
|
|
|
reader.ReadShip2ShipActivityType(s2sActivityString); // 24.8.21 nicht Code dem Klartext zuordnen, nur das Feld kolorieren
|
|
|
|
|
s2sActivity.ShipToShipActivitySecurityMattersToReport = reader.ReadText(s2sSec);
|
|
|
|
|
reader.Conf.ConfirmText(s2sSec, s2sActivity.ShipToShipActivitySecurityMattersToReport, s2sActivity.ShipToShipActivitySecurityMattersToReport.IsNullOrEmpty() ? ExcelReader.ReadState.NONE : ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@ -1715,10 +1585,8 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region TOWA
|
|
|
|
|
|
|
|
|
|
private static void ScanTOWA(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanTOWA(Message towaMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message towaMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.TOWA);
|
|
|
|
|
|
|
|
|
|
// 24.4.21: TOWA beim Excel import
|
|
|
|
|
bool hasTOWAMarker = false;
|
|
|
|
|
for (int i = 1; i <= towaMessage.NumberOfExcelRows; i++)
|
|
|
|
|
@ -1731,7 +1599,7 @@ namespace ENI2.Import
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!hasTOWAMarker) return; // no TOWA info on sheet
|
|
|
|
|
if (!hasTOWAMarker) return false; // no TOWA info on sheet
|
|
|
|
|
|
|
|
|
|
towaMessage.DeleteElements();
|
|
|
|
|
for (int i = 1; i <= towaMessage.NumberOfExcelRows; i++)
|
|
|
|
|
@ -1757,27 +1625,24 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
towa.TowageOnArrivalName = towageName;
|
|
|
|
|
reader.Conf.ConfirmText(tName, towageName, ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
towa.TowageOnArrivalFlag = reader.ReadText(tFlag);
|
|
|
|
|
reader.Conf.ConfirmText(tFlag, towa.TowageOnArrivalFlag, towa.TowageOnArrivalFlag.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
towa.TowageOnArrivalPurposeOfCall = reader.ReadText(tPoC);
|
|
|
|
|
reader.Conf.ConfirmText(tPoC, towa.TowageOnArrivalPurposeOfCall, towa.TowageOnArrivalPurposeOfCall.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
towa.TowageOnArrivalDraught_DMT = reader.ReadNumber(tDraft);
|
|
|
|
|
towa.TowageOnArrivalGrossTonnage = (int?) reader.ReadNumber(tGT);
|
|
|
|
|
towa.TowageOnArrivalLengthOverall_MTR = reader.ReadNumber(tLen);
|
|
|
|
|
towa.TowageOnArrivalBeam_MTR = reader.ReadNumber(tBeam);
|
|
|
|
|
towa.TowageOnArrivalOperatorCompanyName = reader.ReadText(tOp);
|
|
|
|
|
reader.Conf.ConfirmText(tOp, towa.TowageOnArrivalOperatorCompanyName, towa.TowageOnArrivalOperatorCompanyName.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region TOWD
|
|
|
|
|
|
|
|
|
|
private static void ScanTOWD(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanTOWD(Message towdMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message towdMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.TOWD);
|
|
|
|
|
|
|
|
|
|
// 24.4.21: TOWD beim Excel import
|
|
|
|
|
bool hasTOWDMarker = false;
|
|
|
|
|
@ -1791,7 +1656,7 @@ namespace ENI2.Import
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!hasTOWDMarker) return; // no TOWD info on sheet
|
|
|
|
|
if (!hasTOWDMarker) return false; // no TOWD info on sheet
|
|
|
|
|
|
|
|
|
|
towdMessage.DeleteElements();
|
|
|
|
|
|
|
|
|
|
@ -1816,25 +1681,21 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
towd.TowageOnDepartureName = towageName;
|
|
|
|
|
reader.Conf.ConfirmText(tName, towageName, ExcelReader.ReadState.OK);
|
|
|
|
|
towd.TowageOnDepartureFlag = reader.ReadText(tFlag);
|
|
|
|
|
reader.Conf.ConfirmText(tFlag, towd.TowageOnDepartureFlag, towd.TowageOnDepartureFlag.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
towd.TowageOnDepartureDraught_DMT = reader.ReadNumber(tDraft);
|
|
|
|
|
towd.TowageOnDepartureLengthOverall_MTR = reader.ReadNumber(tLen);
|
|
|
|
|
towd.TowageOnDepartureBeam_MTR = reader.ReadNumber(tBeam);
|
|
|
|
|
towd.TowageOnDepartureOperatorCompanyName = reader.ReadText(tOp);
|
|
|
|
|
reader.Conf.ConfirmText(tOp, towd.TowageOnDepartureOperatorCompanyName, towd.TowageOnDepartureOperatorCompanyName.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region PRE72H
|
|
|
|
|
|
|
|
|
|
private static void ScanPRE72H(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanPRE72H(Message pre72hMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message pre72hMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.PRE72H);
|
|
|
|
|
if (pre72hMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
PRE72H newPRE72H = new PRE72H();
|
|
|
|
|
@ -1842,21 +1703,20 @@ namespace ENI2.Import
|
|
|
|
|
pre72hMessage.Elements.Add(newPRE72H);
|
|
|
|
|
}
|
|
|
|
|
PRE72H pre72h = pre72hMessage.Elements[0] as PRE72H;
|
|
|
|
|
Util.ScanMessage(pre72h, reader);
|
|
|
|
|
ScanMessage(pre72h, reader);
|
|
|
|
|
// diese Nachricht bleibt auch wenn sie leer ist
|
|
|
|
|
pre72h.ConditionCargoBallastTanks = reader.ReadConditionTanks("PRE72H.ConditionCargoBallastTanks");
|
|
|
|
|
pre72h.TankerHullConfiguration = reader.ReadHullConfiguration("PRE72H.TankerHullConfiguration");
|
|
|
|
|
pre72h.PlannedWorks = reader.ReadText("PRE72H.PlannedWorks");
|
|
|
|
|
reader.Conf.ConfirmText("PRE72H.PlannedWorks", pre72h.PlannedWorks, pre72h.PlannedWorks.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region SERV
|
|
|
|
|
|
|
|
|
|
private static void ScanSERV(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanSERV(Message servMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message servMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.SERV);
|
|
|
|
|
if(servMessage.Elements.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
SERV newSERV = new SERV();
|
|
|
|
|
@ -1865,22 +1725,19 @@ namespace ENI2.Import
|
|
|
|
|
servMessage.Elements.Add(newSERV);
|
|
|
|
|
}
|
|
|
|
|
SERV serv = servMessage.Elements[0] as SERV;
|
|
|
|
|
Util.ScanMessage(serv, reader);
|
|
|
|
|
ScanMessage(serv, reader);
|
|
|
|
|
if (serv.ServiceBeneficiary.IsNullOrEmpty() && serv.ServiceInvoiceRecipient.IsNullOrEmpty())
|
|
|
|
|
servMessage.Elements.Remove(serv);
|
|
|
|
|
if (serv.ServiceBeneficiary.IsNullOrEmpty()) reader.Conf.ConfirmText("SERV.ServiceBeneficiary", null, ExcelReader.ReadState.FAIL);
|
|
|
|
|
if (serv.ServiceInvoiceRecipient.IsNullOrEmpty()) reader.Conf.ConfirmText("SERV.ServiceInvoiceRecipient", null, ExcelReader.ReadState.FAIL);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region STO
|
|
|
|
|
|
|
|
|
|
private static void ScanSTO(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanSTO(Message stoMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message stoMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.STO);
|
|
|
|
|
stoMessage.DeleteElements();
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<stoMessage.NumberOfExcelRows;i++) // 10
|
|
|
|
|
@ -1900,19 +1757,17 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sto.Name = reader.ReadTextNoWhitespace(stoName);
|
|
|
|
|
reader.Conf.ConfirmText(stoName, sto.Name, ExcelReader.ReadState.OK);
|
|
|
|
|
sto.Quantity = (int?)reader.ReadNumber(stoQuantity);
|
|
|
|
|
sto.QuantityUnit = reader.ReadTextNoWhitespace(stoQuantityUnit);
|
|
|
|
|
reader.Conf.ConfirmText(stoQuantityUnit, sto.QuantityUnit, ExcelReader.ReadState.OK);
|
|
|
|
|
sto.LocationOnBoard = reader.ReadTextNoWhitespace(stoLocationOnBoard);
|
|
|
|
|
reader.Conf.ConfirmText(stoLocationOnBoard, sto.LocationOnBoard, ExcelReader.ReadState.OK);
|
|
|
|
|
sto.OfficialUse = reader.ReadTextNoWhitespace(stoOfficialUse);
|
|
|
|
|
reader.Conf.ConfirmText(stoOfficialUse, sto.OfficialUse, ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
// dont save empty element
|
|
|
|
|
if (sto.IsNew && sto.Name.IsNullOrEmpty())
|
|
|
|
|
stoMessage.Elements.Remove(sto);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@ -2102,9 +1957,8 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
#region PAS
|
|
|
|
|
|
|
|
|
|
private static void ScanPAS(List<Message> messages, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
private static bool ScanPAS(Message pasMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
Message pasMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.PAS);
|
|
|
|
|
pasMessage.DeleteElements();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < pasMessage.NumberOfExcelRows; i++)
|
|
|
|
|
@ -2136,30 +1990,32 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pas.PassengerLastName = lastName;
|
|
|
|
|
reader.Conf.ConfirmText(pasLastName, lastName, lastName.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerFirstName = firstName;
|
|
|
|
|
reader.Conf.ConfirmText(pasFirstName, pas.PassengerFirstName, pas.PassengerFirstName.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerGender = reader.ReadGender(pasGender);
|
|
|
|
|
pas.PassengerNationality = reader.ReadNationality(pasNationality);
|
|
|
|
|
// TODO: Nicht klar ob hier LOCODEs kommen oder nicht
|
|
|
|
|
pas.PassengerPortOfEmbarkation = reader.ReadLoCode(pasEmbarkation);
|
|
|
|
|
reader.Conf.ConfirmText(pasEmbarkation, pas.PassengerPortOfEmbarkation, pas.PassengerPortOfEmbarkation.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerPortOfDisembarkation = reader.ReadLoCode(pasDebarkation);
|
|
|
|
|
reader.Conf.ConfirmText(pasDebarkation, pas.PassengerPortOfDisembarkation, pas.PassengerPortOfDisembarkation.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerInTransit = reader.ReadBoolean(pasTransit);
|
|
|
|
|
pas.PassengerPlaceOfBirth = reader.ReadText(pasPlaceOfBirth);
|
|
|
|
|
reader.Conf.ConfirmText(pasPlaceOfBirth, pas.PassengerPlaceOfBirth, pas.PassengerPlaceOfBirth.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL: ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerDateOfBirth = reader.ReadBirthDate(pasDateOfBirth);
|
|
|
|
|
pas.PassengerIdentityDocumentType = reader.ReadIdentityDocumentType(pasIdentDocType);
|
|
|
|
|
pas.PassengerIdentityDocumentId = reader.ReadText(pasIdentDocId);
|
|
|
|
|
reader.Conf.ConfirmText(pasIdentDocId, pas.PassengerIdentityDocumentId, pas.PassengerIdentityDocumentId.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerVisaNumber = reader.ReadText(pasVisaNo);
|
|
|
|
|
reader.Conf.ConfirmText(pasVisaNo, pas.PassengerVisaNumber, pas.PassengerVisaNumber.IsNullOrEmpty() ? ExcelReader.ReadState.WARN :ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PASSENGER DEPARTURE
|
|
|
|
|
pasMessage = Util.GetMessageWithType(messages, messageCore, Message.NotificationClass.PASD);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region PASD
|
|
|
|
|
|
|
|
|
|
private static bool ScanPASD(Message pasMessage, MessageCore messageCore, ExcelReader reader)
|
|
|
|
|
{
|
|
|
|
|
pasMessage.DeleteElements();
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < pasMessage.NumberOfExcelRows; i++)
|
|
|
|
|
{
|
|
|
|
|
string pasLastName = string.Format("PASD.PassengerLastName_{0}", i + 1);
|
|
|
|
|
@ -2189,28 +2045,21 @@ namespace ENI2.Import
|
|
|
|
|
pas.IsDeparture = true;
|
|
|
|
|
|
|
|
|
|
pas.PassengerLastName = lastName;
|
|
|
|
|
reader.Conf.ConfirmText(pasLastName, lastName, ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerFirstName = reader.ReadText(pasFirstName);
|
|
|
|
|
reader.Conf.ConfirmText(pasFirstName, pas.PassengerFirstName, pas.PassengerFirstName.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerGender = reader.ReadGender(pasGender);
|
|
|
|
|
pas.PassengerNationality = reader.ReadNationality(pasNationality);
|
|
|
|
|
// TODO: Nicht klar ob hier LOCODEs kommen oder nicht
|
|
|
|
|
pas.PassengerPortOfEmbarkation = reader.ReadTextNoWhitespace(pasEmbarkation);
|
|
|
|
|
reader.Conf.ConfirmText(pasEmbarkation, pas.PassengerPortOfEmbarkation, pas.PassengerPortOfEmbarkation.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerPortOfDisembarkation = reader.ReadTextNoWhitespace(pasDebarkation);
|
|
|
|
|
reader.Conf.ConfirmText(pasDebarkation, pas.PassengerPortOfDisembarkation, pas.PassengerPortOfDisembarkation.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerInTransit = reader.ReadBoolean(pasTransit);
|
|
|
|
|
pas.PassengerPlaceOfBirth = reader.ReadText(pasPlaceOfBirth);
|
|
|
|
|
reader.Conf.ConfirmText(pasPlaceOfBirth, pas.PassengerPlaceOfBirth, pas.PassengerPlaceOfBirth.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerDateOfBirth = reader.ReadBirthDate(pasDateOfBirth);
|
|
|
|
|
pas.PassengerIdentityDocumentType = reader.ReadIdentityDocumentType(pasIdentDocType);
|
|
|
|
|
pas.PassengerIdentityDocumentId = reader.ReadText(pasIdentDocId);
|
|
|
|
|
reader.Conf.ConfirmText(pasIdentDocId, pas.PassengerIdentityDocumentId, pas.PassengerIdentityDocumentId.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
pas.PassengerVisaNumber = reader.ReadText(pasVisaNo);
|
|
|
|
|
reader.Conf.ConfirmText(pasVisaNo, pas.PassengerVisaNumber, pas.PassengerVisaNumber.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
@ -2237,13 +2086,7 @@ namespace ENI2.Import
|
|
|
|
|
if (sheetValue != null)
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(dbEntity, sheetValue);
|
|
|
|
|
reader.Conf.ConfirmDate(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmDate(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(double?))
|
|
|
|
|
{
|
|
|
|
|
@ -2251,11 +2094,6 @@ namespace ENI2.Import
|
|
|
|
|
if (sheetValue != null)
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(dbEntity, sheetValue);
|
|
|
|
|
reader.Conf.ConfirmNumber(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmNumber(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(string))
|
|
|
|
|
@ -2263,24 +2101,7 @@ namespace ENI2.Import
|
|
|
|
|
string sheetValue = reader.ReadText(lookupNameAttribute.LookupName);
|
|
|
|
|
if (sheetValue != null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
property.SetValue(dbEntity, sheetValue);
|
|
|
|
|
ExcelReader.ReadState readState = ExcelReader.ReadState.OK;
|
|
|
|
|
// Wenn der Zellentext länger ist als 90 Zeichen und maximal 99/100 Zeichen lang ist soll die Zelle rot gefärbt werden
|
|
|
|
|
if (Attribute.IsDefined(property, typeof(MaxLengthAttribute)))
|
|
|
|
|
{
|
|
|
|
|
MaxLengthAttribute mla = Attribute.GetCustomAttribute(property, typeof(MaxLengthAttribute)) as MaxLengthAttribute;
|
|
|
|
|
if ((sheetValue.Length >= 90) && ((mla.MaxLength == 99) || (mla.MaxLength == 100)))
|
|
|
|
|
{
|
|
|
|
|
readState = ExcelReader.ReadState.FAIL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText(lookupNameAttribute.LookupName, sheetValue, readState);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(int?))
|
|
|
|
|
@ -2289,11 +2110,6 @@ namespace ENI2.Import
|
|
|
|
|
if (sheetValue.HasValue)
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(dbEntity, (int)sheetValue.Value);
|
|
|
|
|
reader.Conf.ConfirmNumber(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmNumber(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(byte?))
|
|
|
|
|
@ -2302,13 +2118,7 @@ namespace ENI2.Import
|
|
|
|
|
if (sheetValue.HasValue)
|
|
|
|
|
{
|
|
|
|
|
property.SetValue(dbEntity, (byte)sheetValue.Value);
|
|
|
|
|
reader.Conf.ConfirmNumber(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmNumber(lookupNameAttribute.LookupName, sheetValue, ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (property.PropertyType == typeof(Boolean?))
|
|
|
|
|
{
|
|
|
|
|
@ -2316,12 +2126,6 @@ namespace ENI2.Import
|
|
|
|
|
string boolStringValue = reader.ReadText(lookupNameAttribute.LookupName);
|
|
|
|
|
if (sheetValue.HasValue) {
|
|
|
|
|
property.SetValue(dbEntity, sheetValue);
|
|
|
|
|
reader.Conf.ConfirmText(lookupNameAttribute.LookupName, sheetValue.Value ? "Y" : "N",
|
|
|
|
|
ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reader.Conf.ConfirmText(lookupNameAttribute.LookupName, boolStringValue, ExcelReader.ReadState.WARN);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -2372,21 +2176,11 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
if (result != null)
|
|
|
|
|
{
|
|
|
|
|
// setup returning confirmation sheets according to PoC
|
|
|
|
|
if (result.PoC.Substring(0, 2) == "DK")
|
|
|
|
|
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDK);
|
|
|
|
|
else
|
|
|
|
|
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDE);
|
|
|
|
|
|
|
|
|
|
// copy poc/imo/eta to return sheet
|
|
|
|
|
poc = reader.ReadText("Visit.PortOfCall");
|
|
|
|
|
reader.Conf.ConfirmText("Visit.PortOfCall", poc, ExcelReader.ReadState.OK);
|
|
|
|
|
reader.Conf.ConfirmText("Visit.PortOfCall_DK", poc, ExcelReader.ReadState.OK);
|
|
|
|
|
imo = reader.ReadText("Visit.IMONumber");
|
|
|
|
|
reader.Conf.ConfirmText("Visit.IMONumber", imo, ExcelReader.ReadState.OK);
|
|
|
|
|
eta = reader.ReadDateTime("NOA_NOD.ETADateToPortOfCall", "NOA_NOD.ETATimeToPortOfCall");
|
|
|
|
|
result.HerbergReportType = reader.ReadText("ReferenceNumber");
|
|
|
|
|
reader.Conf.ConfirmText("ReferenceNumber", result.HerbergReportType, result.HerbergReportType.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ -2399,7 +2193,6 @@ namespace ENI2.Import
|
|
|
|
|
// Prüfen auf Transit
|
|
|
|
|
if (poc.IndexOf("CANAL", StringComparison.OrdinalIgnoreCase) >= 0 || poc.Equals("ZZNOK", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDE);
|
|
|
|
|
poc = "ZZNOK";
|
|
|
|
|
isTransit = true;
|
|
|
|
|
}
|
|
|
|
|
@ -2444,17 +2237,7 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (poc != null)
|
|
|
|
|
{
|
|
|
|
|
poc = poc.ToUpper();
|
|
|
|
|
|
|
|
|
|
// setup returning confirmation sheets according to PoC
|
|
|
|
|
if (poc.Substring(0, 2) == "DK")
|
|
|
|
|
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDK);
|
|
|
|
|
else
|
|
|
|
|
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDE);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (poc == null)
|
|
|
|
|
{
|
|
|
|
|
message = "invalid PoC";
|
|
|
|
|
return null;
|
|
|
|
|
@ -2462,9 +2245,6 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
imo = reader.ReadText("Visit.IMONumber");
|
|
|
|
|
reader.Conf.ConfirmText("Visit.IMONumber", imo, imo.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
if ((imo.Length > 0) && !bsmd.database.Util.IsIMOValid(imo))
|
|
|
|
|
reader.Conf.ConfirmText("Visit.IMONumber", imo, ExcelReader.ReadState.WARN);
|
|
|
|
|
|
|
|
|
|
// ETA
|
|
|
|
|
if (poc != null)
|
|
|
|
|
@ -2477,7 +2257,6 @@ namespace ENI2.Import
|
|
|
|
|
{
|
|
|
|
|
_log.InfoFormat("Core [{3}] found for IMO {0}, ETA {1}, Poc {2}", imo, eta, poc, result.Id);
|
|
|
|
|
result.HerbergReportType = reader.ReadText("ReferenceNumber");
|
|
|
|
|
reader.Conf.ConfirmText("ReferenceNumber", result.HerbergReportType, result.HerbergReportType.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
// Spezialfall: Wenn ein Core gefunden wird, dieser jedoch eine andere Visit/Transit Id hat als die Anmeldung ist das eine Neuanlage!
|
|
|
|
|
// Eingebaut 17.11.17
|
|
|
|
|
@ -2490,9 +2269,6 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reader.Conf.ConfirmText("Visit.PortOfCall", poc, ExcelReader.ReadState.OK);
|
|
|
|
|
reader.Conf.ConfirmText("Visit.PortOfCall_DK", poc, ExcelReader.ReadState.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
@ -2502,9 +2278,6 @@ namespace ENI2.Import
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isValidId = bsmd.database.Util.IsVisitId(visitTransitId) ||bsmd.database.Util.IsTransitId(visitTransitId);
|
|
|
|
|
reader.Conf.ConfirmText("ID", visitTransitId, isValidId ? ExcelReader.ReadState.OK : ExcelReader.ReadState.FAIL);
|
|
|
|
|
|
|
|
|
|
if (result == null)
|
|
|
|
|
{
|
|
|
|
|
if (imo == null)
|
|
|
|
|
@ -2539,7 +2312,6 @@ namespace ENI2.Import
|
|
|
|
|
|
|
|
|
|
result.HerbergEmailContactReportingVessel = reader.ReadText("ShipMail");
|
|
|
|
|
result.HerbergReportType = reader.ReadText("ReferenceNumber");
|
|
|
|
|
reader.Conf.ConfirmText("ReferenceNumber", result.HerbergReportType, result.HerbergReportType.IsNullOrEmpty() ? ExcelReader.ReadState.FAIL : ExcelReader.ReadState.OK);
|
|
|
|
|
|
|
|
|
|
if (result.IsTransit)
|
|
|
|
|
result.ETAKielCanal = eta;
|
|
|
|
|
|