diff --git a/ENI2/DetailRootControl.xaml.cs b/ENI2/DetailRootControl.xaml.cs
index 76e5de7f..5f2bb529 100644
--- a/ENI2/DetailRootControl.xaml.cs
+++ b/ENI2/DetailRootControl.xaml.cs
@@ -741,13 +741,7 @@ namespace ENI2
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "No Schengen details", null, "CREWA", crewa.Identifier, "CREWA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
- }
- if(!crewaIsSchengen && crewa.HasSchengenDetails)
- {
- MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "Schengen details but checkbox not set", null, "CREWA", crewa.Identifier, "CREWA");
- mv.MessageGroupName = Properties.Resources.textOverview;
- vViolations.Add(mv);
- }
+ }
}
}
@@ -769,13 +763,7 @@ namespace ENI2
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "No Schengen details", null, "CREWD", crewd.Identifier, "CREWD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
- }
- if (!crewdIsSchengen && crewd.HasSchengenDetails)
- {
- MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V182, "Schengen details but checkbox not set", null, "CREWD", crewd.Identifier, "CREWD");
- mv.MessageGroupName = Properties.Resources.textOverview;
- vViolations.Add(mv);
- }
+ }
}
}
@@ -798,25 +786,13 @@ namespace ENI2
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V202, "No Schengen details", null, "PASA", pasa.Identifier, "PASA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
- }
- if (!pasIsSchengen && pasa.HasSchengenDetails)
- {
- MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V202, "Schengen details but checkbox not set", null, "PASA", pasa.Identifier, "PASA");
- mv.MessageGroupName = Properties.Resources.textOverview;
- vViolations.Add(mv);
- }
+ }
if(pasIsPAX && !pasa.HasPAXDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V203, "No PAX details", null, "PASA", pasa.Identifier, "PASA");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
- }
- if(!pasIsPAX && pasa.HasPAXDetails)
- {
- MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V203, "PAX details but checkbox not set", null, "PASA", pasa.Identifier, "PASA");
- mv.MessageGroupName = Properties.Resources.textOverview;
- vViolations.Add(mv);
- }
+ }
}
}
@@ -839,25 +815,13 @@ namespace ENI2
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V202, "No Schengen details", null, "PASD", pasd.Identifier, "PASD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
- }
- if (!pasdIsSchengen && pasd.HasSchengenDetails)
- {
- MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V202, "Schengen details but checkbox not set", null, "PASD", pasd.Identifier, "PASD");
- mv.MessageGroupName = Properties.Resources.textOverview;
- vViolations.Add(mv);
- }
+ }
if (pasdIsPAX && !pasd.HasPAXDetails)
{
MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V203, "No PAX details", null, "PASD", pasd.Identifier, "PASD");
mv.MessageGroupName = Properties.Resources.textOverview;
vViolations.Add(mv);
- }
- if (!pasdIsPAX && pasd.HasPAXDetails)
- {
- MessageViolation mv = RuleEngine.CreateViolation(ValidationCode.V203, "PAX details but checkbox not set", null, "PASD", pasd.Identifier, "PASD");
- mv.MessageGroupName = Properties.Resources.textOverview;
- vViolations.Add(mv);
- }
+ }
}
}
diff --git a/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml b/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml
index d8f54db7..a5937371 100644
--- a/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml
+++ b/ENI2/DetailViewControls/BorderPoliceDetailControl.xaml
@@ -83,7 +83,7 @@
-
+
diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
index b0e5aa51..a69af06e 100644
--- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
+++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs
@@ -692,52 +692,6 @@ namespace ENI2.DetailViewControls
}
}
- /* obsolete, da PDF jetzt lokal erzeugt werden können..
- *
- private void buttonCreatePDF_Click(object sender, RoutedEventArgs e)
- {
- bool cannotCreateReport = false;
-
- for (int i = 0; i < this.Messages.Count; i++)
- {
- Message selectedMessage = this.Messages[i];
-
- // 28.3. Diese Nachrichten sollten dabei nicht geprüft werden.. immer diese Spezialfälle
- if ((selectedMessage.MessageNotificationClass == Message.NotificationClass.VISIT) ||
- (selectedMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
- (selectedMessage.MessageNotificationClass == Message.NotificationClass.CREWD) ||
- (selectedMessage.MessageNotificationClass == Message.NotificationClass.PASD) ||
- (selectedMessage.MessageNotificationClass == Message.NotificationClass.STO)) continue;
-
- if ((selectedMessage.InternalStatus == Message.BSMDStatus.SENT) || (selectedMessage.InternalStatus == Message.BSMDStatus.TOSEND))
- {
- cannotCreateReport = true;
- break;
- }
- }
-
- if (cannotCreateReport)
- {
- MessageBox.Show("Cannot create report: some messages still in status TOSEND / SENT", Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Exclamation);
- return;
- }
-
- for (int i = 0; i < this.dataGridMessages.SelectedItems.Count; i++)
- {
- Message selectedMessage = this.dataGridMessages.SelectedItems[i] as Message;
- selectedMessage.LastStatus = selectedMessage.InternalStatus;
- selectedMessage.InternalStatus = Message.BSMDStatus.REPORT;
- selectedMessage.ReportingPartyId = App.UserId; // wichtig damit der Richtige(!) die Mail mit dem PDF bekommt
- DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(selectedMessage);
- }
-
-
- this.Core.ReportStatus = MessageCore.ReportStatusEnum.SINGLE;
- DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(this.Core);
- this.dataGridMessages.Items.Refresh();
- }
- */
-
private void buttonSystemErrors_Click(object sender, RoutedEventArgs e)
{
if (this.dataGridMessages.SelectedItems.Count > 0)
diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml b/ENI2/DetailViewControls/WasteDetailControl.xaml
index 08d06950..2db7b34d 100644
--- a/ENI2/DetailViewControls/WasteDetailControl.xaml
+++ b/ENI2/DetailViewControls/WasteDetailControl.xaml
@@ -146,6 +146,7 @@
+
+
+
+
+
+
+
+
+ AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="2">
-
+
+
diff --git a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
index 42c366df..9afd3621 100644
--- a/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
+++ b/ENI2/DetailViewControls/WasteDetailControl.xaml.cs
@@ -64,6 +64,7 @@ namespace ENI2.DetailViewControls
private void buttonAddMissingEntries_Click(object sender, RoutedEventArgs e)
{
+ // TODO: Das muss noch für NSW 7.0 gefixt werden, alles doppelt etc.
this._was.AddMissingWaste();
if(this._was.Waste.Count < 15)
{
@@ -77,7 +78,7 @@ namespace ENI2.DetailViewControls
WasteDescription = "",
WasteDisposalAmount_MTQ = 0,
WasteDisposalPort = "ZZUKN",
- WasteDisposedAtLastPort_MTQ = 0
+ WasteDisposedAtLastPort_MTQ = 0
};
this._was.Waste.Add(newWaste);
}
@@ -86,6 +87,13 @@ namespace ENI2.DetailViewControls
this.dataGridWaste.Items.Refresh();
}
+ private void buttonWasteReceivedAddMissingEntries_Click(object sender, RoutedEventArgs e)
+ {
+ this._selectedWAS_RCPT.AddMissingWasteReceived();
+ this.SublistElementChanged(Message.NotificationClass.WAS_RCPT);
+ this.dataGridWasteReceived.Items.Refresh();
+ }
+
public override void Initialize()
{
base.Initialize();
@@ -153,7 +161,7 @@ namespace ENI2.DetailViewControls
#endregion
- }
+ }
#region Waste receipt grid event handler
@@ -526,6 +534,7 @@ namespace ENI2.DetailViewControls
}
#endregion
-
+
+
}
}
diff --git a/ENI2/ENI2.csproj b/ENI2/ENI2.csproj
index f273719a..58549339 100644
--- a/ENI2/ENI2.csproj
+++ b/ENI2/ENI2.csproj
@@ -36,8 +36,8 @@
5.4.0.0
true
publish.html
- 1
- 7.0.0.1
+ 2
+ 7.0.0.2
false
true
true
diff --git a/ENI2/EditControls/EditCREWDialog.xaml b/ENI2/EditControls/EditCREWDialog.xaml
index 4f693102..d22fe2f8 100644
--- a/ENI2/EditControls/EditCREWDialog.xaml
+++ b/ENI2/EditControls/EditCREWDialog.xaml
@@ -39,7 +39,7 @@
-
+
@@ -63,6 +63,6 @@
-
+
diff --git a/ENI2/EditControls/EditCREWDialog.xaml.cs b/ENI2/EditControls/EditCREWDialog.xaml.cs
index 889b7955..ae90b998 100644
--- a/ENI2/EditControls/EditCREWDialog.xaml.cs
+++ b/ENI2/EditControls/EditCREWDialog.xaml.cs
@@ -32,7 +32,7 @@ namespace ENI2.EditControls
this.textBoxFirstName.Text = this.CREW.CrewMemberFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
- this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender.HasValue ? this.CREW.CrewMemberGender.Value : -1;
+ this.comboBoxGender.SelectedIndex = this.CREW.CrewMemberGender ?? -1;
this.textBoxPlaceOfBirth.Text = this.CREW.CrewMemberPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
//this.comboBoxNationality.KeyUp += ComboBox_KeyUp;
@@ -40,7 +40,7 @@ namespace ENI2.EditControls
this.datePickerDateOfBirth.SelectedDate = this.CREW.CrewMemberDateOfBirth;
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeList;
//this.comboBoxIdDocType.KeyUp += ComboBox_KeyUp;
- this.comboBoxIdDocType.SelectedIndex = this.CREW.CrewMemberIdentityDocumentType.HasValue ? this.CREW.CrewMemberIdentityDocumentType.Value : -1;
+ this.comboBoxIdDocType.SelectedIndex = this.CREW.CrewMemberIdentityDocumentType ?? -1;
this.textBoxIdDocNumber.Text = this.CREW.CrewMemberIdentityDocumentId;
this.textBoxVisaNumber.Text = this.CREW.CrewMemberVisaNumber;
this.comboBoxIssuingState.ItemsSource = bsmd.database.CREW.NationalityDict;
@@ -48,7 +48,7 @@ namespace ENI2.EditControls
this.datePickerExpiryDate.SelectedDate = this.CREW.CrewMemberIdentityDocumentExpiryDate;
this.comboBoxCountryOfBirth.ItemsSource = bsmd.database.CREW.NationalityDict;
this.comboBoxCountryOfBirth.SelectedValue = this.CREW.CrewMemberCountryOfBirth;
- this.textBoxEffects.Text = this.CREW.Effects;
+ // this.textBoxEffects.Text = this.CREW.Effects;
this.OKClicked += EditCREWDialog_OKClicked;
this.AddVisible = true;
}
@@ -69,7 +69,7 @@ namespace ENI2.EditControls
this.CREW.CrewMemberIdentityDocumentIssuingState = (this.comboBoxIssuingState.SelectedValue == null) ? "" : (string)this.comboBoxIssuingState.SelectedValue;
this.CREW.CrewMemberIdentityDocumentExpiryDate = this.datePickerExpiryDate.SelectedDate;
this.CREW.CrewMemberCountryOfBirth = (this.comboBoxCountryOfBirth.SelectedValue == null) ? "" : (string)this.comboBoxCountryOfBirth.SelectedValue;
- this.CREW.Effects = this.textBoxEffects.Text.Trim();
+ // this.CREW.Effects = this.textBoxEffects.Text.Trim();
}
private void EditCREWDialog_OKClicked()
diff --git a/ENI2/EditControls/EditPasDialog.xaml.cs b/ENI2/EditControls/EditPasDialog.xaml.cs
index 5fd8d4ef..0daa8960 100644
--- a/ENI2/EditControls/EditPasDialog.xaml.cs
+++ b/ENI2/EditControls/EditPasDialog.xaml.cs
@@ -31,7 +31,7 @@ namespace ENI2.EditControls
this.textBoxFirstName.Text = this.PAS.PassengerFirstName;
this.comboBoxGender.ItemsSource = GlobalStructures.GenderList;
//this.comboBoxGender.KeyUp += ComboBox_KeyUp;
- this.comboBoxGender.SelectedIndex = this.PAS.PassengerGender.HasValue ? this.PAS.PassengerGender.Value : -1;
+ this.comboBoxGender.SelectedIndex = this.PAS.PassengerGender ?? -1;
this.textBoxPlaceOfBirth.Text = this.PAS.PassengerPlaceOfBirth;
this.comboBoxNationality.ItemsSource = bsmd.database.CREW.NationalityDict;
//this.comboBoxNationality.KeyUp += ComboBox_KeyUp;
@@ -39,7 +39,7 @@ namespace ENI2.EditControls
this.datePickerDateOfBirth.SelectedDate = this.PAS.PassengerDateOfBirth;
this.comboBoxIdDocType.ItemsSource = GlobalStructures.IDDocTypeList;
//this.comboBoxIdDocType.KeyUp += ComboBox_KeyUp;
- this.comboBoxIdDocType.SelectedIndex = this.PAS.PassengerIdentityDocumentType.HasValue ? this.PAS.PassengerIdentityDocumentType.Value : -1;
+ this.comboBoxIdDocType.SelectedIndex = this.PAS.PassengerIdentityDocumentType ?? -1;
this.textBoxIdDocNumber.Text = this.PAS.PassengerIdentityDocumentId;
this.textBoxVisaNumber.Text = this.PAS.PassengerVisaNumber;
this.locodePortOfEmbarkation.LocodeValue = this.PAS.PassengerPortOfEmbarkation;
diff --git a/ENI2/EditControls/EditWasteReceiptDialog.xaml b/ENI2/EditControls/EditWasteReceiptDialog.xaml
index 2581dae9..c44e7399 100644
--- a/ENI2/EditControls/EditWasteReceiptDialog.xaml
+++ b/ENI2/EditControls/EditWasteReceiptDialog.xaml
@@ -32,10 +32,10 @@
-
-
-
-
+
+
+
+
diff --git a/ENI2/EditControls/SelectImportClassesDialog.xaml.cs b/ENI2/EditControls/SelectImportClassesDialog.xaml.cs
index 2d8e566c..7ecaa351 100644
--- a/ENI2/EditControls/SelectImportClassesDialog.xaml.cs
+++ b/ENI2/EditControls/SelectImportClassesDialog.xaml.cs
@@ -46,9 +46,7 @@ namespace ENI2.EditControls
(aMessage.MessageNotificationClass == Message.NotificationClass.TRANSIT) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATA) ||
(aMessage.MessageNotificationClass == Message.NotificationClass.ATD) ||
- (aMessage.MessageNotificationClass == Message.NotificationClass.CREWD) ||
- (aMessage.MessageNotificationClass == Message.NotificationClass.STO) ||
- (aMessage.MessageNotificationClass == Message.NotificationClass.PASD)
+ (aMessage.MessageNotificationClass == Message.NotificationClass.STO)
) continue;
if (IsTransit &&
@@ -103,7 +101,7 @@ namespace ENI2.EditControls
protected void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
+ }
}
private void buttonAll_Click(object sender, RoutedEventArgs e)
diff --git a/ENI2/EditControls/VisitIdDialog.xaml.cs b/ENI2/EditControls/VisitIdDialog.xaml.cs
index 72ac4f44..7c785d9b 100644
--- a/ENI2/EditControls/VisitIdDialog.xaml.cs
+++ b/ENI2/EditControls/VisitIdDialog.xaml.cs
@@ -29,12 +29,12 @@ namespace ENI2.EditControls
this.OKClicked += VisitIdDialog_OKClicked;
List> comboDataSource = new List>()
{
- new KeyValuePair( Message.NSWProvider.DBH, "DBH" ),
- new KeyValuePair( Message.NSWProvider.DUDR, "HIS-Nord" ),
+ new KeyValuePair( Message.NSWProvider.DBH, "DBH" ),
+ new KeyValuePair( Message.NSWProvider.DUDR, "HIS-Nord" ),
};
this.comboBoxInitialHIS.ItemsSource = comboDataSource;
- this.comboBoxInitialHIS.SelectedIndex = 2;
+ this.comboBoxInitialHIS.SelectedIndex = 1;
this.EnableOK(false);
this.locodePoC.PropertyChanged += LocodePoC_PropertyChanged;
diff --git a/ENI2/Excel/ExcelReader.cs b/ENI2/Excel/ExcelReader.cs
index 0b4f47c2..a435926e 100644
--- a/ENI2/Excel/ExcelReader.cs
+++ b/ENI2/Excel/ExcelReader.cs
@@ -111,18 +111,18 @@ namespace ENI2.Excel
result = 0;
}
else if (val.Equals("f", StringComparison.CurrentCultureIgnoreCase) || val.Equals("female", StringComparison.CurrentCultureIgnoreCase))
- {
+ {
result = 1;
}
else
{
- result = 2;
+ result = 2;
}
}
if(result == null)
{
_log.ErrorFormat("error reading gender on {0}", lookup);
- }
+ }
return result;
}
@@ -251,8 +251,11 @@ namespace ENI2.Excel
if(val!= null)
{
if (val == "I") result = 1;
+ if (val == "1") result = 1;
if (val == "II") result = 2;
+ if (val == "2") result = 2;
if (val == "III") result = 3;
+ if (val == "3") result = 3;
if (val.Equals("NONE", StringComparison.OrdinalIgnoreCase)) result = 0;
}
diff --git a/ENI2/Excel/ExcelUtil.cs b/ENI2/Excel/ExcelUtil.cs
index 0978c85f..c9fa32ba 100644
--- a/ENI2/Excel/ExcelUtil.cs
+++ b/ENI2/Excel/ExcelUtil.cs
@@ -366,7 +366,7 @@ namespace ENI2.Excel
if (shipClass.Contains('2')) haza.INFShipClass = 1;
if (shipClass.Contains('3')) haza.INFShipClass = 2;
}
-
+
#region IMDG
for (int i = 1; i <= 10; i++)
@@ -918,7 +918,7 @@ namespace ENI2.Excel
#region INFO
private static bool ScanINFO(Message infoMessage, ExcelReader reader)
- {
+ {
if(infoMessage.Elements.Count == 0)
{
INFO newINFO = new INFO();
@@ -928,6 +928,12 @@ namespace ENI2.Excel
INFO info = infoMessage.Elements[0] as INFO;
ExcelUtil.ScanMessage(info, reader);
+ string portArea = reader.ReadText("INFO.PortArea")?.ToUpper();
+ if (!portArea.IsNullOrEmpty() && DBManager.Instance.GetPortAreaDict().ContainsKey(portArea))
+ info.PortArea = portArea;
+ else
+ info.PortArea = "";
+
info.ShippingArea = reader.ReadShippingArea("INFO.ShippingArea"); // enum read func
bool? fumigatedBulkCargo = reader.ReadBoolean("INFO.FumigatedBulkCargo");
info.FumigatedBulkCargo = (byte) ((fumigatedBulkCargo ?? false) ? 1 : 0);
@@ -1254,13 +1260,13 @@ namespace ENI2.Excel
string wasrcpt_delToDate = string.Format("WAS_RCPT.WasteDeliveryReceipt_{0}.WasteDeliveryDateToDate", i);
string wasrcpt_delToTime = string.Format("WAS_RCPT.WasteDeliveryReceipt_{0}.WasteDeliveryDateToTime", i);
- if (!(was_rcptMessage.GetSublistElementWithIdentifier((i).ToString()) is WAS_RCPT wasr))
+ if (!(was_rcptMessage.GetSublistElementWithIdentifier(i.ToString()) is WAS_RCPT wasr))
{
wasr = new WAS_RCPT();
- wasr.Identifier = (i).ToString();
+ wasr.Identifier = i.ToString();
wasr.MessageHeader = was_rcptMessage;
was_rcptMessage.Elements.Add(wasr);
- }
+ }
else
{
wasr.DeleteElements();
@@ -1271,7 +1277,7 @@ namespace ENI2.Excel
wasr.PortReceptionFacilityProviderName = reader.ReadText(wasrcpt_portreceptFacilityProviderName);
string treatmentFacility = reader.ReadText(wasrcpt_treatmentFacility);
if(!treatmentFacility.IsNullOrEmpty())
- {
+ {
TreatmentFacilityProvider tfp = new TreatmentFacilityProvider();
tfp.WAS_RCPT = wasr;
tfp.Identifier = "1";
@@ -1293,9 +1299,10 @@ namespace ENI2.Excel
wasr.WasteReceived.Add(wr);
wr.Identifier = j.ToString();
- wr.WasteCode = reader.ReadText(wtype);
+ wr.WasteCode = reader.ReadText(wtype); // hier muss immer was stehen, ist ein festes Beschreibungsfeld
wr.WasteDescription = reader.ReadText(wDescr);
wr.AmountWasteReceived_MTQ = reader.ReadNumber(wAmount);
+ if (!wr.AmountWasteReceived_MTQ.HasValue) wr.AmountWasteReceived_MTQ = 0; // Default ist 0, nicht nix ;-)
}
// only add message when an identification number was given
diff --git a/ENI2/Util/UIHelper.cs b/ENI2/Util/UIHelper.cs
index f8535e19..1cabf66b 100644
--- a/ENI2/Util/UIHelper.cs
+++ b/ENI2/Util/UIHelper.cs
@@ -86,6 +86,7 @@ namespace ENI2.Util
aMessage.ENINotificationDetailIndex = 2;
break;
case Message.NotificationClass.WAS:
+ case Message.NotificationClass.WAS_RCPT:
aMessage.ENINotificationIconString = "../Resources/garbage.png";
aMessage.ENINotificationDetailGroup = Properties.Resources.textWaste;
aMessage.ENINotificationDetailIndex = 3;
@@ -129,6 +130,8 @@ namespace ENI2.Util
case Message.NotificationClass.BPOL:
case Message.NotificationClass.CREW:
case Message.NotificationClass.PAS:
+ case Message.NotificationClass.CREWD:
+ case Message.NotificationClass.PASD:
aMessage.ENINotificationIconString = "../Resources/policeman_german.png";
aMessage.ENINotificationDetailGroup = Properties.Resources.textBorderPolice;
aMessage.ENINotificationDetailIndex = 10;
diff --git a/SQL/Update_6.x_To_7.0.sql b/SQL/Update_6.x_To_7.0.sql
index bfeeb9a3..584a34ad 100644
--- a/SQL/Update_6.x_To_7.0.sql
+++ b/SQL/Update_6.x_To_7.0.sql
@@ -136,4 +136,11 @@ GO
ALTER TABLE [dbo].[PAS]
ADD [PassengerCountryOfBirth] NCHAR (2) NULL;
+GO
+
+PRINT N'Altering Table [dbo].[WAS_RCPT]...';
+GO
+ALTER TABLE [dbo].[WAS_RCPT]
+ ADD [Identifier] NVARCHAR (50) NULL;
+
GO
\ No newline at end of file
diff --git a/bsmd.database/DBManager.cs b/bsmd.database/DBManager.cs
index 9b2aaee3..4de5b40a 100644
--- a/bsmd.database/DBManager.cs
+++ b/bsmd.database/DBManager.cs
@@ -427,7 +427,7 @@ namespace bsmd.database
List portAreas = pa.LoadList(reader);
DBManager.allPortAreas = new Dictionary();
foreach (PortArea aPa in portAreas)
- DBManager.allPortAreas.Add(aPa.Locode + aPa.Code, aPa);
+ DBManager.allPortAreas.Add(aPa.Locode + aPa.Code, aPa);
}
return DBManager.allPortAreas;
}
diff --git a/bsmd.database/WAS.cs b/bsmd.database/WAS.cs
index bcd88c6c..58183261 100644
--- a/bsmd.database/WAS.cs
+++ b/bsmd.database/WAS.cs
@@ -22,6 +22,9 @@ namespace bsmd.database
[JsonConverter(typeof(NoTypeConverterJsonConverter))]
public class WAS : DatabaseEntity, ISublistContainer
{
+
+ private static Dictionary _wasteCodeDict = null;
+
public WAS()
{
this.tablename = "[dbo].[WAS]";
@@ -83,6 +86,20 @@ namespace bsmd.database
"Passively fished waste"
};
+ public static Dictionary WasteCodeDict
+ {
+ get
+ {
+ if(_wasteCodeDict == null)
+ {
+ _wasteCodeDict = new Dictionary();
+ for (int i = 0; i < WasteCodes.Length; i++)
+ _wasteCodeDict.Add(WasteCodes[i], WasteCodeDescriptions[i]);
+ }
+ return _wasteCodeDict;
+ }
+ }
+
[ShowReport]
[ENI2Validation]
public bool? WasteDisposalValidExemption { get; set; }
diff --git a/bsmd.database/WAS_RCPT.cs b/bsmd.database/WAS_RCPT.cs
index 881990eb..2507e6c0 100644
--- a/bsmd.database/WAS_RCPT.cs
+++ b/bsmd.database/WAS_RCPT.cs
@@ -113,6 +113,38 @@ namespace bsmd.database
#endregion
+ #region public methods
+
+ public void AddMissingWasteReceived()
+ {
+ foreach (string wasteCode in WAS.WasteCodes)
+ {
+ WasteReceived foundWasteReceived = null;
+ foreach (WasteReceived wasteReceived in this.WasteReceived)
+ {
+ if (!wasteReceived.WasteCode.IsNullOrEmpty() && wasteReceived.WasteCode.Equals(wasteCode))
+ {
+ foundWasteReceived = wasteReceived;
+ break;
+ }
+ }
+ if (foundWasteReceived == null)
+ {
+ WasteReceived newWasteReceived = new WasteReceived
+ {
+ Identifier = DatabaseEntity.GetNewIdentifier(this.WasteReceived),
+ WAS_RCPT = this,
+ WasteDescription = "-",
+ AmountWasteReceived_MTQ = 0,
+ WasteCode = wasteCode
+ };
+ this.WasteReceived.Add(newWasteReceived);
+ }
+ }
+ }
+
+ #endregion
+
#region ISublistContainer implementation
public ISublistElement GetSublistElementWithIdentifier(string identifier)
@@ -182,20 +214,21 @@ namespace bsmd.database
scmd.Parameters.AddWithNullableValue("@P4", this.PortReceptionFacilityProviderName);
scmd.Parameters.AddWithNullableValue("@P5", this.WasteDeliveryDateFrom);
scmd.Parameters.AddWithNullableValue("@P6", this.WasteDeliveryDateTo);
+ scmd.Parameters.AddWithNullableValue("@P7", this.Identifier);
if (this.IsNew)
{
this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, IdentificationNumber, " +
- "PortReceptionFacilityName, PortReceptionFacilityProviderName, WasteDeliveryDateFrom, WasteDeliveryDateTo) " +
- "VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6 )", this.Tablename);
+ "PortReceptionFacilityName, PortReceptionFacilityProviderName, WasteDeliveryDateFrom, WasteDeliveryDateTo, Identifier) " +
+ "VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7 )", this.Tablename);
}
else
{
scmd.Parameters.AddWithValue("ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET IdentificationNumber = @P2, PortReceptionFacilityName = @P3, " +
- "PortReceptionFacilityProviderName = @P4, WasteDeliveryDateFrom = @P5, WasteDeliveryDateTo = @P6 " +
+ "PortReceptionFacilityProviderName = @P4, WasteDeliveryDateFrom = @P5, WasteDeliveryDateTo = @P6, Identifier = @P7 " +
"WHERE Id = @ID", this.Tablename);
}
}
@@ -203,7 +236,7 @@ namespace bsmd.database
public override void PrepareLoadCommand(IDbCommand cmd, Message.LoadFilter filter, params object[] criteria)
{
string query = string.Format("SELECT Id, IdentificationNumber, PortReceptionFacilityName, PortReceptionFacilityProviderName, " +
- "WasteDeliveryDateFrom, WasteDeliveryDateTo " +
+ "WasteDeliveryDateFrom, WasteDeliveryDateTo, Identifier " +
"FROM {0} ", this.Tablename);
switch (filter)
@@ -237,6 +270,7 @@ namespace bsmd.database
if (!reader.IsDBNull(3)) was_rcpt.PortReceptionFacilityProviderName = reader.GetString(3);
if (!reader.IsDBNull(4)) was_rcpt.WasteDeliveryDateFrom = reader.GetDateTime(4);
if (!reader.IsDBNull(5)) was_rcpt.WasteDeliveryDateTo = reader.GetDateTime(5);
+ if (!reader.IsDBNull(6)) was_rcpt.Identifier = reader.GetString(6);
result.Add(was_rcpt);
}
@@ -315,4 +349,4 @@ namespace bsmd.database
#endregion
}
-}
+}
\ No newline at end of file
diff --git a/bsmd.database/WasteReceived.cs b/bsmd.database/WasteReceived.cs
index 04306840..116349b6 100644
--- a/bsmd.database/WasteReceived.cs
+++ b/bsmd.database/WasteReceived.cs
@@ -42,6 +42,15 @@ namespace bsmd.database
[ENI2Validation]
public string WasteCode { get; set; }
+ [JsonIgnore]
+ public string WasteTypeDisplayGrid
+ {
+ get
+ {
+ return string.Format("{0} {1}", WasteCode, WAS.WasteCodeDict[WasteCode]);
+ }
+ }
+
[ShowReport]
[MaxLength(256)]
[ENI2Validation]
diff --git a/bsmd.hisnord/Request.cs b/bsmd.hisnord/Request.cs
index 92ff805e..d55afdf5 100644
--- a/bsmd.hisnord/Request.cs
+++ b/bsmd.hisnord/Request.cs
@@ -425,7 +425,7 @@ namespace bsmd.hisnord
if (tiefa.DraughtUponArrival_DMT.HasValue)
{
items1ChoiceType.Add(Items1ChoiceType.TIEFA);
- items1.Add((float)tiefa.DraughtUponArrival_DMT.Value);
+ items1.Add((decimal)tiefa.DraughtUponArrival_DMT.Value);
}
}
}
@@ -447,7 +447,7 @@ namespace bsmd.hisnord
if (tiefd.DraughtUponDeparture_DMT.HasValue)
{
items1ChoiceType.Add(Items1ChoiceType.TIEFD);
- items1.Add((float)tiefd.DraughtUponDeparture_DMT.Value);
+ items1.Add((decimal)tiefd.DraughtUponDeparture_DMT.Value);
}
}
}