Version 3.7.5: Einzelnachrichtenversand für HIS-Nord, Vereinheitlichung der Sende.Logik im NSWSendService
This commit is contained in:
parent
938b760951
commit
4e7d1251b9
@ -314,7 +314,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.MARPOLPositions.Add(eld.MARPOL);
|
haz.MARPOLPositions.Add(eld.MARPOL);
|
||||||
this.dataGridMARPOLItems.Items.Refresh();
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
eld.MARPOL = new MARPOL_Annex_I_Position();
|
eld.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
eld.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
|
||||||
eld.MARPOL.HAZ = this.haz;
|
eld.MARPOL.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
@ -349,7 +349,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridMARPOLItems.Items.Refresh();
|
this.dataGridMARPOLItems.Items.Refresh();
|
||||||
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
ebd.MARPOL = new MARPOL_Annex_I_Position();
|
||||||
ebd.MARPOL.HAZ = this.haz;
|
ebd.MARPOL.HAZ = this.haz;
|
||||||
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions, "MARPOL-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions, "MARPOL-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -392,7 +392,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMSBCPositions.Add(eld.IMSBC);
|
haz.IMSBCPositions.Add(eld.IMSBC);
|
||||||
this.dataGridIMSBCItems.Items.Refresh();
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
eld.IMSBC = new IMSBCPosition();
|
eld.IMSBC = new IMSBCPosition();
|
||||||
eld.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
||||||
eld.IMSBC.HAZ = this.haz;
|
eld.IMSBC.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
@ -426,7 +426,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIMSBCItems.Items.Refresh();
|
this.dataGridIMSBCItems.Items.Refresh();
|
||||||
ebd.IMSBC = new IMSBCPosition();
|
ebd.IMSBC = new IMSBCPosition();
|
||||||
ebd.IMSBC.HAZ = this.haz;
|
ebd.IMSBC.HAZ = this.haz;
|
||||||
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IGCPositions.Add(eld.IGC);
|
haz.IGCPositions.Add(eld.IGC);
|
||||||
this.dataGridIGCItems.Items.Refresh();
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
eld.IGC = new IGCPosition();
|
eld.IGC = new IGCPosition();
|
||||||
eld.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
||||||
eld.IGC.HAZ = this.haz;
|
eld.IGC.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
@ -503,7 +503,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIGCItems.Items.Refresh();
|
this.dataGridIGCItems.Items.Refresh();
|
||||||
ebd.IGC = new IGCPosition();
|
ebd.IGC = new IGCPosition();
|
||||||
ebd.IGC.HAZ = this.haz;
|
ebd.IGC.HAZ = this.haz;
|
||||||
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -546,7 +546,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IBCPositions.Add(eld.IBC);
|
haz.IBCPositions.Add(eld.IBC);
|
||||||
this.dataGridIBCItems.Items.Refresh();
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
eld.IBC = new IBCPosition();
|
eld.IBC = new IBCPosition();
|
||||||
eld.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
||||||
eld.IBC.HAZ = this.haz;
|
eld.IBC.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
@ -580,7 +580,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIBCItems.Items.Refresh();
|
this.dataGridIBCItems.Items.Refresh();
|
||||||
ebd.IBC = new IBCPosition();
|
ebd.IBC = new IBCPosition();
|
||||||
ebd.IBC.HAZ = this.haz;
|
ebd.IBC.HAZ = this.haz;
|
||||||
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ namespace ENI2.DetailViewControls
|
|||||||
haz.IMDGPositions.Add(eld.IMDG);
|
haz.IMDGPositions.Add(eld.IMDG);
|
||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
eld.IMDG = new IMDGPosition();
|
eld.IMDG = new IMDGPosition();
|
||||||
eld.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
eld.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
||||||
eld.IMDG.HAZ = this.haz;
|
eld.IMDG.HAZ = this.haz;
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
@ -657,7 +657,7 @@ namespace ENI2.DetailViewControls
|
|||||||
this.dataGridIMDGItems.Items.Refresh();
|
this.dataGridIMDGItems.Items.Refresh();
|
||||||
ebd.IMDG = new IMDGPosition();
|
ebd.IMDG = new IMDGPosition();
|
||||||
ebd.IMDG.HAZ = this.haz;
|
ebd.IMDG.HAZ = this.haz;
|
||||||
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
ebd.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
|
||||||
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -232,6 +232,7 @@ namespace ENI2.DetailViewControls
|
|||||||
((DateTime.Now - l10fc.PortFacilityDateOfDeparture.Value).TotalDays < 31))
|
((DateTime.Now - l10fc.PortFacilityDateOfDeparture.Value).TotalDays < 31))
|
||||||
{
|
{
|
||||||
PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
|
PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
|
||||||
|
poc30.Identifier = PortOfCallLast30Days.GetNewIdentifier(this._mdh.PortOfCallLast30Days);
|
||||||
poc30.PortOfCallLast30DaysCrewMembersJoined = false;
|
poc30.PortOfCallLast30DaysCrewMembersJoined = false;
|
||||||
poc30.PortOfCallLast30DaysDateOfDeparture = l10fc.PortFacilityDateOfDeparture;
|
poc30.PortOfCallLast30DaysDateOfDeparture = l10fc.PortFacilityDateOfDeparture;
|
||||||
poc30.PortOfCallLast30DaysLocode = l10fc.PortFacilityPortLoCode;
|
poc30.PortOfCallLast30DaysLocode = l10fc.PortFacilityPortLoCode;
|
||||||
|
|||||||
@ -102,18 +102,6 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
<DataGridTemplateColumn IsReadOnly="True" Width="0.12*">
|
|
||||||
<DataGridTemplateColumn.HeaderTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteAmountDischargedLastPort}" FontSize="9"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.HeaderTemplate>
|
|
||||||
<DataGridTemplateColumn.CellTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock TextAlignment="Center" Text="{Binding WasteDisposedAtLastPort_MTQ, StringFormat={}{0:N3}}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
|
||||||
</DataGridTemplateColumn>
|
|
||||||
<DataGridTemplateColumn IsReadOnly="True" Width="0.12*">
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.12*">
|
||||||
<DataGridTemplateColumn.HeaderTemplate>
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
@ -126,6 +114,18 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</DataGridTemplateColumn.CellTemplate>
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
</DataGridTemplateColumn>
|
</DataGridTemplateColumn>
|
||||||
|
<DataGridTemplateColumn IsReadOnly="True" Width="0.12*">
|
||||||
|
<DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextWrapping="Wrap" Text="{x:Static p:Resources.textWasteAmountDischargedLastPort}" FontSize="9"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.HeaderTemplate>
|
||||||
|
<DataGridTemplateColumn.CellTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock TextAlignment="Center" Text="{Binding WasteDisposedAtLastPort_MTQ, StringFormat={}{0:N3}}" />
|
||||||
|
</DataTemplate>
|
||||||
|
</DataGridTemplateColumn.CellTemplate>
|
||||||
|
</DataGridTemplateColumn>
|
||||||
</DataGrid.Columns>
|
</DataGrid.Columns>
|
||||||
</enictrl:ENIDataGrid>
|
</enictrl:ENIDataGrid>
|
||||||
|
|
||||||
|
|||||||
@ -58,21 +58,20 @@ namespace ENI2.DetailViewControls
|
|||||||
|
|
||||||
private void buttonAddMissingEntries_Click(object sender, RoutedEventArgs e)
|
private void buttonAddMissingEntries_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
bool changedWaste = false;
|
|
||||||
|
|
||||||
// Convenience Methode, die fehlende Waste Einträge ergänzt (interessant bei "manuellen" Anmeldungen)
|
// Convenience Methode, die fehlende Waste Einträge ergänzt (interessant bei "manuellen" Anmeldungen)
|
||||||
foreach(int wasteCode in WAS.DKWasteCodes)
|
foreach (int wasteCode in WAS.DKWasteCodes)
|
||||||
{
|
{
|
||||||
bool codeFound = false;
|
Waste foundWaste = null;
|
||||||
foreach(Waste waste in this._was.Waste)
|
foreach (Waste waste in this._was.Waste)
|
||||||
{
|
{
|
||||||
if(waste.WasteType.HasValue && waste.WasteType.Value == wasteCode)
|
if (waste.WasteType.HasValue && waste.WasteType.Value == wasteCode)
|
||||||
{
|
{
|
||||||
codeFound = true;
|
foundWaste = waste;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!codeFound)
|
if (foundWaste == null)
|
||||||
{
|
{
|
||||||
Waste newWaste = new Waste();
|
Waste newWaste = new Waste();
|
||||||
newWaste.Identifier = DatabaseEntity.GetNewIdentifier(this._was.Waste);
|
newWaste.Identifier = DatabaseEntity.GetNewIdentifier(this._was.Waste);
|
||||||
@ -80,20 +79,28 @@ namespace ENI2.DetailViewControls
|
|||||||
newWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
|
newWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
|
||||||
newWaste.WasteAmountRetained_MTQ = 0;
|
newWaste.WasteAmountRetained_MTQ = 0;
|
||||||
newWaste.WasteCapacity_MTQ = 0;
|
newWaste.WasteCapacity_MTQ = 0;
|
||||||
newWaste.WasteDescription = "";
|
newWaste.WasteDescription = (wasteCode == 1300) ? "-" : "";
|
||||||
newWaste.WasteDisposalAmount_MTQ = 0;
|
newWaste.WasteDisposalAmount_MTQ = 0;
|
||||||
newWaste.WasteDisposalPort = "ZZUKN";
|
newWaste.WasteDisposalPort = "ZZUKN";
|
||||||
newWaste.WasteDisposedAtLastPort_MTQ = 0;
|
newWaste.WasteDisposedAtLastPort_MTQ = 0;
|
||||||
newWaste.WasteType = wasteCode;
|
newWaste.WasteType = wasteCode;
|
||||||
this._was.Waste.Add(newWaste);
|
this._was.Waste.Add(newWaste);
|
||||||
changedWaste = true;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!foundWaste.WasteAmountGeneratedTillNextPort_MTQ.HasValue) foundWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
|
||||||
|
if (!foundWaste.WasteAmountRetained_MTQ.HasValue) foundWaste.WasteAmountRetained_MTQ = 0;
|
||||||
|
if (!foundWaste.WasteCapacity_MTQ.HasValue) foundWaste.WasteCapacity_MTQ = 0;
|
||||||
|
if ((wasteCode == 1300) && foundWaste.WasteDescription.IsNullOrEmpty()) foundWaste.WasteDescription = "-";
|
||||||
|
if (!foundWaste.WasteDisposalAmount_MTQ.HasValue) foundWaste.WasteDisposalAmount_MTQ = 0;
|
||||||
|
if (foundWaste.WasteDisposalPort.IsNullOrEmpty()) foundWaste.WasteDisposalPort = "ZZUKN";
|
||||||
|
if (!foundWaste.WasteDisposedAtLastPort_MTQ.HasValue) foundWaste.WasteDisposedAtLastPort_MTQ = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(changedWaste)
|
|
||||||
{
|
this.SublistElementChanged(Message.NotificationClass.WAS);
|
||||||
this.SublistElementChanged(Message.NotificationClass.WAS);
|
this.dataGridWaste.Items.Refresh();
|
||||||
this.dataGridWaste.Items.Refresh();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||||
<WebPage>publish.html</WebPage>
|
<WebPage>publish.html</WebPage>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>3.7.4.%2a</ApplicationVersion>
|
<ApplicationVersion>3.7.5.%2a</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
|
|||||||
@ -24,6 +24,8 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
public IBCPosition IBC { get; set; }
|
public IBCPosition IBC { get; set; }
|
||||||
|
|
||||||
|
public string Identifier { get { return this.textBoxIdentifier.Text; } set { this.textBoxIdentifier.Text = value; } }
|
||||||
|
|
||||||
private void EditIBCDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditIBCDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.textBoxFlashpoint.Text = this.IBC.Flashpoint_CEL;
|
this.textBoxFlashpoint.Text = this.IBC.Flashpoint_CEL;
|
||||||
|
|||||||
@ -24,6 +24,8 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
public IGCPosition IGC { get; set; }
|
public IGCPosition IGC { get; set; }
|
||||||
|
|
||||||
|
public string Identifier { get { return this.textBoxIdentifier.Text; } set { this.textBoxIdentifier.Text = value; } }
|
||||||
|
|
||||||
private void EditIGCDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditIGCDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.textBoxIdentifier.Text = this.IGC.Identifier;
|
this.textBoxIdentifier.Text = this.IGC.Identifier;
|
||||||
|
|||||||
@ -24,6 +24,8 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
public IMDGPosition IMDG { get; set; }
|
public IMDGPosition IMDG { get; set; }
|
||||||
|
|
||||||
|
public string Identifier { get { return this.textBoxIdentifier.Text; } set { this.textBoxIdentifier.Text = value; } }
|
||||||
|
|
||||||
private void EditIMDGDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditIMDGDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.textBoxClass7NuclideName.Text = this.IMDG.Class7NuclideName;
|
this.textBoxClass7NuclideName.Text = this.IMDG.Class7NuclideName;
|
||||||
|
|||||||
@ -24,6 +24,8 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
public IMSBCPosition IMSBC { get; set; }
|
public IMSBCPosition IMSBC { get; set; }
|
||||||
|
|
||||||
|
public string Identifier { get { return this.textBoxIdentifier.Text; } set { this.textBoxIdentifier.Text = value; } }
|
||||||
|
|
||||||
private void EditIMSBCDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditIMSBCDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.textBoxBulkCargoShippingName.Text = this.IMSBC.BulkCargoShippingName;
|
this.textBoxBulkCargoShippingName.Text = this.IMSBC.BulkCargoShippingName;
|
||||||
|
|||||||
@ -24,6 +24,8 @@ namespace ENI2.EditControls
|
|||||||
|
|
||||||
public MARPOL_Annex_I_Position MARPOL { get; set; }
|
public MARPOL_Annex_I_Position MARPOL { get; set; }
|
||||||
|
|
||||||
|
public string Identifier { get { return this.textBoxIdentifier.Text; } set { this.textBoxIdentifier.Text = value; } }
|
||||||
|
|
||||||
private void EditMarpolDialog_Loaded(object sender, RoutedEventArgs e)
|
private void EditMarpolDialog_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.textBoxFlashpoint.Text = this.MARPOL.Flashpoint_CEL;
|
this.textBoxFlashpoint.Text = this.MARPOL.Flashpoint_CEL;
|
||||||
|
|||||||
@ -29,6 +29,8 @@ namespace ENI2.EditControls
|
|||||||
this.OKClicked += VisitIdDialog_OKClicked;
|
this.OKClicked += VisitIdDialog_OKClicked;
|
||||||
List<KeyValuePair<bsmd.database.Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<bsmd.database.Message.NSWProvider, string>>()
|
List<KeyValuePair<bsmd.database.Message.NSWProvider, string>> comboDataSource = new List<KeyValuePair<bsmd.database.Message.NSWProvider, string>>()
|
||||||
{
|
{
|
||||||
|
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DBH, "DBH live" ),
|
||||||
|
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DBH_TEST, "DBH Testsystem" ),
|
||||||
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord live" ),
|
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR, "HIS-Nord live" ),
|
||||||
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR_TEST, "HIS-Nord Testsystem" )
|
new KeyValuePair<bsmd.database.Message.NSWProvider, string>( Message.NSWProvider.DUDR_TEST, "HIS-Nord Testsystem" )
|
||||||
};
|
};
|
||||||
|
|||||||
Binary file not shown.
@ -82,56 +82,190 @@ namespace SendNSWMessageService
|
|||||||
if (DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString))
|
if (DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString))
|
||||||
{
|
{
|
||||||
// Datenbank auf zu sendende Objekte überprüfen und laden
|
// Datenbank auf zu sendende Objekte überprüfen und laden
|
||||||
|
|
||||||
List<MessageCore> coresMarkedForSending = DBManager.Instance.GetMessageCoresByStatus(MessageCore.BSMDStatus.TOSEND);
|
List<MessageCore> coresMarkedForSending = DBManager.Instance.GetMessageCoresByStatus(MessageCore.BSMDStatus.TOSEND);
|
||||||
|
|
||||||
foreach (MessageCore core in coresMarkedForSending)
|
foreach (MessageCore core in coresMarkedForSending)
|
||||||
{
|
{
|
||||||
// TODO: Hier sollten jeweils die "neuesten" Nachrichten geladen werden, wenn es mehrere geben sollte!!
|
|
||||||
List<Message> messages = DBManager.Instance.GetMessagesForCore(core, DBManager.MessageLoad.ALL);
|
List<Message> messages = DBManager.Instance.GetMessagesForCore(core, DBManager.MessageLoad.ALL);
|
||||||
|
List<Message> toSendMessageList = new List<Message>();
|
||||||
|
|
||||||
//
|
bool coreSendSucceeded = true;
|
||||||
// if (core.InitialHIS != Message.NSWProvider.DBH_TEST) continue; // ignore everything else
|
bool didSendSomething = false;
|
||||||
|
|
||||||
if ((core.InitialHIS == Message.NSWProvider.DUDR) || (core.InitialHIS == Message.NSWProvider.DUDR_TEST))
|
|
||||||
|
// Wenn es noch keine Visit-ID gibt können keine Meldeklassen versendet werden. Die Visit/Transit Meldung wird daher dann
|
||||||
|
// "leer" versendet
|
||||||
|
|
||||||
|
if ((core.IsTransit && core.TransitId.IsNullOrEmpty()) || (!core.IsTransit && core.VisitId.IsNullOrEmpty()))
|
||||||
{
|
{
|
||||||
// HIS-NORD: alles auf einmal
|
foreach (Message message in messages)
|
||||||
|
|
||||||
// Um Fehlern vorzubeugen wird jetzt nicht eine Datei erzeugt sondern für jede Meldeklasse eine einzelne
|
|
||||||
// (Wunsch CH vom 6.10.17).
|
|
||||||
bool sendSucceeded = true;
|
|
||||||
bool didSendSomething = false;
|
|
||||||
|
|
||||||
// Fall: keine Meldeklasse aber trotzdem auf TO_SEND. Entweder beim Beantragen von Visit-Id's oder beim Storno der gesamten
|
|
||||||
// Anmeldung
|
|
||||||
if ((core.DisplayId.Length == 0) || (core.Cancelled ?? false))
|
|
||||||
{
|
{
|
||||||
sendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, messages, (core.InitialHIS == Message.NSWProvider.DUDR_TEST)) ?? false;
|
if (((message.MessageNotificationClass == Message.NotificationClass.VISIT) && (!core.IsTransit)) ||
|
||||||
}
|
((message.MessageNotificationClass == Message.NotificationClass.TRANSIT) && (core.IsTransit)))
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (Message message in messages)
|
|
||||||
{
|
{
|
||||||
bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, messages, (core.InitialHIS == Message.NSWProvider.DUDR_TEST));
|
if ((message.InternalStatus == Message.BSMDStatus.UNDEFINED) ||
|
||||||
if (sendResult.HasValue)
|
(message.InternalStatus == Message.BSMDStatus.PREPARE) ||
|
||||||
|
(message.InternalStatus == Message.BSMDStatus.TOSEND))
|
||||||
{
|
{
|
||||||
didSendSomething = true;
|
_log.Debug("Visit/Transit not found, sending VISIT/TRANSIT message");
|
||||||
if (!sendResult.Value) sendSucceeded = false;
|
if (message.HIS == Message.NSWProvider.UNDEFINED)
|
||||||
|
message.HIS = core.InitialHIS;
|
||||||
|
if (core.DefaultReportingPartyId.HasValue) message.ReportingPartyId = core.DefaultReportingPartyId;
|
||||||
|
toSendMessageList.Add(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!didSendSomething) core.BSMDStatusInternal = MessageCore.BSMDStatus.PREPARE; // zurück zu neutral
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!sendSucceeded) core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
|
||||||
else core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
_log.InfoFormat("HIS-Nord Send: Core {0} [{1}] new Status {2}", core.Id, core.IMO, core.BSMDStatusInternal.ToString());
|
|
||||||
|
|
||||||
DBManager.Instance.Save(core);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// VISIT / TRANSIT Id vorhanden, Daten können übertragen werden
|
||||||
|
|
||||||
|
foreach (Message message in messages)
|
||||||
|
{
|
||||||
|
// Update 5.10.17: Alles was nicht explizit auf "TOSEND" steht wird nicht verschickt!
|
||||||
|
if (message.InternalStatus != Message.BSMDStatus.TOSEND) continue;
|
||||||
|
|
||||||
|
// "Virtuelle" Meldeklassen (bisher: DK) werden hier nicht versendet!
|
||||||
|
if ((message.MessageNotificationClass == Message.NotificationClass.STO) ||
|
||||||
|
(message.MessageNotificationClass == Message.NotificationClass.CREWD) ||
|
||||||
|
(message.MessageNotificationClass == Message.NotificationClass.PASD))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if ((message.MessageNotificationClass == Message.NotificationClass.VISIT) ||
|
||||||
|
(message.MessageNotificationClass == Message.NotificationClass.TRANSIT))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!XtraSendLogic.ShouldSendMessage(message))
|
||||||
|
{
|
||||||
|
message.InternalStatus = Message.BSMDStatus.SUSPENDED;
|
||||||
|
DBManager.Instance.Save(message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (core.DefaultReportingPartyId.HasValue)
|
||||||
|
{
|
||||||
|
message.ReportingPartyId = core.DefaultReportingPartyId; // Referenz umbiegen
|
||||||
|
if (DBManager.Instance.GetReportingPartyDict().ContainsKey(core.DefaultReportingPartyId.Value)) // geladenes Objekt ersetzen
|
||||||
|
message.ReportingParty = DBManager.Instance.GetReportingPartyDict()[core.DefaultReportingPartyId.Value];
|
||||||
|
}
|
||||||
|
|
||||||
|
toSendMessageList.Add(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Message message in toSendMessageList)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
bool sendSucceeded = false;
|
||||||
|
|
||||||
|
message.HIS = core.InitialHIS;
|
||||||
|
_log.InfoFormat("Sending {0} message to {1}",
|
||||||
|
message.MessageNotificationClass.ToString(), message.HIS.ToString());
|
||||||
|
|
||||||
|
// switch über passendes HIS / Schnittstelle
|
||||||
|
switch (message.HIS)
|
||||||
|
{
|
||||||
|
|
||||||
|
case Message.NSWProvider.DBH:
|
||||||
|
case Message.NSWProvider.DBH_TEST:
|
||||||
|
sendSucceeded = bsmd.dbh.Request.SendMessage(message, (message.HIS == Message.NSWProvider.DBH_TEST));
|
||||||
|
if (!sendSucceeded)
|
||||||
|
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
|
||||||
|
else
|
||||||
|
didSendSomething = true;
|
||||||
|
break;
|
||||||
|
case Message.NSWProvider.DAKOSY:
|
||||||
|
case Message.NSWProvider.DAKOSY_TEST:
|
||||||
|
sendSucceeded = bsmd.dakosy.Request.Send(message, true);
|
||||||
|
if (!sendSucceeded) message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
|
||||||
|
else didSendSomething = true;
|
||||||
|
break;
|
||||||
|
case Message.NSWProvider.DUDR:
|
||||||
|
case Message.NSWProvider.DUDR_TEST:
|
||||||
|
bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, message, (core.InitialHIS == Message.NSWProvider.DUDR_TEST));
|
||||||
|
if (sendResult.HasValue)
|
||||||
|
{
|
||||||
|
didSendSomething = true;
|
||||||
|
sendSucceeded = sendResult.Value;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
_log.WarnFormat("Initial HIS not specified for message {0}", message.Id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
coreSendSucceeded &= sendSucceeded;
|
||||||
|
|
||||||
|
if(sendSucceeded)
|
||||||
|
{
|
||||||
|
message.ChangedBy = ""; // Leeren nach RS mit CH: Sie möchte das Feld als Indikator "zu versenden" verwenden (ich war dagegen ;-)
|
||||||
|
message.InternalStatus = Message.BSMDStatus.SENT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
|
||||||
|
}
|
||||||
|
message.StatusInfo = "";
|
||||||
|
message.SentAt = DateTime.Now;
|
||||||
|
DBManager.Instance.DeleteSystemErrors(message);
|
||||||
|
DBManager.Instance.Save(message);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_log.ErrorFormat("SENDING message {0}: {1}", message.Id.ToString(), ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (didSendSomething)
|
||||||
|
{
|
||||||
|
// falls nur eine Nachricht gescheitert ist geht der Core auf SEND_FAILED, sonst FAILURE
|
||||||
|
core.BSMDStatusInternal = coreSendSucceeded ? MessageCore.BSMDStatus.SENT : MessageCore.BSMDStatus.FAILURE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
core.BSMDStatusInternal = MessageCore.BSMDStatus.PREPARE; // aus irgendwelchen Gründen wurde nichts verschickt -> zurück auf PREPARE
|
||||||
|
}
|
||||||
|
DBManager.Instance.Save(core);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ((core.InitialHIS == Message.NSWProvider.DUDR) || (core.InitialHIS == Message.NSWProvider.DUDR_TEST))
|
||||||
|
{
|
||||||
|
|
||||||
|
bool sendSucceeded = true;
|
||||||
|
bool didSendSomething = false;
|
||||||
|
|
||||||
|
// Fall: keine Meldeklasse aber trotzdem auf TO_SEND. Entweder beim Beantragen von Visit-Id's oder beim Storno der gesamten
|
||||||
|
// Anmeldung
|
||||||
|
if ((core.DisplayId.Length == 0) || (core.Cancelled ?? false))
|
||||||
|
{
|
||||||
|
sendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, messages, (core.InitialHIS == Message.NSWProvider.DUDR_TEST)) ?? false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (Message message in messages)
|
||||||
|
{
|
||||||
|
bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, message, (core.InitialHIS == Message.NSWProvider.DUDR_TEST));
|
||||||
|
if (sendResult.HasValue)
|
||||||
|
{
|
||||||
|
didSendSomething = true;
|
||||||
|
if (!sendResult.Value) sendSucceeded = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!didSendSomething) core.BSMDStatusInternal = MessageCore.BSMDStatus.PREPARE; // zurück zu neutral
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!sendSucceeded) core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
||||||
|
else core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
_log.InfoFormat("HIS-Nord Send: Core {0} [{1}] new Status {2}", core.Id, core.IMO, core.BSMDStatusInternal.ToString());
|
||||||
|
|
||||||
|
DBManager.Instance.Save(core);
|
||||||
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -302,16 +436,18 @@ namespace SendNSWMessageService
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bsmd.hisnord.transmitter.CallTransmitter(true);
|
bsmd.hisnord.transmitter.CallTransmitter(true);
|
||||||
// bsmd.hisnord.transmitter.CallTransmitter(false); // wird aktuell nicht funktionieren
|
// bsmd.hisnord.transmitter.CallTransmitter(false); // wird aktuell nicht funktionieren
|
||||||
|
|
||||||
// ob test oder nicht ist in stat. dict gespeicher
|
// ob test oder nicht ist in stat. dict gespeicher
|
||||||
bsmd.hisnord.Request.ReadResponseFiles();
|
bsmd.hisnord.Request.ReadResponseFiles();
|
||||||
bsmd.hisnord.Request.Clear();
|
|
||||||
|
|
||||||
bsmd.hisnord.Response.ReadAnswers(true);
|
bsmd.hisnord.Response.ReadAnswers(true);
|
||||||
bsmd.hisnord.Response.ReadAnswers(false);
|
// bsmd.hisnord.Response.ReadAnswers(false);
|
||||||
|
|
||||||
List<MessageCore> coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag();
|
List<MessageCore> coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag();
|
||||||
|
|
||||||
|
|||||||
@ -96,8 +96,9 @@ namespace bsmd.ExcelReadService
|
|||||||
results.Add(entry);
|
results.Add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string query = string.Format("SELECT locodes.name, city_code, countries.code FROM locodes JOIN countries ON locodes.country_id = countries.ID WHERE locodes.port='t' AND (locodes.name like '{0}' OR locodes.name_wo_diacritics like '{0}')", city);
|
string query = "SELECT locodes.name, city_code, countries.code FROM locodes JOIN countries ON locodes.country_id = countries.ID WHERE locodes.port='t' AND (locodes.name like $PAR OR locodes.name_wo_diacritics like $PAR)";
|
||||||
SQLiteCommand cmd = new SQLiteCommand(query, _con);
|
SQLiteCommand cmd = new SQLiteCommand(query, _con);
|
||||||
|
cmd.Parameters.AddWithValue("$PAR", city);
|
||||||
IDataReader reader = cmd.ExecuteReader();
|
IDataReader reader = cmd.ExecuteReader();
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
|
||||||
[assembly: AssemblyProduct("BSMD NSW interface")]
|
[assembly: AssemblyProduct("BSMD NSW interface")]
|
||||||
[assembly: AssemblyInformationalVersion("3.7.4")]
|
[assembly: AssemblyInformationalVersion("3.7.5")]
|
||||||
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
|
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.7.4.*")]
|
[assembly: AssemblyVersion("3.7.5.*")]
|
||||||
|
|
||||||
|
|||||||
@ -100,14 +100,16 @@ namespace bsmd.database
|
|||||||
switch (filter)
|
switch (filter)
|
||||||
{
|
{
|
||||||
case Message.LoadFilter.BY_CORE:
|
case Message.LoadFilter.BY_CORE:
|
||||||
query += "WHERE MessageCoreId = @COREID";
|
query += "WHERE MessageCoreId = @COREID AND Deleted = 0";
|
||||||
((SqlCommand)cmd).Parameters.AddWithValue("@COREID", criteria[0]);
|
((SqlCommand)cmd).Parameters.AddWithValue("@COREID", criteria[0]);
|
||||||
break;
|
break;
|
||||||
case Message.LoadFilter.MESSAGEHEADER:
|
case Message.LoadFilter.MESSAGEHEADER:
|
||||||
query += "WHERE MessageHeaderId = @MHID";
|
query += "WHERE MessageHeaderId = @MHID AND Deleted = 0";
|
||||||
((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]);
|
((SqlCommand)cmd).Parameters.AddWithValue("@MHID", criteria[0]);
|
||||||
break;
|
break;
|
||||||
case Message.LoadFilter.ALL:
|
case Message.LoadFilter.ALL:
|
||||||
|
query += "WHERE Deleted = 0";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,8 @@ namespace bsmd.dbh
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
message.StatusInfo = ""; // zurücksetzen analog zu HIS-Nord (5.10.17)
|
// message.StatusInfo = ""; // zurücksetzen analog zu HIS-Nord (5.10.17)
|
||||||
message.ChangedBy = "";
|
// message.ChangedBy = "";
|
||||||
|
|
||||||
// map message to dbh NSWRequest object
|
// map message to dbh NSWRequest object
|
||||||
Dbh_Osis_Answ_Ws client = new Dbh_Osis_Answ_Ws();
|
Dbh_Osis_Answ_Ws client = new Dbh_Osis_Answ_Ws();
|
||||||
|
|||||||
@ -21,9 +21,9 @@ namespace bsmd.hisnord
|
|||||||
{
|
{
|
||||||
private static ILog _log = LogManager.GetLogger(typeof(Request));
|
private static ILog _log = LogManager.GetLogger(typeof(Request));
|
||||||
private static Dictionary<Guid, ReportingParty> _reportingPartyDict = null;
|
private static Dictionary<Guid, ReportingParty> _reportingPartyDict = null;
|
||||||
private static Dictionary<MessageCore, string> coreFilenameDict = new Dictionary<MessageCore, string>();
|
private static Dictionary<MessageCore, Dictionary<Message, string>> coreFilenameDict = new Dictionary<MessageCore, Dictionary<Message,string>>();
|
||||||
private static Dictionary<MessageCore, bool> coreUseTestDict = new Dictionary<MessageCore, bool>();
|
private static Dictionary<MessageCore, bool> coreUseTestDict = new Dictionary<MessageCore, bool>();
|
||||||
private static Dictionary<Message.NotificationClass, Message> noteMessageDict = new Dictionary<Message.NotificationClass, Message>();
|
//private static Dictionary<Message.NotificationClass, Message> noteMessageDict = new Dictionary<Message.NotificationClass, Message>();
|
||||||
|
|
||||||
internal static Dictionary<Guid, ReportingParty> ReportingPartyDict
|
internal static Dictionary<Guid, ReportingParty> ReportingPartyDict
|
||||||
{
|
{
|
||||||
@ -37,103 +37,51 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Clear()
|
|
||||||
{
|
|
||||||
coreFilenameDict.Clear();
|
|
||||||
coreUseTestDict.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void ReadResponseFiles()
|
public static void ReadResponseFiles()
|
||||||
{
|
{
|
||||||
foreach (MessageCore core in coreFilenameDict.Keys)
|
foreach (MessageCore core in coreFilenameDict.Keys)
|
||||||
{
|
{
|
||||||
transmitter.result theResult = transmitter.GetResult(coreFilenameDict[core], coreUseTestDict[core]);
|
List<Message> responseList = new List<Message>();
|
||||||
if (theResult != null)
|
|
||||||
|
foreach (Message message in coreFilenameDict[core].Keys)
|
||||||
{
|
{
|
||||||
_log.InfoFormat("Result: Code {0} Detail {1} Message {2}", theResult.code, theResult.detail, theResult.message);
|
transmitter.result theResult = transmitter.GetResult(coreFilenameDict[core][message], coreUseTestDict[core]);
|
||||||
|
if (theResult != null)
|
||||||
if (theResult.code > 0)
|
|
||||||
{
|
{
|
||||||
core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
_log.InfoFormat("Result: Code {0} Detail {1} Message {2}", theResult.code, theResult.detail, theResult.message);
|
||||||
|
|
||||||
Message helperRefMessage = null;
|
if (theResult.code > 0)
|
||||||
if (core.IsTransit)
|
{
|
||||||
helperRefMessage = DBManager.Instance.GetMessage(core, Message.NotificationClass.TRANSIT);
|
core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
|
||||||
else
|
DBManager.Instance.Save(core);
|
||||||
helperRefMessage = DBManager.Instance.GetMessage(core, Message.NotificationClass.VISIT);
|
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
|
||||||
|
DBManager.Instance.Save(message);
|
||||||
|
|
||||||
SystemError se = new SystemError();
|
SystemError se = new SystemError();
|
||||||
se.ErrorCode = theResult.code;
|
se.ErrorCode = theResult.code;
|
||||||
se.ErrorMessage = theResult.message.Truncate(255);
|
se.ErrorMessage = theResult.message.Truncate(255);
|
||||||
se.ErrorDescription = theResult.detail.Truncate(255);
|
se.ErrorDescription = theResult.detail.Truncate(255);
|
||||||
se.ErrorAt = DateTime.Now;
|
se.ErrorAt = DateTime.Now;
|
||||||
se.MessageCoreId = core.Id.Value;
|
se.MessageCoreId = core.Id.Value;
|
||||||
if (helperRefMessage != null)
|
se.MessageHeaderId = message.Id;
|
||||||
se.MessageHeaderId = helperRefMessage.Id;
|
|
||||||
|
|
||||||
DBManager.Instance.Save(se);
|
DBManager.Instance.Save(se);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
responseList.Add(message);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT;
|
|
||||||
}
|
|
||||||
DBManager.Instance.Save(core);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (Message removeMessage in responseList)
|
||||||
|
coreFilenameDict[core].Remove(removeMessage);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
public static bool? CreateSendFile(MessageCore core, Message message, bool useTest)
|
||||||
/// Passende Nachricht (unter bestimmten Voraussetzungen) aus dem Sende-Dict holen (aber nur wenn sie wirklich
|
|
||||||
/// in die Nachricht serialisiert werden darf)
|
|
||||||
/// </summary>
|
|
||||||
private static Message GetSendMessage(Message.NotificationClass notificationClass)
|
|
||||||
{
|
|
||||||
Message result = null;
|
|
||||||
|
|
||||||
if (noteMessageDict.ContainsKey(notificationClass))
|
|
||||||
{
|
|
||||||
if (noteMessageDict[notificationClass].InternalStatus == Message.BSMDStatus.TOSEND)
|
|
||||||
{
|
|
||||||
// "leere" Nachrichten mit Listenelementen ausfiltern!
|
|
||||||
if (Message.IsListClass(notificationClass) && (noteMessageDict[notificationClass].Elements.Count == 0))
|
|
||||||
{
|
|
||||||
_log.DebugFormat("skipping empty list class {0},", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
|
||||||
noteMessageDict[notificationClass].StatusInfo = "Meldeklasse ist leer";
|
|
||||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SUSPENDED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!XtraSendLogic.ShouldSendMessage(noteMessageDict[notificationClass]))
|
|
||||||
{
|
|
||||||
_log.DebugFormat("skipping {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
|
||||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SUSPENDED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_log.DebugFormat("preparing {0}", noteMessageDict[notificationClass].MessageNotificationClassDisplay);
|
|
||||||
noteMessageDict[notificationClass].StatusInfo = "";
|
|
||||||
noteMessageDict[notificationClass].ChangedBy = ""; // Leeren nach RS mit CH: Sie möchte das Feld als Indikator "zu versenden" verwenden (ich war dagegen ;-)
|
|
||||||
noteMessageDict[notificationClass].InternalStatus = Message.BSMDStatus.SENT;
|
|
||||||
noteMessageDict[notificationClass].SentAt = DateTime.Now;
|
|
||||||
DBManager.Instance.DeleteSystemErrors(noteMessageDict[notificationClass]);
|
|
||||||
result = noteMessageDict[notificationClass];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DBManager.Instance.Save(noteMessageDict[notificationClass]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool? CreateSendFile(MessageCore core, List<Message> messages, bool useTest)
|
|
||||||
{
|
{
|
||||||
bool? retval = null;
|
bool? retval = null;
|
||||||
bool containsData = false;
|
|
||||||
|
|
||||||
// dieses Dict wird benötigt, da die Meldeklassen in der richtigen Reihenfolge hinzugefügt werden müssen
|
|
||||||
Request.noteMessageDict.Clear();
|
|
||||||
foreach (Message message in messages)
|
|
||||||
noteMessageDict[message.MessageNotificationClass] = message;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -203,16 +151,12 @@ namespace bsmd.hisnord
|
|||||||
_nsw.conveyance.ItemsElementName[2] = ItemsChoiceType.PortOfCall;
|
_nsw.conveyance.ItemsElementName[2] = ItemsChoiceType.PortOfCall;
|
||||||
_nsw.conveyance.Items[3] = core.IsTransit ? core.ETAKielCanal : core.ETA; // TODO Datum konvertieren?
|
_nsw.conveyance.Items[3] = core.IsTransit ? core.ETAKielCanal : core.ETA; // TODO Datum konvertieren?
|
||||||
_nsw.conveyance.ItemsElementName[3] = ItemsChoiceType.ETAPortOfCall;
|
_nsw.conveyance.ItemsElementName[3] = ItemsChoiceType.ETAPortOfCall;
|
||||||
containsData = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region NSW message area
|
#region NSW message area
|
||||||
|
|
||||||
Message visitTransitHeader = null;
|
|
||||||
Message message = null;
|
|
||||||
|
|
||||||
// wir wissen noch nicht wieviele es werden, von daher erstmal eine Liste!
|
// wir wissen noch nicht wieviele es werden, von daher erstmal eine Liste!
|
||||||
List<Items1ChoiceType> items1ChoiceType = new List<Items1ChoiceType>();
|
List<Items1ChoiceType> items1ChoiceType = new List<Items1ChoiceType>();
|
||||||
List<object> items1 = new List<object>();
|
List<object> items1 = new List<object>();
|
||||||
@ -222,32 +166,15 @@ namespace bsmd.hisnord
|
|||||||
// nur das "STORNO" Element hinzufügen
|
// nur das "STORNO" Element hinzufügen
|
||||||
items1ChoiceType.Add(Items1ChoiceType.STORNO);
|
items1ChoiceType.Add(Items1ChoiceType.STORNO);
|
||||||
items1.Add(ytype.Y);
|
items1.Add(ytype.Y);
|
||||||
containsData = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!core.IsTransit)
|
|
||||||
{
|
|
||||||
message = GetSendMessage(Message.NotificationClass.VISIT);
|
|
||||||
if (message != null)
|
|
||||||
|
|
||||||
visitTransitHeader = message;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
message = GetSendMessage(Message.NotificationClass.TRANSIT);
|
|
||||||
if (message != null)
|
|
||||||
|
|
||||||
visitTransitHeader = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region STAT
|
#region STAT
|
||||||
message = GetSendMessage(Message.NotificationClass.STAT);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.STAT)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_STAT);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_STAT);
|
||||||
@ -290,10 +217,9 @@ namespace bsmd.hisnord
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region NOA_NOD
|
#region NOA_NOD
|
||||||
message = GetSendMessage(Message.NotificationClass.NOA_NOD);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_NOANOD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_NOANOD);
|
||||||
@ -345,13 +271,10 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ATA/ATD
|
#region ATA / ATD
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.ATA);
|
if (message.MessageNotificationClass == Message.NotificationClass.ATA)
|
||||||
|
|
||||||
if (message != null)
|
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_ATA);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_ATA);
|
||||||
@ -365,14 +288,11 @@ namespace bsmd.hisnord
|
|||||||
items1ChoiceType.Add(Items1ChoiceType.ATA);
|
items1ChoiceType.Add(Items1ChoiceType.ATA);
|
||||||
items1.Add(ata.ATAPortOfCall);
|
items1.Add(ata.ATAPortOfCall);
|
||||||
}
|
}
|
||||||
}
|
} }
|
||||||
}
|
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.ATD);
|
|
||||||
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.ATD)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_ATD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_ATD);
|
||||||
@ -392,10 +312,9 @@ namespace bsmd.hisnord
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region POBA
|
#region POBA
|
||||||
message = GetSendMessage(Message.NotificationClass.POBA);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.POBA)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_POBA);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_POBA);
|
||||||
@ -418,13 +337,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region POBD
|
#region POBD
|
||||||
message = GetSendMessage(Message.NotificationClass.POBD);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.POBD)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_POBD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_POBD);
|
||||||
@ -447,13 +366,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region NAME
|
#region NAME
|
||||||
message = GetSendMessage(Message.NotificationClass.NAME);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.NAME)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_NameOfMaster);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_NameOfMaster);
|
||||||
@ -469,13 +388,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region TIEFA
|
#region TIEFA / TIEFD
|
||||||
message = GetSendMessage(Message.NotificationClass.TIEFA);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.TIEFA)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_TIEFA);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_TIEFA);
|
||||||
@ -496,10 +415,8 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.TIEFD);
|
if (message.MessageNotificationClass == Message.NotificationClass.TIEFD)
|
||||||
if (message != null)
|
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_TIEFD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_TIEFD);
|
||||||
@ -522,10 +439,9 @@ namespace bsmd.hisnord
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region INFO
|
#region INFO
|
||||||
message = GetSendMessage(Message.NotificationClass.INFO);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.INFO)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_INFO);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_INFO);
|
||||||
@ -560,14 +476,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region BKRA/BKRD
|
#region BKRA / BKRD
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.BKRA);
|
if (message.MessageNotificationClass == Message.NotificationClass.BKRA)
|
||||||
|
{
|
||||||
if (message != null) {
|
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_BKRA);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_BKRA);
|
||||||
@ -590,12 +505,10 @@ namespace bsmd.hisnord
|
|||||||
items1.Add(hn_bkra);
|
items1.Add(hn_bkra);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.BKRD);
|
if (message.MessageNotificationClass == Message.NotificationClass.BKRD)
|
||||||
if (message != null) {
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_BKRD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_BKRD);
|
||||||
@ -622,12 +535,10 @@ namespace bsmd.hisnord
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region HAZ
|
#region HAZA / HAZD
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.HAZA);
|
if (message.MessageNotificationClass == Message.NotificationClass.HAZA)
|
||||||
if (message != null)
|
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_HAZA);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_HAZA);
|
||||||
@ -688,10 +599,8 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.HAZD);
|
if (message.MessageNotificationClass == Message.NotificationClass.HAZD)
|
||||||
if (message != null)
|
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_HAZD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_HAZD);
|
||||||
@ -754,10 +663,9 @@ namespace bsmd.hisnord
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region LADG
|
#region LADG
|
||||||
message = GetSendMessage(Message.NotificationClass.LADG);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.LADG)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_LADG);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_LADG);
|
||||||
@ -794,13 +702,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SERV
|
#region SERV
|
||||||
message = GetSendMessage(Message.NotificationClass.SERV);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.SERV)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_SERV);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_SERV);
|
||||||
@ -827,13 +735,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PRE72H
|
#region PRE72H
|
||||||
message = GetSendMessage(Message.NotificationClass.PRE72H);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.PRE72H)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_PRE72H);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_PRE72H);
|
||||||
@ -876,13 +784,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SEC
|
#region SEC
|
||||||
message = GetSendMessage(Message.NotificationClass.SEC);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.SEC)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_SEC);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_SEC);
|
||||||
@ -1040,13 +948,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region MDH
|
#region MDH
|
||||||
message = GetSendMessage(Message.NotificationClass.MDH);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.MDH)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_MDH);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_MDH);
|
||||||
@ -1204,13 +1112,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region WAS
|
#region WAS
|
||||||
message = GetSendMessage(Message.NotificationClass.WAS);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.WAS)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_WAS);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_WAS);
|
||||||
@ -1309,10 +1217,9 @@ namespace bsmd.hisnord
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region BPOL
|
#region BPOL
|
||||||
message = GetSendMessage(Message.NotificationClass.BPOL);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.BPOL)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_BPOL);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_BPOL);
|
||||||
@ -1345,13 +1252,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PAS
|
#region PAS
|
||||||
message = GetSendMessage(Message.NotificationClass.PAS);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.PAS)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_PAS);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_PAS);
|
||||||
@ -1394,12 +1301,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region CREW
|
#region CREW
|
||||||
message = GetSendMessage(Message.NotificationClass.CREW);
|
|
||||||
if (message != null) {
|
if (message.MessageNotificationClass == Message.NotificationClass.CREW)
|
||||||
containsData = true;
|
{
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_CREW);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_CREW);
|
||||||
@ -1436,13 +1344,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region TOWA/TOWD
|
#region TOWA / TOWD
|
||||||
message = GetSendMessage(Message.NotificationClass.TOWA);
|
|
||||||
if (message != null)
|
if (message.MessageNotificationClass == Message.NotificationClass.TOWA)
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_TOWA);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_TOWA);
|
||||||
@ -1504,10 +1412,8 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.TOWD);
|
if (message.MessageNotificationClass == Message.NotificationClass.TOWD)
|
||||||
if (message != null)
|
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_TOWD);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_TOWD);
|
||||||
@ -1565,15 +1471,13 @@ namespace bsmd.hisnord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region AGNT
|
#region AGNT
|
||||||
|
|
||||||
message = GetSendMessage(Message.NotificationClass.AGNT);
|
if (message.MessageNotificationClass == Message.NotificationClass.AGNT)
|
||||||
|
|
||||||
if (message != null)
|
|
||||||
{
|
{
|
||||||
containsData = true;
|
|
||||||
if (message.Reset)
|
if (message.Reset)
|
||||||
{
|
{
|
||||||
items1ChoiceType.Add(Items1ChoiceType.RESET_AGNT);
|
items1ChoiceType.Add(Items1ChoiceType.RESET_AGNT);
|
||||||
@ -1613,27 +1517,27 @@ namespace bsmd.hisnord
|
|||||||
|
|
||||||
#region serialize and save message
|
#region serialize and save message
|
||||||
|
|
||||||
if (containsData)
|
|
||||||
|
string outputDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot,
|
||||||
|
Properties.Settings.Default.OutputDir);
|
||||||
|
|
||||||
|
string filename = string.Format("BSMD_{1}-{2}-{0}.xml", message.MessageNotificationClassDisplay, DateTime.Now.ToString("yyyyMMddHHmmss"), core.Id.Value);
|
||||||
|
_log.InfoFormat("saving {0} to output directory", filename);
|
||||||
|
|
||||||
|
string filePath = Path.Combine(outputDir, filename);
|
||||||
|
XmlSerializer serializer = new XmlSerializer(typeof(nsw));
|
||||||
|
using (TextWriter tw = new StreamWriter(filePath))
|
||||||
{
|
{
|
||||||
string outputDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot,
|
serializer.Serialize(tw, _nsw);
|
||||||
Properties.Settings.Default.OutputDir);
|
|
||||||
|
|
||||||
string filename = string.Format("BSMD_{0}-{1}.xml", DateTime.Now.ToString("yyyyMMddHHmmss"), core.Id.Value);
|
|
||||||
_log.InfoFormat("saving {0} to output directory", filename);
|
|
||||||
|
|
||||||
string filePath = Path.Combine(outputDir, filename);
|
|
||||||
XmlSerializer serializer = new XmlSerializer(typeof(nsw));
|
|
||||||
using (TextWriter tw = new StreamWriter(filePath))
|
|
||||||
{
|
|
||||||
serializer.Serialize(tw, _nsw);
|
|
||||||
}
|
|
||||||
|
|
||||||
coreFilenameDict[core] = filename;
|
|
||||||
coreUseTestDict[core] = useTest;
|
|
||||||
|
|
||||||
retval = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!coreFilenameDict.ContainsKey(core))
|
||||||
|
coreFilenameDict[core] = new Dictionary<Message, string>();
|
||||||
|
coreFilenameDict[core][message] = filename;
|
||||||
|
|
||||||
|
coreUseTestDict[core] = useTest;
|
||||||
|
retval = true;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1714,7 +1618,8 @@ namespace bsmd.hisnord
|
|||||||
if (pi.GeneralCargoIBCSpecified)
|
if (pi.GeneralCargoIBCSpecified)
|
||||||
pi.GeneralCargoIBC = imdgPosition.GeneralCargoIBC.Value ? yorntype.Y : yorntype.N;
|
pi.GeneralCargoIBC = imdgPosition.GeneralCargoIBC.Value ? yorntype.Y : yorntype.N;
|
||||||
pi.ContainerNumber = imdgPosition.ContainerNumber;
|
pi.ContainerNumber = imdgPosition.ContainerNumber;
|
||||||
pi.VehicleLicenseNumber = imdgPosition.VehicleLicenseNumber;
|
if(!imdgPosition.VehicleLicenseNumber.IsNullOrEmpty())
|
||||||
|
pi.VehicleLicenseNumber = imdgPosition.VehicleLicenseNumber;
|
||||||
if(!imdgPosition.StowagePosition.IsNullOrEmpty())
|
if(!imdgPosition.StowagePosition.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
pi.Item = imdgPosition.StowagePosition;
|
pi.Item = imdgPosition.StowagePosition;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user