Version 3.9.2
Diverse Korrekturen für Go-Live, gelöschte-ID Bug gefunden (war den Core als stat. Dictionary Key Objekt zu behalten und später nicht mehr neu zu laden, so überschrieb der "alte" Core die neue Version mit der Visit-Id.
This commit is contained in:
parent
f6caab44f8
commit
695c07a5f7
@ -22,6 +22,7 @@
|
||||
<Label Name="labelStatusTransmitter" Content="?" FontWeight="Bold" />
|
||||
<Label Content="Report:" />
|
||||
<Label Name="labelStatusReport" Content="?" FontWeight="Bold" />
|
||||
<Button Name="refreshButton" Content="{x:Static p:Resources.textRefresh}" Margin="4" Background="Transparent" Click="refreshButton_Click"/>
|
||||
</StackPanel>
|
||||
<local:ENIDataGrid Grid.Row="1"
|
||||
Margin="2,4,2,2" x:Name="dataGridStatus" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
|
||||
|
||||
@ -55,11 +55,12 @@ namespace ENI2.Controls
|
||||
|
||||
ServiceControllerStatus transmitter = (ServiceControllerStatus)serverStatus.Transmitter;
|
||||
this.labelStatusTransmitter.Content = transmitter.ToString();
|
||||
//this.dataGridStatus.Items.Refresh();
|
||||
|
||||
entries.BubbleSort();
|
||||
});
|
||||
}
|
||||
|
||||
public class StatusEntry
|
||||
public class StatusEntry : IComparable
|
||||
{
|
||||
private static Dictionary<string, string> guidIdDict = new Dictionary<string, string>();
|
||||
|
||||
@ -118,8 +119,20 @@ namespace ENI2.Controls
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void ClearIds() { guidIdDict.Clear(); }
|
||||
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
if(obj is StatusEntry)
|
||||
return -(Timestamp.CompareTo(((StatusEntry)obj).Timestamp));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void refreshButton_Click(object sender, System.Windows.RoutedEventArgs e)
|
||||
{
|
||||
StatusEntry.ClearIds();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -390,53 +390,56 @@ namespace ENI2
|
||||
}
|
||||
|
||||
// NOA_NOD vor ATA vor ATD Versendereihenfolge sicherstellen
|
||||
bool noa_nod_queued_or_sent = false;
|
||||
bool ata_queued_or_sent = false;
|
||||
foreach(Message aMessage in this._messages)
|
||||
if ((this.Core.InitialHIS == Message.NSWProvider.DUDR) || (this.Core.InitialHIS == Message.NSWProvider.DUDR_TEST))
|
||||
{
|
||||
if(aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
|
||||
bool noa_nod_queued_or_sent = false;
|
||||
bool ata_queued_or_sent = false;
|
||||
foreach (Message aMessage in this._messages)
|
||||
{
|
||||
if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
noa_nod_queued_or_sent = true;
|
||||
}
|
||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
|
||||
{
|
||||
if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
ata_queued_or_sent = true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach(Message aMessage in this._messages)
|
||||
{
|
||||
if((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
{
|
||||
if(!noa_nod_queued_or_sent)
|
||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
|
||||
{
|
||||
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
aMessage.ChangedBy = "";
|
||||
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA");
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
|
||||
if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
noa_nod_queued_or_sent = true;
|
||||
}
|
||||
if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
|
||||
{
|
||||
if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
ata_queued_or_sent = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATD) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
foreach (Message aMessage in this._messages)
|
||||
{
|
||||
if (!noa_nod_queued_or_sent)
|
||||
if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
{
|
||||
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
aMessage.ChangedBy = "";
|
||||
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD");
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
|
||||
if (!noa_nod_queued_or_sent)
|
||||
{
|
||||
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
aMessage.ChangedBy = "";
|
||||
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA");
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
|
||||
}
|
||||
}
|
||||
|
||||
if(!ata_queued_or_sent)
|
||||
if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATD) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||
{
|
||||
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
aMessage.ChangedBy = "";
|
||||
aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD");
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
|
||||
if (!noa_nod_queued_or_sent)
|
||||
{
|
||||
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
aMessage.ChangedBy = "";
|
||||
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD");
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
|
||||
}
|
||||
|
||||
if (!ata_queued_or_sent)
|
||||
{
|
||||
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||
aMessage.ChangedBy = "";
|
||||
aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD");
|
||||
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>3.9.0.%2a</ApplicationVersion>
|
||||
<ApplicationVersion>3.9.2.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
|
||||
@ -49,18 +49,24 @@ namespace ENI2.Util
|
||||
|
||||
if(entity.IsTransit)
|
||||
{
|
||||
if ((!watchedEntity.TransitId.IsNullOrEmpty()) && !entity.TransitId.Equals(watchedEntity.TransitId))
|
||||
if (!entity.TransitId.IsNullOrEmpty())
|
||||
{
|
||||
OnVisitTransitIdUpdated(entity);
|
||||
watchedEntity.TransitId = entity.TransitId;
|
||||
if ((watchedEntity.TransitId.IsNullOrEmpty()) && !entity.TransitId.Equals(watchedEntity.TransitId))
|
||||
{
|
||||
OnVisitTransitIdUpdated(entity);
|
||||
watchedEntity.TransitId = entity.TransitId;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((!watchedEntity.VisitId.IsNullOrEmpty()) && !entity.VisitId.Equals(watchedEntity.VisitId))
|
||||
if (!entity.VisitId.IsNullOrEmpty())
|
||||
{
|
||||
OnVisitTransitIdUpdated(entity);
|
||||
watchedEntity.VisitId = entity.VisitId;
|
||||
if ((watchedEntity.VisitId.IsNullOrEmpty()) && !entity.VisitId.Equals(watchedEntity.VisitId))
|
||||
{
|
||||
OnVisitTransitIdUpdated(entity);
|
||||
watchedEntity.VisitId = entity.VisitId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@ -472,13 +472,13 @@ namespace bsmd.ReportGenerator
|
||||
#endregion
|
||||
|
||||
#region LADG
|
||||
|
||||
/*
|
||||
if((message != null) && (message.MessageNotificationClass == Message.NotificationClass.LADG))
|
||||
{
|
||||
BSMDDocument.CreateLADGTable(document, message);
|
||||
return;
|
||||
}
|
||||
|
||||
*/
|
||||
#endregion
|
||||
|
||||
if (messageParagraph.MessageText != null) // komplette Nachricht (z.B. STAT)
|
||||
@ -661,19 +661,19 @@ namespace bsmd.ReportGenerator
|
||||
table.Borders.Visible = true;
|
||||
|
||||
Column column = table.AddColumn();
|
||||
column.Width = Unit.FromCentimeter(1);
|
||||
column.Width = Unit.FromCentimeter(0.8);
|
||||
column = table.AddColumn();
|
||||
column.Width = Unit.FromCentimeter(2);
|
||||
column = table.AddColumn();
|
||||
column.Width = Unit.FromCentimeter(2);
|
||||
column.Width = Unit.FromCentimeter(3);
|
||||
column = table.AddColumn();
|
||||
column.Width = Unit.FromCentimeter(2);
|
||||
column.Width = Unit.FromCentimeter(1.2);
|
||||
column = table.AddColumn();
|
||||
column.Width = Unit.FromCentimeter(9);
|
||||
|
||||
Row hRow = table.AddRow();
|
||||
|
||||
hRow.Cells[1].AddParagraph("LoCode");
|
||||
hRow.Cells[1].AddParagraph("Port");
|
||||
hRow.Cells[2].AddParagraph("Date of departure");
|
||||
hRow.Cells[3].AddParagraph("Crew members joined");
|
||||
hRow.Cells[4].AddParagraph("Names of joining crew");
|
||||
@ -681,19 +681,19 @@ namespace bsmd.ReportGenerator
|
||||
for (int i = 0; i < mdh.PortOfCallLast30Days.Count; i++)
|
||||
{
|
||||
Row row = table.AddRow();
|
||||
BSMDDocument.SetPoCLast30Days((i + 1), ((PortOfCallLast30Days) mdh.PortOfCallLast30Days[i]), row);
|
||||
BSMDDocument.SetPoCLast30Days(((PortOfCallLast30Days) mdh.PortOfCallLast30Days[i]), row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetPoCLast30Days(int p, PortOfCallLast30Days portOfCallLast30Days, Row row)
|
||||
private static void SetPoCLast30Days(PortOfCallLast30Days portOfCallLast30Days, Row row)
|
||||
{
|
||||
row.Cells[0].AddParagraph(p.ToString());
|
||||
row.Cells[0].AddParagraph(portOfCallLast30Days.Identifier);
|
||||
row.Cells[1].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysLocode ?? "");
|
||||
row.Cells[2].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.HasValue ?
|
||||
portOfCallLast30Days.PortOfCallLast30DaysDateOfDeparture.Value.ToShortDateString() : "");
|
||||
row.Cells[3].AddParagraph(portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.HasValue ?
|
||||
portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.Value ? "True" : "False" : "");
|
||||
portOfCallLast30Days.PortOfCallLast30DaysCrewMembersJoined.Value ? "Yes" : "No" : "");
|
||||
for (int i = 0; i < portOfCallLast30Days.CrewJoinedShip.Count; i++)
|
||||
{
|
||||
row.Cells[4].AddParagraph(portOfCallLast30Days.CrewJoinedShip[i].PortOfCallLast30DaysCrewJoinedShipName ?? "");
|
||||
@ -888,8 +888,8 @@ namespace bsmd.ReportGenerator
|
||||
row.Cells[0].AddParagraph("Valid exemption?");
|
||||
row.Cells[1].AddParagraph("Confirmation of correctness");
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph(was.WasteDisposalValidExemption ?? false ? "YES" : "NO");
|
||||
row.Cells[1].AddParagraph(was.ConfirmationOfCorrectness ?? false ? "YES" : "NO");
|
||||
row.Cells[0].AddParagraph(was.WasteDisposalValidExemption ?? false ? "Yes" : "No");
|
||||
row.Cells[1].AddParagraph(was.ConfirmationOfCorrectness ?? false ? "Yes" : "No");
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("Last port where waste or cargo residues were discharged");
|
||||
@ -897,7 +897,7 @@ namespace bsmd.ReportGenerator
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph(was.LastWasteDisposalPort ?? "");
|
||||
if(was.LastWasteDisposalDate.HasValue)
|
||||
row.Cells[1].AddParagraph(was.LastWasteDisposalDate.ToString());
|
||||
row.Cells[1].AddParagraph(was.LastWasteDisposalDate?.ToShortDateString());
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("Name of waste disposal service provider");
|
||||
row.Cells[1].AddParagraph("Waste disposal order (all, some, none)");
|
||||
@ -935,40 +935,61 @@ namespace bsmd.ReportGenerator
|
||||
row.Cells[6].AddParagraph("Estimated waste/cargo residues amount generated between port of call and next port");
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("1 Oil Sludge");
|
||||
GetWasteForIndex(1, was, row);
|
||||
row.Cells[0].AddParagraph("1100 Oily residues (sludge)");
|
||||
GetWasteForIndex(1100, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("2 Oil Bilgewater");
|
||||
GetWasteForIndex(2, was, row);
|
||||
row.Cells[0].AddParagraph("1200 Oily bilge water");
|
||||
GetWasteForIndex(1200, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("3 Oil other");
|
||||
GetWasteForIndex(3, was, row);
|
||||
row.Cells[0].AddParagraph("1300 Waste oil - others");
|
||||
GetWasteForIndex(1300, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("4 Garbage Foodwaste");
|
||||
GetWasteForIndex(4, was, row);
|
||||
row.Cells[0].AddParagraph("2100 Food waste");
|
||||
GetWasteForIndex(2100, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("5 Garbage plastic");
|
||||
GetWasteForIndex(5, was, row);
|
||||
row.Cells[0].AddParagraph("2200 Plastic");
|
||||
GetWasteForIndex(2200, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("6 Garbage other");
|
||||
GetWasteForIndex(6, was, row);
|
||||
row.Cells[0].AddParagraph("2300 Domestic wastes");
|
||||
GetWasteForIndex(2300, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("7 Sewage");
|
||||
GetWasteForIndex(7, was, row);
|
||||
row.Cells[0].AddParagraph("2311 Cooking oil");
|
||||
GetWasteForIndex(2311, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("8 Cargo associated waste");
|
||||
GetWasteForIndex(8, was, row);
|
||||
row.Cells[0].AddParagraph("2308 Incinerator ashes");
|
||||
GetWasteForIndex(2308, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("9 Cargo residues");
|
||||
GetWasteForIndex(9, was, row);
|
||||
row.Cells[0].AddParagraph("2600 Operational wastes");
|
||||
GetWasteForIndex(2600, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("2309 Animal carcass(es)");
|
||||
GetWasteForIndex(2309, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("3000 Sewage");
|
||||
GetWasteForIndex(3000, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("5100 Cargo residues - Marpol Annex I");
|
||||
GetWasteForIndex(5100, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("5200 Cargo residues - Marpol Annex II");
|
||||
GetWasteForIndex(5200, was, row);
|
||||
|
||||
row = table.AddRow();
|
||||
row.Cells[0].AddParagraph("5300 Cargo residues - Marpol Annex ");
|
||||
GetWasteForIndex(5300, was, row);
|
||||
|
||||
}
|
||||
|
||||
private static void GetWasteForIndex(int index, WAS was, Row row)
|
||||
@ -1055,6 +1076,7 @@ namespace bsmd.ReportGenerator
|
||||
/// <param name="propertyName">Name des Felds (ohne Klassenname)</param>
|
||||
/// <param name="value">Aktueller Wert / Wert aus der DB</param>
|
||||
/// <returns>ggf. ersetzter Wert</returns>
|
||||
|
||||
|
||||
private static string DatabaseEntity_ReportReplacer(string propertyName, string value)
|
||||
{
|
||||
@ -1063,6 +1085,10 @@ namespace bsmd.ReportGenerator
|
||||
|
||||
string result = value;
|
||||
|
||||
// ACHTUNG! Die Name (propertyName) sind die bereits in report.db *ersetzten* Namen, d.h. ändert man dort
|
||||
// wieder etwas funktioniert es ggf. hier nicht mehr. Das ist leider aufwändig zu ändern, man müsste die Report
|
||||
// Erzeugung komplett umbauen
|
||||
|
||||
switch(propertyName)
|
||||
{
|
||||
case "PackageType":
|
||||
@ -1080,10 +1106,32 @@ namespace bsmd.ReportGenerator
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "Ship Type":
|
||||
if (LocalizedLookup.getVesselTypes().ContainsKey(value))
|
||||
result = string.Format("{0} - {1}", value, LocalizedLookup.getVesselTypes()[value]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(propertyName.Contains("flag", StringComparison.OrdinalIgnoreCase))
|
||||
if (LocalizedLookup.getNationalities().ContainsKey(value))
|
||||
result = LocalizedLookup.getNationalities()[value];
|
||||
|
||||
if(propertyName.Contains("port", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string portName = LocodeDB.PortNameFromLocode(value);
|
||||
if (!portName.IsNullOrEmpty())
|
||||
{
|
||||
result = string.Format("{0} - {1}", value, portName);
|
||||
}
|
||||
}
|
||||
|
||||
if (propertyName.Contains("nst2007", StringComparison.OrdinalIgnoreCase))
|
||||
if (LocalizedLookup.getCargoCodesNST().ContainsKey(value))
|
||||
result = LocalizedLookup.getCargoCodesNST()[value];
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -241,7 +241,8 @@ namespace bsmd.ReportGenerator
|
||||
{
|
||||
if (aMessage.InternalStatus == Message.BSMDStatus.REPORT)
|
||||
{
|
||||
reportMessages.Add(aMessage);
|
||||
if ((aMessage.MessageNotificationClass != Message.NotificationClass.VISIT) && (aMessage.MessageNotificationClass != Message.NotificationClass.TRANSIT))
|
||||
reportMessages.Add(aMessage);
|
||||
aMessage.InternalStatus = Message.BSMDStatus.PREPARE;
|
||||
DBManager.Instance.Save(aMessage);
|
||||
sb.Append(aMessage.MessageNotificationClassDisplay);
|
||||
@ -262,7 +263,7 @@ namespace bsmd.ReportGenerator
|
||||
|
||||
Dictionary<string, string> coverInfos = new Dictionary<string, string>();
|
||||
coverInfos.Add("Ship", DBManager.Instance.GetShipNameFromCore(reportCore));
|
||||
coverInfos.Add("ETA", reportCore.ETA_NOA_NOD.ToString());
|
||||
coverInfos.Add("ETA", reportCore.ETA_NOA_NOD.HasValue ? reportCore.ETA_NOA_NOD.Value.ToLocalTime().ToString() : "");
|
||||
coverInfos.Add("Port of call", reportCore.Portname);
|
||||
coverInfos.Add("Visit-ID", reportCore.DisplayId);
|
||||
coverInfos.Add("Class", classes);
|
||||
|
||||
@ -314,6 +314,8 @@ namespace bsmd.database
|
||||
public virtual string GetDisplayValue(PropertyInfo property)
|
||||
{
|
||||
bool isDouble = (property.PropertyType == typeof(Nullable<double>));
|
||||
bool isDateTime = (property.PropertyType == typeof(Nullable<DateTime>));
|
||||
|
||||
object propValue = property.GetValue(this, null);
|
||||
if (propValue == null) return "";
|
||||
string value = propValue.ToString();
|
||||
@ -321,6 +323,17 @@ namespace bsmd.database
|
||||
{
|
||||
value = ((double)propValue).ToString("N2");
|
||||
}
|
||||
else if(isDateTime)
|
||||
{
|
||||
if(Attribute.IsDefined(property, typeof(DateOnlyAttribute)))
|
||||
{
|
||||
value = ((DateTime)propValue).ToShortDateString();
|
||||
}
|
||||
else
|
||||
{
|
||||
value = ((DateTime)propValue).ToLocalTime().ToString(); // perform UTC-LocalTime Conversion
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(ReportReplacer != null)
|
||||
|
||||
@ -14,6 +14,7 @@ using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using log4net;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
|
||||
namespace bsmd.database
|
||||
{
|
||||
@ -152,5 +153,22 @@ namespace bsmd.database
|
||||
return str.Substring(0, maxLen);
|
||||
}
|
||||
|
||||
public static void BubbleSort(this IList o)
|
||||
{
|
||||
for (int i = o.Count - 1; i >= 0; i--)
|
||||
{
|
||||
for (int j = 1; j <= i; j++)
|
||||
{
|
||||
object o1 = o[j - 1];
|
||||
object o2 = o[j];
|
||||
if (((IComparable)o1).CompareTo(o2) > 0)
|
||||
{
|
||||
o.Remove(o1);
|
||||
o.Insert(j, o1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -113,6 +113,7 @@ namespace bsmd.database
|
||||
[ShowReport]
|
||||
[MaxLength(11)]
|
||||
[ENI2Validation]
|
||||
[Validation(ValidationCode.DOT_NO_COMMA)]
|
||||
public string Flashpoint_CEL { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -67,6 +67,7 @@ namespace bsmd.database
|
||||
[ShowReport]
|
||||
[MaxLength(10)]
|
||||
[ENI2Validation]
|
||||
[Validation(ValidationCode.DOT_NO_COMMA)]
|
||||
public string Flashpoint_CEL { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -51,6 +51,7 @@ namespace bsmd.database
|
||||
[ShowReport]
|
||||
[MaxLength(10)]
|
||||
[ENI2Validation]
|
||||
[Validation(ValidationCode.DOT_NO_COMMA)]
|
||||
public string Flashpoint_CEL { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -154,6 +154,7 @@ namespace bsmd.database
|
||||
[ShowReport]
|
||||
[LookupName("MDH.DateOfIssue")]
|
||||
[ENI2Validation]
|
||||
[DateOnly]
|
||||
public DateTime? DateOfIssue { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -66,6 +66,7 @@ namespace bsmd.database
|
||||
[ShowReport]
|
||||
[LookupName("PRE72H.DateOfLastExpandedInspection")]
|
||||
[ENI2Validation]
|
||||
[DateOnly]
|
||||
public DateTime? DateOfLastExpandedInspection { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -2,6 +2,6 @@
|
||||
|
||||
[assembly: AssemblyCompany("schick Informatik")]
|
||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||
[assembly: AssemblyInformationalVersion("3.9.0")]
|
||||
[assembly: AssemblyInformationalVersion("3.9.2")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("3.9.0.*")]
|
||||
[assembly: AssemblyVersion("3.9.2.*")]
|
||||
|
||||
|
||||
@ -306,6 +306,22 @@ namespace bsmd.database
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ValidationCode.DOT_NO_COMMA:
|
||||
{
|
||||
if(!value.IsNullOrEmpty() && (value.Contains(",")))
|
||||
{
|
||||
errors.Add(RuleEngine.CreateError(validationCode, property.Name, value, entity.Title, identifier, entity.Tablename));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ValidationCode.VESSEL_TYPE:
|
||||
{
|
||||
if((value.Length == 0) || ((STAT.VesselTypeDict != null) && !STAT.VesselTypeDict.ContainsKey(value)))
|
||||
{
|
||||
errors.Add(RuleEngine.CreateError(ValidationCode.NOT_NULL, property.Name, value, entity.Title, identifier, entity.Tablename));
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@ -113,6 +113,7 @@ namespace bsmd.database
|
||||
[Validation2(ValidationCode.NOT_NULL)]
|
||||
[LookupName("SEC.ISSCDateOfExpiration")]
|
||||
[ENI2Validation]
|
||||
[DateOnly]
|
||||
public DateTime? ISSCDateOfExpiration { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -102,7 +102,7 @@ namespace bsmd.database
|
||||
}
|
||||
|
||||
[ShowReport]
|
||||
[Validation(ValidationCode.NOT_NULL)]
|
||||
[Validation(ValidationCode.VESSEL_TYPE)]
|
||||
[LookupName("STAT.ShipType")]
|
||||
[MaxLength(5)]
|
||||
[ENI2Validation]
|
||||
|
||||
@ -18,6 +18,12 @@ namespace bsmd.database
|
||||
public ShowReportAttribute() { }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class DateOnlyAttribute : Attribute
|
||||
{
|
||||
public DateOnlyAttribute() { }
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Property)]
|
||||
public class ReportDisplayNameAttribute : Attribute
|
||||
{
|
||||
|
||||
@ -34,6 +34,8 @@ namespace bsmd.database
|
||||
IMPLAUSIBLE_ZZUKN,
|
||||
LOCODE_NOPORT,
|
||||
LOCODE_SSN,
|
||||
DOT_NO_COMMA,
|
||||
VESSEL_TYPE,
|
||||
POSITION_COUNT = 22,
|
||||
STRING_UNNUMBER = 23,
|
||||
STRING_IMOCLASS = 24,
|
||||
|
||||
@ -48,7 +48,7 @@ namespace bsmd.database
|
||||
public bool? WasteDisposalValidExemption { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
[Validation2(ValidationCode.NOT_NULL)]
|
||||
[Validation2(ValidationCode.LOCODE)]
|
||||
[LookupName("WAS.LastWasteDisposalPort")]
|
||||
[MaxLength(5)]
|
||||
[ENI2Validation]
|
||||
@ -64,6 +64,7 @@ namespace bsmd.database
|
||||
[Validation2(ValidationCode.NOT_NULL)]
|
||||
[LookupName("WAS.LastWasteDisposalDate")]
|
||||
[ENI2Validation]
|
||||
[DateOnly]
|
||||
public DateTime? LastWasteDisposalDate { get; set; }
|
||||
|
||||
[ShowReport]
|
||||
|
||||
@ -52,8 +52,9 @@ namespace bsmd.hisnord
|
||||
|
||||
if (theResult.code > 0)
|
||||
{
|
||||
core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
||||
DBManager.Instance.Save(core);
|
||||
MessageCore reloadCore = DBManager.Instance.GetMessageCoreById(core.Id.Value);
|
||||
reloadCore.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
||||
DBManager.Instance.Save(reloadCore);
|
||||
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
|
||||
DBManager.Instance.Save(message);
|
||||
|
||||
@ -734,7 +735,8 @@ namespace bsmd.hisnord
|
||||
SERV serv = message.Elements[i] as SERV;
|
||||
hn_serv.Service[i] = new service();
|
||||
hn_serv.Service[i].ServiceBeneficiary = serv.ServiceBeneficiary;
|
||||
hn_serv.Service[i].ServiceName = serv.ServiceName;
|
||||
if(!serv.ServiceName.IsNullOrEmpty())
|
||||
hn_serv.Service[i].ServiceName = serv.ServiceName;
|
||||
hn_serv.Service[i].ServiceInvoiceRecipient = serv.ServiceInvoiceRecipient;
|
||||
}
|
||||
|
||||
@ -1328,7 +1330,8 @@ namespace bsmd.hisnord
|
||||
hn_pas.Passenger[i].PassengerPlaceOfBirth = pas.PassengerPlaceOfBirth;
|
||||
hn_pas.Passenger[i].PassengerPortOfDisembarkation = pas.PassengerPortOfDisembarkation;
|
||||
hn_pas.Passenger[i].PassengerPortOfEmbarkation = pas.PassengerPortOfEmbarkation;
|
||||
hn_pas.Passenger[i].PassengerVisaNumber = pas.PassengerVisaNumber;
|
||||
if(!pas.PassengerVisaNumber.IsNullOrEmpty())
|
||||
hn_pas.Passenger[i].PassengerVisaNumber = pas.PassengerVisaNumber;
|
||||
}
|
||||
|
||||
items1ChoiceType.Add(Items1ChoiceType.PAS);
|
||||
@ -1524,16 +1527,23 @@ namespace bsmd.hisnord
|
||||
{
|
||||
AGNT agnt = message.Elements[0] as AGNT;
|
||||
global::agnt hn_agnt = new global::agnt();
|
||||
hn_agnt.AgentCity = agnt.AgentCity;
|
||||
if(!agnt.AgentCity.IsNullOrEmpty())
|
||||
hn_agnt.AgentCity = agnt.AgentCity;
|
||||
hn_agnt.AgentCompanyName = agnt.AgentCompanyName;
|
||||
hn_agnt.AgentCountry = agnt.AgentCountry;
|
||||
hn_agnt.AgentEMail = agnt.AgentEMail;
|
||||
hn_agnt.AgentFax = agnt.AgentFax;
|
||||
hn_agnt.AgentFirstName = agnt.AgentFirstName;
|
||||
if(!agnt.AgentCountry.IsNullOrEmpty())
|
||||
hn_agnt.AgentCountry = agnt.AgentCountry;
|
||||
if(!agnt.AgentEMail.IsNullOrEmpty())
|
||||
hn_agnt.AgentEMail = agnt.AgentEMail;
|
||||
if(!agnt.AgentFax.IsNullOrEmpty())
|
||||
hn_agnt.AgentFax = agnt.AgentFax;
|
||||
if(!agnt.AgentFirstName.IsNullOrEmpty())
|
||||
hn_agnt.AgentFirstName = agnt.AgentFirstName;
|
||||
hn_agnt.AgentLastName = agnt.AgentLastName;
|
||||
hn_agnt.AgentPhone = agnt.AgentPhone;
|
||||
hn_agnt.AgentPostalCode = agnt.AgentPostalCode;
|
||||
hn_agnt.AgentStreetAndNumber = agnt.AgentStreetAndNumber;
|
||||
if(!agnt.AgentPostalCode.IsNullOrEmpty())
|
||||
hn_agnt.AgentPostalCode = agnt.AgentPostalCode;
|
||||
if(!agnt.AgentStreetAndNumber.IsNullOrEmpty())
|
||||
hn_agnt.AgentStreetAndNumber = agnt.AgentStreetAndNumber;
|
||||
items1ChoiceType.Add(Items1ChoiceType.AGNT);
|
||||
items1.Add(hn_agnt);
|
||||
}
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user