Version 3.7.4: Viele kleinere Korrekturen und Usability Verbesserungen.

This commit is contained in:
Daniel Schick 2017-10-07 11:12:03 +00:00
parent b8c99f2ec6
commit 938b760951
43 changed files with 1017 additions and 615 deletions

View File

@ -209,6 +209,8 @@ namespace ENI2
}
}
}
this.DetailControl_RequestReload();
}
private void SaveMessage(Message message)
@ -243,6 +245,7 @@ namespace ENI2
this.buttonSaveAll.Visibility = Visibility.Hidden;
this.buttonSave.Visibility = Visibility.Hidden;
}
this.DetailControl_RequestReload();
}
private void DetailControl_NotificationClassChanged(Message.NotificationClass notificationClass)

View File

@ -142,27 +142,29 @@ namespace ENI2.DetailViewControls
private void DataGridBKRA_CreateRequested()
{
BRKA brka = new BRKA();
brka.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
EditBKRDialog ebd = new EditBKRDialog();
ebd.BRKA = brka;
ebd.BRKA = new BRKA();
ebd.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
ebd.BRKA.MessageHeader = _bkraMessage;
ebd.IsDeparture = false;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this._bkraMessage.Elements.Add(ebd.BRKA);
ebd.BRKA.MessageHeader = _bkraMessage;
if(!this._bkraMessage.Elements.Contains(ebd.BRKA))
this._bkraMessage.Elements.Add(ebd.BRKA);
this.dataGridBKRA.Items.Refresh();
ebd.BRKA = new BRKA();
ebd.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
ebd.BRKA.MessageHeader = _bkraMessage;
this.SublistElementChanged(Message.NotificationClass.BKRA);
};
if (ebd.ShowDialog() ?? false)
{
brka.MessageHeader = _bkraMessage;
_bkraMessage.Elements.Add(brka);
if(!_bkraMessage.Elements.Contains(ebd.BRKA))
_bkraMessage.Elements.Add(ebd.BRKA);
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);
}
@ -183,30 +185,30 @@ namespace ENI2.DetailViewControls
}
private void DataGridBKRA_EditRequested(DatabaseEntity obj)
{
BRKA brka = obj as BRKA;
if (brka != null)
{
EditBKRDialog eld = new EditBKRDialog();
eld.IsDeparture = false;
eld.BRKA = obj as BRKA;
eld.AddClicked += () =>
{
EditBKRDialog eld = new EditBKRDialog();
eld.IsDeparture = false;
eld.BRKA = brka;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if(!_bkraMessage.Elements.Contains(eld.BRKA))
_bkraMessage.Elements.Add(eld.BRKA);
this.dataGridBKRA.Items.Refresh();
eld.BRKA = new BRKA();
eld.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
eld.BRKA.MessageHeader = _bkraMessage;
this.SublistElementChanged(Message.NotificationClass.BKRA);
};
this.dataGridBKRA.Items.Refresh();
eld.BRKA = new BRKA();
eld.BRKA.Identifier = BRKA.GetNewIdentifier(this._bkraMessage.Elements);
eld.BRKA.MessageHeader = _bkraMessage;
this.SublistElementChanged(Message.NotificationClass.BKRA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);
}
if (eld.ShowDialog() ?? false)
{
if (!_bkraMessage.Elements.Contains(eld.BRKA))
_bkraMessage.Elements.Add(eld.BRKA);
this.dataGridBKRA.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRA);
}
}

View File

@ -124,24 +124,27 @@ namespace ENI2.DetailViewControls
private void DataGridPortOfItinerary_CreateRequested()
{
PortOfItinerary poi = new PortOfItinerary();
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog();
epid.PortOfItinerary = poi;
epid.PortOfItinerary = new PortOfItinerary();
epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries);
epid.PortOfItinerary.BPOL = this._bpol;
epid.AddClicked += () =>
{
epid.CopyValuesToEntity();
epid.PortOfItinerary.BPOL = _bpol;
this._bpol.PortOfItineraries.Add(epid.PortOfItinerary);
if(!this._bpol.PortOfItineraries.Contains(epid.PortOfItinerary))
this._bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary();
epid.PortOfItinerary.BPOL = _bpol;
epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries);
this.SublistElementChanged(Message.NotificationClass.BPOL);
};
if (epid.ShowDialog() ?? false)
{
_bpol.PortOfItineraries.Add(epid.PortOfItinerary);
epid.PortOfItinerary.BPOL = _bpol;
if(!_bpol.PortOfItineraries.Contains(epid.PortOfItinerary))
_bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BPOL);
}
@ -163,27 +166,27 @@ namespace ENI2.DetailViewControls
private void DataGridPortOfItinerary_EditRequested(DatabaseEntity obj)
{
PortOfItinerary poi = obj as PortOfItinerary;
if (poi != null)
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog();
epid.PortOfItinerary = obj as PortOfItinerary;
epid.AddClicked += () =>
{
EditPortOfItineraryDialog epid = new EditPortOfItineraryDialog();
epid.PortOfItinerary = poi;
epid.AddClicked += () =>
{
epid.CopyValuesToEntity();
epid.CopyValuesToEntity();
if(!_bpol.PortOfItineraries.Contains(epid.PortOfItinerary))
_bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary();
epid.PortOfItinerary.BPOL = this._bpol;
this.SublistElementChanged(Message.NotificationClass.BPOL);
};
this.dataGridPortOfItinerary.Items.Refresh();
epid.PortOfItinerary = new PortOfItinerary();
epid.PortOfItinerary.BPOL = this._bpol;
epid.PortOfItinerary.Identifier = PortOfItinerary.GetNewIdentifier(this._bpol.PortOfItineraries);
this.SublistElementChanged(Message.NotificationClass.BPOL);
};
if (epid.ShowDialog() ?? false)
{
this.dataGridPortOfItinerary.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BPOL);
}
if (epid.ShowDialog() ?? false)
{
if (!_bpol.PortOfItineraries.Contains(epid.PortOfItinerary))
this._bpol.PortOfItineraries.Add(epid.PortOfItinerary);
this.dataGridPortOfItinerary.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BPOL);
}
}
@ -198,26 +201,27 @@ namespace ENI2.DetailViewControls
private void DataGridPassengerList_CreateRequested()
{
PAS pas = new PAS();
pas.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
EditPASDialog epd = new EditPASDialog();
epd.PAS = pas;
epd.PAS = new PAS();
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
epd.PAS.MessageHeader = this._pasMessage;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.PAS.MessageHeader = this._pasMessage;
this._pasMessage.Elements.Add(epd.PAS);
if(!this._pasMessage.Elements.Contains(epd.PAS))
this._pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS();
epd.PAS.MessageHeader = this._pasMessage;
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.PAS);
};
if (epd.ShowDialog() ?? false)
{
_pasMessage.Elements.Add(epd.PAS);
epd.PAS.MessageHeader = this._pasMessage;
if(!this._pasMessage.Elements.Contains(epd.PAS))
_pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
}
@ -239,28 +243,27 @@ namespace ENI2.DetailViewControls
private void DataGridPassengerList_EditRequested(DatabaseEntity obj)
{
PAS pas = obj as PAS;
if (pas != null)
EditPASDialog epd = new EditPASDialog();
epd.PAS = obj as PAS;
epd.AddClicked += () =>
{
EditPASDialog epd = new EditPASDialog();
epd.PAS = pas;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.CopyValuesToEntity();
if(!_pasMessage.Elements.Contains(epd.PAS))
_pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS();
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
epd.PAS.MessageHeader = _pasMessage;
this.SublistElementChanged(Message.NotificationClass.PAS);
};
this.dataGridPassengerList.Items.Refresh();
epd.PAS = new PAS();
epd.PAS.Identifier = PAS.GetNewIdentifier(_pasMessage.Elements);
epd.PAS.MessageHeader = _pasMessage;
this.SublistElementChanged(Message.NotificationClass.PAS);
};
if (epd.ShowDialog() ?? false)
{
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
}
if (epd.ShowDialog() ?? false)
{
if (!_pasMessage.Elements.Contains(epd.PAS))
_pasMessage.Elements.Add(epd.PAS);
this.dataGridPassengerList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.PAS);
}
}
@ -275,26 +278,27 @@ namespace ENI2.DetailViewControls
private void DataGridCrewList_CreateRequested()
{
CREW crew = new CREW();
crew.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements);
EditCREWDialog ecd = new EditCREWDialog();
ecd.CREW = crew;
ecd.CREW = new CREW();
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements);
ecd.CREW.MessageHeader = this._crewMessage;
ecd.AddClicked += () =>
{
ecd.CopyValuesToEntity();
ecd.CREW.MessageHeader = this._crewMessage;
this._crewMessage.Elements.Add(ecd.CREW);
if(!this._crewMessage.Elements.Contains(ecd.CREW))
this._crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW();
ecd.CREW.MessageHeader = this._crewMessage;
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.CREW);
};
if (ecd.ShowDialog() ?? false)
{
_crewMessage.Elements.Add(ecd.CREW);
ecd.CREW.MessageHeader = this._crewMessage;
if(!this._crewMessage.Elements.Contains(ecd.CREW))
_crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
}
@ -316,28 +320,27 @@ namespace ENI2.DetailViewControls
private void DataGridCrewList_EditRequested(DatabaseEntity obj)
{
CREW crew = obj as CREW;
if (crew != null)
EditCREWDialog ecd = new EditCREWDialog();
ecd.CREW = obj as CREW;
ecd.AddClicked += () =>
{
EditCREWDialog ecd = new EditCREWDialog();
ecd.CREW = crew;
ecd.AddClicked += () =>
{
ecd.CopyValuesToEntity();
ecd.CopyValuesToEntity();
if(!_crewMessage.Elements.Contains(ecd.CREW))
_crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW();
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements);
ecd.CREW.MessageHeader = _crewMessage;
this.SublistElementChanged(Message.NotificationClass.CREW);
};
this.dataGridCrewList.Items.Refresh();
ecd.CREW = new CREW();
ecd.CREW.Identifier = CREW.GetNewIdentifier(_crewMessage.Elements);
ecd.CREW.MessageHeader = _crewMessage;
this.SublistElementChanged(Message.NotificationClass.CREW);
};
if (ecd.ShowDialog() ?? false)
{
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
}
if (ecd.ShowDialog() ?? false)
{
if (!_crewMessage.Elements.Contains(ecd.CREW))
_crewMessage.Elements.Add(ecd.CREW);
this.dataGridCrewList.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.CREW);
}
}
@ -388,6 +391,10 @@ namespace ENI2.DetailViewControls
{
while (reader.Read())
{
if(((IExcelDataReader) reader).FieldCount < 10)
{
throw new InvalidDataException("Sheet must have 10 Columns of data");
}
CREW crew = new CREW();
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
if (!reader.IsDBNull(0)) crew.CrewMemberLastName = reader.GetString(0);
@ -455,6 +462,11 @@ namespace ENI2.DetailViewControls
{
while (reader.Read())
{
if (((IExcelDataReader)reader).FieldCount < 11)
{
throw new InvalidDataException("Sheet must have 11 Columns of data");
}
PAS pas = new PAS();
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
if (!reader.IsDBNull(0)) pas.PassengerLastName = reader.GetString(0);

View File

@ -39,41 +39,47 @@
<enictrl:ENIDataGrid x:Name="dataGridIMDGItems" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textUNNumber}" Binding="{Binding UNNumber}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textPackingGroup}" Binding="{Binding PackingGroup}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textProperShippingName}" Binding="{Binding ProperShippingName}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textIMOClassDivision}" Binding="{Binding IMOClass}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textTechnicalName}" Binding="{Binding TechnicalName}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textNetExplosiveMass}" Binding="{Binding NetExplosiveMass_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpoint}" Binding="{Binding Flashpoint_CEL}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textRadioNuclideName}" Binding="{Binding Class7NuclideName}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textMaxActivity}" Binding="{Binding Class7MaxActivity_BQL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textCategory}" Binding="{Binding Class7Category}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textTransportIndex}" Binding="{Binding Class7TransportIndex}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textCriticalSafetyIndex}" Binding="{Binding Class7CSI}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textControlTemperature}" Binding="{Binding ControlTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyTemperature}" Binding="{Binding EmergencyTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textMarinePollutant}" Binding="{Binding Class7Category}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textNumberOfPackages}" Binding="{Binding NumberOfPackages}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textPackageType}" Binding="{Binding PackageType}" IsReadOnly="True" Width="80" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textLimitedQuantity}" Binding="{Binding LimitedQuantities}" IsReadOnly="True" Width="80" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textNetQuantity}" Binding="{Binding NetQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textCargoVolume}" Binding="{Binding Volume_MTQ, StringFormat={}{0:N2}}" IsReadOnly="True" Width="80" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textGeneralCargo}" Binding="{Binding GeneralCargoIBC}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textVehicleLicensePlate}" Binding="{Binding VehicleLicenseNumber}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionBay}" Binding="{Binding Bay}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionRow}" Binding="{Binding Row}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionTier}" Binding="{Binding Tier}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="80" />
<DataGridTextColumn Header="{x:Static p:Resources.textIdentifier}" Binding="{Binding Identifier}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textUNNumber}" Binding="{Binding UNNumber}" IsReadOnly="True" Width="auto" />
<DataGridComboBoxColumn Header="{x:Static p:Resources.textPackingGroup}" ItemsSource="{x:Static util:GlobalStructures.PackingGroups}" IsReadOnly="True" Width="auto">
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="SelectedIndex" Value="{Binding PackingGroup, UpdateSourceTrigger=PropertyChanged}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
</DataGridComboBoxColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textProperShippingName}" Binding="{Binding ProperShippingName}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textIMOClassDivision}" Binding="{Binding IMOClass}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textTechnicalName}" Binding="{Binding TechnicalName}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textNetExplosiveMass}" Binding="{Binding NetExplosiveMass_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textFlashpoint}" Binding="{Binding Flashpoint_CEL}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textRadioNuclideName}" Binding="{Binding Class7NuclideName}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textMaxActivity}" Binding="{Binding Class7MaxActivity_BQL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textCategory}" Binding="{Binding Class7Category}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textTransportIndex}" Binding="{Binding Class7TransportIndex}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textCriticalSafetyIndex}" Binding="{Binding Class7CSI}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textControlTemperature}" Binding="{Binding ControlTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textEmergencyTemperature}" Binding="{Binding EmergencyTemperature_CEL, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textMarinePollutant}" Binding="{Binding Class7Category}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textNumberOfPackages}" Binding="{Binding NumberOfPackages}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textPackageType}" Binding="{Binding PackageType}" IsReadOnly="True" Width="auto" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textLimitedQuantity}" Binding="{Binding LimitedQuantities}" IsReadOnly="True" Width="auto" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textNetQuantity}" Binding="{Binding NetQuantity_KGM, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textExceptedQuantities}" Binding="{Binding ExceptedQuantities, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textCargoVolume}" Binding="{Binding Volume_MTQ, StringFormat={}{0:N2}}" IsReadOnly="True" Width="auto" />
<DataGridCheckBoxColumn Header="{x:Static p:Resources.textGeneralCargo}" Binding="{Binding GeneralCargoIBC}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerNo}" Binding="{Binding ContainerNumber}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textVehicleLicensePlate}" Binding="{Binding VehicleLicenseNumber}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textStowagePosition}" Binding="{Binding StowagePosition}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textSubsidiaryRisk}" Binding="{Binding SubsidiaryRiskText}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionBay}" Binding="{Binding Bay}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionRow}" Binding="{Binding Row}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textContainerPositionTier}" Binding="{Binding Tier}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfLoading}" Binding="{Binding PortOfLoading}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textPortOfDischarge}" Binding="{Binding PortOfDischarge}" IsReadOnly="True" Width="auto" />
<DataGridTextColumn Header="{x:Static p:Resources.textRemarks}" Binding="{Binding Remarks}" IsReadOnly="True" Width="auto" />
</DataGrid.Columns>
</enictrl:ENIDataGrid>

View File

@ -24,7 +24,7 @@ namespace ENI2.DetailViewControls
private HAZ hazd; // referenz auf HAZD, falls das hier HAZA ist und wir Positionen kopieren wollen
public DangerousGoodsDetailControl()
{
{
InitializeComponent();
this.Loaded += DangerousGoodsDetailControl_Loaded;
}
@ -34,8 +34,8 @@ namespace ENI2.DetailViewControls
this.RegisterCheckboxChange(this.checkBoxDangerousGoodsOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
this.RegisterCheckboxChange(this.checkBoxDGManifestOnBoard, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
this.RegisterCheckboxChange(this.checkBoxMoUBaltic, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
this.RegisterComboboxIndexChange(this.comboBoxVesselClass, this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
public bool IsDeparture { get; set; }
@ -58,7 +58,7 @@ namespace ENI2.DetailViewControls
}
if (aMessage.MessageNotificationClass == Message.NotificationClass.HAZD)
{
if(aMessage != null)
if (aMessage != null)
{
if (aMessage.Elements.Count > 0)
this.hazd = aMessage.Elements[0] as HAZ;
@ -189,16 +189,15 @@ namespace ENI2.DetailViewControls
private void copyMARPOL(object sender, RoutedEventArgs e)
{
// aus dem aktuell selektierten MARPOL Element ein neues MARPOL Element machen und nach HAZD kopieren
if ((this.dataGridMARPOLItems.SelectedItems != null) && (this.dataGridMARPOLItems.SelectedItems.Count == 1))
if (this.dataGridMARPOLItems.SelectedItems != null)
{
MARPOL_Annex_I_Position selectedMARPOL = this.dataGridMARPOLItems.SelectedItems[0] as MARPOL_Annex_I_Position;
if (selectedMARPOL != null)
foreach (MARPOL_Annex_I_Position selectedMARPOL in this.dataGridMARPOLItems.SelectedItems)
{
MARPOL_Annex_I_Position copyMARPOL = new MARPOL_Annex_I_Position();
copyMARPOL.MessageHeader = this.hazd.MessageHeader;
copyMARPOL.HAZ = this.hazd;
copyMARPOL.CopyFromMARPOL(selectedMARPOL);
copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.MARPOLPositions);
copyMARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.MARPOLPositions, "MARPOL-");
this.hazd.MARPOLPositions.Add(copyMARPOL);
this.SublistElementChanged(Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
@ -209,16 +208,15 @@ namespace ENI2.DetailViewControls
private void copyIMSBC(object sender, RoutedEventArgs e)
{
// aus dem aktuell selektierten IMBSC Element ein neues IMBSC Element machen und nach HAZD kopieren
if ((this.dataGridIMSBCItems.SelectedItems != null) && (this.dataGridIMSBCItems.SelectedItems.Count == 1))
if (this.dataGridIMSBCItems.SelectedItems != null)
{
IMSBCPosition selectedIMSBC = this.dataGridIMSBCItems.SelectedItems[0] as IMSBCPosition;
if (selectedIMSBC != null)
foreach (IMSBCPosition selectedIMSBC in this.dataGridIMSBCItems.SelectedItems)
{
IMSBCPosition copyIMSBC = new IMSBCPosition();
copyIMSBC.MessageHeader = this.hazd.MessageHeader;
copyIMSBC.HAZ = this.hazd;
copyIMSBC.CopyFromIMSBC(selectedIMSBC);
copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMSBCPositions);
copyIMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMSBCPositions, "IMSBC-");
this.hazd.IMSBCPositions.Add(copyIMSBC);
this.SublistElementChanged(Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
@ -229,16 +227,15 @@ namespace ENI2.DetailViewControls
private void copyIMDG(object sender, RoutedEventArgs e)
{
// aus dem aktuell selektierten IMDG Element ein neues IMDG Element machen und nach HAZD kopieren
if ((this.dataGridIMDGItems.SelectedItems != null) && (this.dataGridIMDGItems.SelectedItems.Count == 1))
if (this.dataGridIMDGItems.SelectedItems != null)
{
IMDGPosition selectedIMDG = this.dataGridIMDGItems.SelectedItems[0] as IMDGPosition;
if (selectedIMDG != null)
foreach (IMDGPosition selectedIMDG in this.dataGridIMDGItems.SelectedItems)
{
IMDGPosition copyIMDG = new IMDGPosition();
copyIMDG.MessageHeader = this.hazd.MessageHeader;
copyIMDG.HAZ = this.hazd;
copyIMDG.CopyFromIMDG(selectedIMDG);
copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMDGPositions);
copyIMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IMDGPositions, "IMDG-");
this.hazd.IMDGPositions.Add(copyIMDG);
this.SublistElementChanged(Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
@ -249,16 +246,15 @@ namespace ENI2.DetailViewControls
private void copyIGC(object sender, RoutedEventArgs e)
{
// aus dem aktuell selektierten IGC Element ein neues IGC Element machen und nach HAZD kopieren
if ((this.dataGridIGCItems.SelectedItems != null) && (this.dataGridIGCItems.SelectedItems.Count == 1))
if (this.dataGridIGCItems.SelectedItems != null)
{
IGCPosition selectedIGC = this.dataGridIGCItems.SelectedItems[0] as IGCPosition;
if (selectedIGC != null)
foreach (IGCPosition selectedIGC in this.dataGridIGCItems.SelectedItems)
{
IGCPosition copyIGC = new IGCPosition();
copyIGC.MessageHeader = this.hazd.MessageHeader;
copyIGC.HAZ = this.hazd;
copyIGC.CopyFromIGC(selectedIGC);
copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IGCPositions);
copyIGC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IGCPositions, "IGC-");
this.hazd.IGCPositions.Add(copyIGC);
this.SublistElementChanged(Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
@ -269,19 +265,21 @@ namespace ENI2.DetailViewControls
private void copyIBC(object sender, RoutedEventArgs e)
{
// aus dem aktuell selektierten IBC Element ein neues IBC Element machen und nach HAZD kopieren
if ((this.dataGridIBCItems.SelectedItems != null) && (this.dataGridIBCItems.SelectedItems.Count == 1))
if (this.dataGridIBCItems.SelectedItems != null)
{
IBCPosition selectedIBC = this.dataGridIBCItems.SelectedItems[0] as IBCPosition;
if (selectedIBC != null)
foreach (IBCPosition selectedIBC in this.dataGridIBCItems.SelectedItems)
{
IBCPosition copyIBC = new IBCPosition();
copyIBC.MessageHeader = this.hazd.MessageHeader;
copyIBC.HAZ = this.hazd;
copyIBC.CopyFromIBC(selectedIBC);
copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IBCPositions);
this.hazd.IBCPositions.Add(copyIBC);
this.SublistElementChanged(Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
if (selectedIBC != null)
{
IBCPosition copyIBC = new IBCPosition();
copyIBC.MessageHeader = this.hazd.MessageHeader;
copyIBC.HAZ = this.hazd;
copyIBC.CopyFromIBC(selectedIBC);
copyIBC.Identifier = DatabaseEntity.GetNewIdentifier(this.hazd.IBCPositions, "IBC-");
this.hazd.IBCPositions.Add(copyIBC);
this.SublistElementChanged(Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
}
}
}
}
@ -306,29 +304,29 @@ namespace ENI2.DetailViewControls
private void DataGridMARPOLItems_EditRequested(DatabaseEntity obj)
{
MARPOL_Annex_I_Position marpol = obj as MARPOL_Annex_I_Position;
if (marpol != null)
EditMarpolDialog eld = new EditMarpolDialog();
eld.MARPOL = obj as MARPOL_Annex_I_Position;
eld.AddClicked += () =>
{
EditMarpolDialog eld = new EditMarpolDialog();
eld.MARPOL = marpol;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if (!haz.MARPOLPositions.Contains(eld.MARPOL))
haz.MARPOLPositions.Add(eld.MARPOL);
this.dataGridMARPOLItems.Items.Refresh();
eld.MARPOL = new MARPOL_Annex_I_Position();
eld.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions);
eld.MARPOL.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
this.dataGridMARPOLItems.Items.Refresh();
eld.MARPOL = new MARPOL_Annex_I_Position();
eld.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(haz.MARPOLPositions, "MARPOL-");
eld.MARPOL.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridMARPOLItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
if (eld.ShowDialog() ?? false)
{
if (!haz.MARPOLPositions.Contains(eld.MARPOL))
haz.MARPOLPositions.Add(eld.MARPOL);
this.dataGridMARPOLItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
}
private void DataGridMARPOLItems_AddingNewItem(object sender, System.Windows.Controls.AddingNewItemEventArgs e)
@ -338,26 +336,27 @@ namespace ENI2.DetailViewControls
private void DataGridMARPOLItems_CreateRequested()
{
MARPOL_Annex_I_Position marpol = new MARPOL_Annex_I_Position();
marpol.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions);
EditMarpolDialog ebd = new EditMarpolDialog();
ebd.MARPOL = marpol;
ebd.MARPOL = new MARPOL_Annex_I_Position();
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions, "MARPOL-");
ebd.MARPOL.HAZ = this.haz;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this.haz.MARPOLPositions.Add(ebd.MARPOL);
ebd.MARPOL.HAZ = this.haz;
if (!haz.MARPOLPositions.Contains(ebd.MARPOL))
haz.MARPOLPositions.Add(ebd.MARPOL);
this.dataGridMARPOLItems.Items.Refresh();
ebd.MARPOL = new MARPOL_Annex_I_Position();
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions);
ebd.MARPOL.HAZ = this.haz;
ebd.MARPOL.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.MARPOLPositions, "MARPOL-");
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (ebd.ShowDialog() ?? false)
{
marpol.HAZ = haz;
haz.MARPOLPositions.Add(marpol);
if (!haz.MARPOLPositions.Contains(ebd.MARPOL))
haz.MARPOLPositions.Add(ebd.MARPOL);
this.dataGridMARPOLItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
@ -383,28 +382,27 @@ namespace ENI2.DetailViewControls
private void DataGridIMSBCItems_EditRequested(DatabaseEntity obj)
{
IMSBCPosition imsbc = obj as IMSBCPosition;
if (imsbc != null)
EditIMSBCDialog eld = new EditIMSBCDialog();
eld.IMSBC = obj as IMSBCPosition;
eld.AddClicked += () =>
{
EditIMSBCDialog eld = new EditIMSBCDialog();
eld.IMSBC = imsbc;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if (!haz.IMSBCPositions.Contains(eld.IMSBC))
haz.IMSBCPositions.Add(eld.IMSBC);
this.dataGridIMSBCItems.Items.Refresh();
eld.IMSBC = new IMSBCPosition();
eld.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions);
eld.IMSBC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
this.dataGridIMSBCItems.Items.Refresh();
eld.IMSBC = new IMSBCPosition();
eld.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
eld.IMSBC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridIMSBCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
if (eld.ShowDialog() ?? false)
{
if (!haz.IMSBCPositions.Contains(eld.IMSBC))
haz.IMSBCPositions.Add(eld.IMSBC);
this.dataGridIMSBCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
}
@ -415,26 +413,27 @@ namespace ENI2.DetailViewControls
private void DataGridIMSBCItems_CreateRequested()
{
IMSBCPosition imsbc = new IMSBCPosition();
imsbc.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions);
EditIMSBCDialog ebd = new EditIMSBCDialog();
ebd.IMSBC = imsbc;
ebd.IMSBC = new IMSBCPosition();
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
ebd.IMSBC.HAZ = this.haz;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this.haz.IMSBCPositions.Add(ebd.IMSBC);
ebd.IMSBC.HAZ = this.haz;
if (!haz.IMSBCPositions.Contains(ebd.IMSBC))
this.haz.IMSBCPositions.Add(ebd.IMSBC);
this.dataGridIMSBCItems.Items.Refresh();
ebd.IMSBC = new IMSBCPosition();
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions);
ebd.IMSBC.HAZ = this.haz;
ebd.IMSBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMSBCPositions, "IMSBC-");
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (ebd.ShowDialog() ?? false)
{
imsbc.HAZ = haz;
haz.IMSBCPositions.Add(imsbc);
if (!haz.IMSBCPositions.Contains(ebd.IMSBC))
haz.IMSBCPositions.Add(ebd.IMSBC);
this.dataGridIMSBCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
@ -460,28 +459,27 @@ namespace ENI2.DetailViewControls
private void DataGridIGCItems_EditRequested(DatabaseEntity obj)
{
IGCPosition igc = obj as IGCPosition;
if (igc != null)
EditIGCDialog eld = new EditIGCDialog();
eld.IGC = obj as IGCPosition;
eld.AddClicked += () =>
{
EditIGCDialog eld = new EditIGCDialog();
eld.IGC = igc;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if(!haz.IGCPositions.Contains(eld.IGC))
haz.IGCPositions.Add(eld.IGC);
this.dataGridIGCItems.Items.Refresh();
eld.IGC = new IGCPosition();
eld.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions);
eld.IGC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
this.dataGridIGCItems.Items.Refresh();
eld.IGC = new IGCPosition();
eld.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
eld.IGC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridIGCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
if (eld.ShowDialog() ?? false)
{
if (!haz.IGCPositions.Contains(eld.IGC))
haz.IGCPositions.Add(eld.IGC);
this.dataGridIGCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
}
@ -492,26 +490,27 @@ namespace ENI2.DetailViewControls
private void DataGridIGCItems_CreateRequested()
{
IGCPosition igc = new IGCPosition();
igc.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions);
EditIGCDialog ebd = new EditIGCDialog();
ebd.IGC = igc;
ebd.IGC = new IGCPosition();
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
ebd.IGC.HAZ = this.haz;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this.haz.IGCPositions.Add(ebd.IGC);
ebd.IGC.HAZ = this.haz;
if(!this.haz.IGCPositions.Contains(ebd.IGC))
this.haz.IGCPositions.Add(ebd.IGC);
this.dataGridIGCItems.Items.Refresh();
ebd.IGC = new IGCPosition();
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions);
ebd.IGC.HAZ = this.haz;
ebd.IGC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IGCPositions, "IGC-");
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (ebd.ShowDialog() ?? false)
{
igc.HAZ = haz;
haz.IGCPositions.Add(igc);
if(!this.haz.IGCPositions.Contains(ebd.IGC))
haz.IGCPositions.Add(ebd.IGC);
this.dataGridIGCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
@ -537,28 +536,27 @@ namespace ENI2.DetailViewControls
private void DataGridIBCItems_EditRequested(DatabaseEntity obj)
{
IBCPosition ibc = obj as IBCPosition;
if (ibc != null)
EditIBCDialog eld = new EditIBCDialog();
eld.IBC = obj as IBCPosition;
eld.AddClicked += () =>
{
EditIBCDialog eld = new EditIBCDialog();
eld.IBC = ibc;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if(!haz.IBCPositions.Contains(eld.IBC))
haz.IBCPositions.Add(eld.IBC);
this.dataGridIBCItems.Items.Refresh();
eld.IBC = new IBCPosition();
eld.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions);
eld.IBC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
this.dataGridIBCItems.Items.Refresh();
eld.IBC = new IBCPosition();
eld.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
eld.IBC.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridIBCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
if (eld.ShowDialog() ?? false)
{
if (!haz.IBCPositions.Contains(eld.IBC))
haz.IBCPositions.Add(eld.IBC);
this.dataGridIBCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
}
@ -569,26 +567,27 @@ namespace ENI2.DetailViewControls
private void DataGridIBCItems_CreateRequested()
{
IBCPosition ibc = new IBCPosition();
ibc.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions);
EditIBCDialog ebd = new EditIBCDialog();
ebd.IBC = ibc;
ebd.IBC = new IBCPosition();
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
ebd.IBC.HAZ = this.haz;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this.haz.IBCPositions.Add(ebd.IBC);
ebd.IBC.HAZ = this.haz;
if(!this.haz.IBCPositions.Contains(ebd.IBC))
this.haz.IBCPositions.Add(ebd.IBC);
this.dataGridIBCItems.Items.Refresh();
ebd.IBC = new IBCPosition();
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions);
ebd.IBC.HAZ = this.haz;
ebd.IBC.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IBCPositions, "IBC-");
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (ebd.ShowDialog() ?? false)
{
ibc.HAZ = haz;
haz.IBCPositions.Add(ibc);
if(!this.haz.IBCPositions.Contains(ebd.IBC))
haz.IBCPositions.Add(ebd.IBC);
this.dataGridIBCItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
@ -614,28 +613,27 @@ namespace ENI2.DetailViewControls
private void DataGridIMDGItems_EditRequested(DatabaseEntity obj)
{
IMDGPosition imdg = obj as IMDGPosition;
if (imdg != null)
EditIMDGDialog eld = new EditIMDGDialog();
eld.IMDG = obj as IMDGPosition;
eld.AddClicked += () =>
{
EditIMDGDialog eld = new EditIMDGDialog();
eld.IMDG = imdg;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if(!haz.IMDGPositions.Contains(eld.IMDG))
haz.IMDGPositions.Add(eld.IMDG);
this.dataGridIMDGItems.Items.Refresh();
eld.IMDG = new IMDGPosition();
eld.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions);
eld.IMDG.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
this.dataGridIMDGItems.Items.Refresh();
eld.IMDG = new IMDGPosition();
eld.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
eld.IMDG.HAZ = this.haz;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridIMDGItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
if (eld.ShowDialog() ?? false)
{
if (!haz.IMDGPositions.Contains(eld.IMDG))
haz.IMDGPositions.Add(eld.IMDG);
this.dataGridIMDGItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}
}
@ -645,27 +643,28 @@ namespace ENI2.DetailViewControls
}
private void DataGridIMDGItems_CreateRequested()
{
IMDGPosition imdg = new IMDGPosition();
imdg.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions);
{
EditIMDGDialog ebd = new EditIMDGDialog();
ebd.IMDG = imdg;
ebd.IMDG = new IMDGPosition();
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
ebd.IMDG.HAZ = this.haz;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this.haz.IMDGPositions.Add(ebd.IMDG);
ebd.IMDG.HAZ = this.haz;
if(!this.haz.IMDGPositions.Contains(ebd.IMDG))
this.haz.IMDGPositions.Add(ebd.IMDG);
this.dataGridIMDGItems.Items.Refresh();
ebd.IMDG = new IMDGPosition();
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions);
ebd.IMDG.HAZ = this.haz;
ebd.IMDG.Identifier = DatabaseEntity.GetNewIdentifier(this.haz.IMDGPositions, "IMDG-");
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
};
if (ebd.ShowDialog() ?? false)
{
imdg.HAZ = haz;
haz.IMDGPositions.Add(imdg);
if(!haz.IMDGPositions.Contains(ebd.IMDG))
haz.IMDGPositions.Add(ebd.IMDG);
this.dataGridIMDGItems.Items.Refresh();
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZD : Message.NotificationClass.HAZA);
}

View File

@ -142,27 +142,29 @@ namespace ENI2.DetailViewControls
private void DataGridBKRD_CreateRequested()
{
BRKD brkd = new BRKD();
brkd.Identifier = BRKD.GetNewIdentifier(_bkrdMessage.Elements);
EditBKRDialog ebd = new EditBKRDialog();
ebd.BRKD = brkd;
ebd.IsDeparture = true;
ebd.BRKD = new BRKD();
ebd.BRKD.Identifier = BRKD.GetNewIdentifier(_bkrdMessage.Elements);
ebd.BRKD.MessageHeader = this._bkrdMessage;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this._bkrdMessage.Elements.Add(ebd.BRKD);
ebd.BRKD.MessageHeader = _bkrdMessage;
if(!this._bkrdMessage.Elements.Contains(ebd.BRKD))
this._bkrdMessage.Elements.Add(ebd.BRKD);
this.dataGridBKRD.Items.Refresh();
ebd.BRKD = new BRKD();
ebd.BRKD.MessageHeader = _bkrdMessage;
ebd.BRKD.Identifier = BRKD.GetNewIdentifier(_bkrdMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.BKRD);
};
if (ebd.ShowDialog() ?? false)
{
brkd.MessageHeader = _bkrdMessage;
_bkrdMessage.Elements.Add(brkd);
if(!_bkrdMessage.Elements.Contains(ebd.BRKD))
_bkrdMessage.Elements.Add(ebd.BRKD);
this.dataGridBKRD.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRD);
}
@ -184,29 +186,28 @@ namespace ENI2.DetailViewControls
private void DataGridBKRD_EditRequested(DatabaseEntity obj)
{
BRKD brkd = obj as BRKD;
if (brkd != null)
EditBKRDialog eld = new EditBKRDialog();
eld.IsDeparture = true;
eld.BRKD = obj as BRKD;
eld.AddClicked += () =>
{
EditBKRDialog eld = new EditBKRDialog();
eld.IsDeparture = true;
eld.BRKD = brkd;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.CopyValuesToEntity();
if(!_bkrdMessage.Elements.Contains(eld.BRKD))
_bkrdMessage.Elements.Add(eld.BRKD);
this.dataGridBKRD.Items.Refresh();
eld.BRKD = new BRKD();
eld.BRKD.Identifier = BRKD.GetNewIdentifier(_bkrdMessage.Elements);
eld.BRKD.MessageHeader = _bkrdMessage;
this.SublistElementChanged(Message.NotificationClass.BKRD);
};
this.dataGridBKRD.Items.Refresh();
eld.BRKD = new BRKD();
eld.BRKD.Identifier = BRKD.GetNewIdentifier(_bkrdMessage.Elements);
eld.BRKD.MessageHeader = _bkrdMessage;
this.SublistElementChanged(Message.NotificationClass.BKRD);
};
if (eld.ShowDialog() ?? false)
{
this.dataGridBKRD.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRD);
}
if (eld.ShowDialog() ?? false)
{
if (!_bkrdMessage.Elements.Contains(eld.BRKD))
_bkrdMessage.Elements.Add(eld.BRKD);
this.dataGridBKRD.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.BKRD);
}
}

View File

@ -85,7 +85,15 @@
</GroupBox>
</TabItem>
<TabItem Header="{x:Static p:Resources.textPortsOfCallLast30Days}" Name="tabPortsOfCallLast30Days">
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfCallLast30Days" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Button Name="buttonImportFromSEC" Margin="2" Content="{x:Static p:Resources.textImportFromSEC}" Width="120" VerticalAlignment="Center" Click="buttonImportFromSEC_Click" />
</StackPanel>
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridPortOfCallLast30Days" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
@ -107,6 +115,7 @@
<DataGridTextColumn Header="{x:Static p:Resources.textCrewMembersJoinedGrid}" Binding="{Binding CrewMembersJoinedText, Mode=TwoWay}" IsReadOnly="True" Width="0.4*" />
</DataGrid.Columns>
</enictrl:ENIDataGrid>
</Grid>
</TabItem>
<TabItem Header="{x:Static p:Resources.textVisitsInfectedAreas}" Name="tabInfectedAreas">
<Grid>

View File

@ -2,6 +2,7 @@
// Description: MDH Meldung Bearbeitungsseite
//
using System;
using System.Windows;
using System.Windows.Controls;
using ENI2.EditControls;
@ -17,7 +18,9 @@ namespace ENI2.DetailViewControls
public partial class MaritimeHealthDeclarationDetailControl : DetailBaseControl
{
private Message _mdhMessage;
private Message _secMessage;
private MDH _mdh;
private SEC _sec;
public MaritimeHealthDeclarationDetailControl()
{
@ -32,6 +35,11 @@ namespace ENI2.DetailViewControls
foreach (Message aMessage in this.Messages)
{
if (aMessage.MessageNotificationClass == Message.NotificationClass.MDH) { this._mdhMessage = aMessage; this.ControlMessages.Add(aMessage); }
if (aMessage.MessageNotificationClass == Message.NotificationClass.SEC)
{
this._secMessage = aMessage;
if (this._secMessage.Elements.Count > 0) this._sec = this._secMessage.Elements[0] as SEC;
}
}
#region init MDH
@ -208,30 +216,64 @@ namespace ENI2.DetailViewControls
}
private void buttonImportFromSEC_Click(object sender, RoutedEventArgs e)
{
if(this._mdh.PortOfCallLast30Days.Count > 0)
{
MessageBox.Show(Properties.Resources.textOnlyIfGridIsEmpty, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Warning);
}
else
{
if(this._sec != null)
{
foreach(LastTenPortFacilitiesCalled l10fc in _sec.LastTenPortFacilitesCalled)
{
if(l10fc.PortFacilityDateOfDeparture.HasValue &&
((DateTime.Now - l10fc.PortFacilityDateOfDeparture.Value).TotalDays < 31))
{
PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
poc30.PortOfCallLast30DaysCrewMembersJoined = false;
poc30.PortOfCallLast30DaysDateOfDeparture = l10fc.PortFacilityDateOfDeparture;
poc30.PortOfCallLast30DaysLocode = l10fc.PortFacilityPortLoCode;
poc30.MDH = this._mdh;
this._mdh.PortOfCallLast30Days.Add(poc30);
}
}
if (this._mdh.PortOfCallLast30Days.Count > 0)
{
this.dataGridPortOfCallLast30Days.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
}
}
}
#region SanitaryMeasures Grid
private void DataGridSanitaryMeasures_CreateRequested()
{
SanitaryMeasuresDetail smDetail = new SanitaryMeasuresDetail();
smDetail.Identifier = SanitaryMeasuresDetail.GetNewIdentifier(_mdh.SanitaryMeasuresDetails);
EditSanitaryMeasureDialog epd = new EditSanitaryMeasureDialog();
epd.SanitaryMeasureDetail = smDetail;
epd.SanitaryMeasureDetail = new SanitaryMeasuresDetail();
epd.SanitaryMeasureDetail.Identifier = SanitaryMeasuresDetail.GetNewIdentifier(_mdh.SanitaryMeasuresDetails);
epd.SanitaryMeasureDetail.MDH = this._mdh;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.SanitaryMeasureDetail.MDH = this._mdh;
this._mdh.SanitaryMeasuresDetails.Add(epd.SanitaryMeasureDetail);
if(!this._mdh.SanitaryMeasuresDetails.Contains(epd.SanitaryMeasureDetail))
this._mdh.SanitaryMeasuresDetails.Add(epd.SanitaryMeasureDetail);
this.dataGridSanitaryMeasures.Items.Refresh();
epd.SanitaryMeasureDetail = new SanitaryMeasuresDetail();
epd.SanitaryMeasureDetail.Identifier = SanitaryMeasuresDetail.GetNewIdentifier(_mdh.SanitaryMeasuresDetails);
epd.SanitaryMeasureDetail.MDH = this._mdh;
this.SublistElementChanged(Message.NotificationClass.MDH);
};
if (epd.ShowDialog() ?? false)
{
_mdh.SanitaryMeasuresDetails.Add(epd.SanitaryMeasureDetail);
epd.SanitaryMeasureDetail.MDH = this._mdh;
if(!_mdh.SanitaryMeasuresDetails.Contains(epd.SanitaryMeasureDetail))
_mdh.SanitaryMeasuresDetails.Add(epd.SanitaryMeasureDetail);
this.dataGridSanitaryMeasures.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
@ -263,13 +305,14 @@ namespace ENI2.DetailViewControls
this.dataGridSanitaryMeasures.Items.Refresh();
ecpd.SanitaryMeasureDetail = new SanitaryMeasuresDetail();
ecpd.SanitaryMeasureDetail.Identifier = SanitaryMeasuresDetail.GetNewIdentifier(_mdh.SanitaryMeasuresDetails);
ecpd.SanitaryMeasureDetail.MDH = this._mdh;
this.SublistElementChanged(Message.NotificationClass.MDH);
};
if (ecpd.ShowDialog() ?? false)
{
if (!_mdh.SanitaryMeasuresDetails.Contains(ecpd.SanitaryMeasureDetail))
_mdh.SanitaryMeasuresDetails.Add(ecpd.SanitaryMeasureDetail);
this.dataGridSanitaryMeasures.Items.Refresh();
// signal up
this.dataGridSanitaryMeasures.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
}
@ -285,26 +328,27 @@ namespace ENI2.DetailViewControls
private void DataGridInfectedAreas_CreateRequested()
{
InfectedArea ia = new InfectedArea();
ia.Identifier = InfectedArea.GetNewIdentifier(_mdh.InfectedAreas);
EditInfectedAreaDialog epd = new EditInfectedAreaDialog();
epd.InfectedArea = ia;
epd.InfectedArea = new InfectedArea();
epd.InfectedArea.Identifier = InfectedArea.GetNewIdentifier(_mdh.InfectedAreas);
epd.InfectedArea.MDH = this._mdh;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.InfectedArea.MDH = this._mdh;
this._mdh.InfectedAreas.Add(epd.InfectedArea);
if(!this._mdh.InfectedAreas.Contains(epd.InfectedArea))
this._mdh.InfectedAreas.Add(epd.InfectedArea);
this.dataGridInfectedAreas.Items.Refresh();
epd.InfectedArea = new InfectedArea();
epd.InfectedArea.MDH = this._mdh;
epd.InfectedArea.Identifier = InfectedArea.GetNewIdentifier(_mdh.InfectedAreas);
this.SublistElementChanged(Message.NotificationClass.MDH);
};
if (epd.ShowDialog() ?? false)
{
_mdh.InfectedAreas.Add(epd.InfectedArea);
epd.InfectedArea.MDH = this._mdh;
if(!this._mdh.InfectedAreas.Contains(epd.InfectedArea))
_mdh.InfectedAreas.Add(epd.InfectedArea);
this.dataGridInfectedAreas.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
@ -335,14 +379,15 @@ namespace ENI2.DetailViewControls
_mdh.InfectedAreas.Add(ecpd.InfectedArea);
this.dataGridInfectedAreas.Items.Refresh();
ecpd.InfectedArea= new InfectedArea();
ecpd.InfectedArea.MDH = this._mdh;
ecpd.InfectedArea.Identifier = InfectedArea.GetNewIdentifier(_mdh.InfectedAreas);
this.SublistElementChanged(Message.NotificationClass.MDH);
};
if (ecpd.ShowDialog() ?? false)
{
if (!_mdh.InfectedAreas.Contains(ecpd.InfectedArea))
_mdh.InfectedAreas.Add(ecpd.InfectedArea);
this.dataGridInfectedAreas.Items.Refresh();
// signal up
this.dataGridInfectedAreas.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
}
@ -358,26 +403,27 @@ namespace ENI2.DetailViewControls
private void DataGridPortOfCallLast30Days_CreateRequested()
{
PortOfCallLast30Days poc30 = new PortOfCallLast30Days();
poc30.Identifier = PortOfCallLast30Days.GetNewIdentifier(_mdh.PortOfCallLast30Days);
EditPortOfCallLast30DaysDialog epd = new EditPortOfCallLast30DaysDialog();
epd.PocLast30Days = poc30;
epd.PocLast30Days = new PortOfCallLast30Days();
epd.PocLast30Days.Identifier = PortOfCallLast30Days.GetNewIdentifier(_mdh.PortOfCallLast30Days);
epd.PocLast30Days.MDH = this._mdh;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.PocLast30Days.MDH = this._mdh;
this._mdh.PortOfCallLast30Days.Add(epd.PocLast30Days);
if(!this._mdh.PortOfCallLast30Days.Contains(epd.PocLast30Days))
this._mdh.PortOfCallLast30Days.Add(epd.PocLast30Days);
this.dataGridPortOfCallLast30Days.Items.Refresh();
epd.PocLast30Days = new PortOfCallLast30Days();
epd.PocLast30Days.MDH = this._mdh;
epd.PocLast30Days.Identifier = PortOfCallLast30Days.GetNewIdentifier(_mdh.PortOfCallLast30Days);
this.SublistElementChanged(Message.NotificationClass.MDH);
};
if (epd.ShowDialog() ?? false)
{
_mdh.PortOfCallLast30Days.Add(epd.PocLast30Days);
epd.PocLast30Days.MDH = this._mdh;
if(!_mdh.PortOfCallLast30Days.Contains(epd.PocLast30Days))
_mdh.PortOfCallLast30Days.Add(epd.PocLast30Days);
this.dataGridPortOfCallLast30Days.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
@ -408,14 +454,15 @@ namespace ENI2.DetailViewControls
_mdh.PortOfCallLast30Days.Add(ecpd.PocLast30Days);
this.dataGridPortOfCallLast30Days.Items.Refresh();
ecpd.PocLast30Days = new PortOfCallLast30Days();
ecpd.PocLast30Days.MDH = this._mdh;
ecpd.PocLast30Days.Identifier = PortOfCallLast30Days.GetNewIdentifier(_mdh.PortOfCallLast30Days);
this.SublistElementChanged(Message.NotificationClass.MDH);
};
if (ecpd.ShowDialog() ?? false)
{
if (!_mdh.PortOfCallLast30Days.Contains(ecpd.PocLast30Days))
_mdh.PortOfCallLast30Days.Add(ecpd.PocLast30Days);
this.dataGridPortOfCallLast30Days.Items.Refresh();
// signal up
this.dataGridPortOfCallLast30Days.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.MDH);
}
}
@ -444,6 +491,6 @@ namespace ENI2.DetailViewControls
}
#endregion
}
}

View File

@ -172,7 +172,7 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<!--DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image x:Name="imageHasUpdate"/>
@ -183,8 +183,8 @@
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
</-->
<!--DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image x:Name="imageHasReminder"/>
@ -195,7 +195,7 @@
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</-->
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
@ -208,6 +208,18 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image x:Name="imageSendSuccess"/>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path=SuccessfullySent}" Value="True">
<Setter Property="Source" Value="/Resources/bullet_ball_green.png" TargetName="imageSendSuccess"/>
</DataTrigger>
</DataTemplate.Triggers>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="{x:Static p:Resources.textChanged}" Binding="{Binding Changed}" IsReadOnly="True" Width="0.15*">
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">

View File

@ -394,6 +394,7 @@ namespace ENI2.DetailViewControls
{
foreach (Message selectedMessage in this.dataGridMessages.SelectedItems)
{
if (selectedMessage.Reset) selectedMessage.Reset = false; // "nochmal" Versenden ist möglich
selectedMessage.InternalStatus = Message.BSMDStatus.TOSEND;
selectedMessage.StatusInfo = string.Format(Properties.Resources.textMessageSentAt, DateTime.Now);
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(selectedMessage);

View File

@ -14,7 +14,7 @@
<GroupBox Name="portCallGroupBox" Header="{x:Static p:Resources.textPortCall}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="280" />
<RowDefinition Height="300" />
<RowDefinition Height="250" />
</Grid.RowDefinitions>
<GroupBox Name="noaNodGroupBox" Header="{x:Static p:Resources.textArrivalDeparture}" Margin="5, 20, 5, 0">
@ -94,11 +94,13 @@
<Label HorizontalContentAlignment="Right" Grid.Row="2" Grid.Column="2" Content="{x:Static p:Resources.textCity}" Name="label_AgentCity" Margin="0,0,10,0" />
<Label HorizontalContentAlignment="Right" Grid.Row="5" Grid.Column="2" Content="{x:Static p:Resources.textFirstName}" Name="label_AgentFirstName" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="6" Grid.Column="2" Content="{x:Static p:Resources.textFax}" Name="label_AgentFax" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textCountry}" Name="label_AgentCountry" Margin="0,0,10,0"/>
<TextBox Grid.Row="0" Grid.Column="1" Name="textBox_AgentCompanyName" MaxLength="100" Margin="2" Text="{Binding AgentCompanyName}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="1" Grid.Column="1" Name="textBox_AgentStreetAndNumber" MaxLength="100" Margin="2" Text="{Binding AgentStreetAndNumber}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="2" Grid.Column="1" Name="textBox_AgentPostalCode" MaxLength="100" Margin="2" Text="{Binding AgentPostalCode}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="2" Grid.Column="3" Name="textBox_AgentCity" MaxLength="100" Margin="2" Text="{Binding AgentCity}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="3" Grid.Column="1" Name="textBox_AgentCountry" MaxLength="100" Margin="2" Text="{Binding AgentCountry}" VerticalContentAlignment="Center" />
<TextBox Grid.Row="5" Grid.Column="1" Name="textBox_AgentLastName" MaxLength="100" Margin="2" Text="{Binding AgentLastName}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="6" Grid.Column="1" Name="textBox_AgentPhone" MaxLength="100" Margin="2" Text="{Binding AgentPhone}" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="7" Grid.Column="1" Name="textBox_AgentEMail" MaxLength="100" Margin="2" Text="{Binding AgentEMail}" VerticalContentAlignment="Center"/>

View File

@ -48,6 +48,7 @@ namespace ENI2.DetailViewControls
this.RegisterTextboxChange(this.textBox_AgentPhone, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentPostalCode, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentStreetAndNumber, Message.NotificationClass.AGNT);
this.RegisterTextboxChange(this.textBox_AgentCountry, Message.NotificationClass.AGNT);
}
public override void Initialize()

View File

@ -157,24 +157,27 @@ namespace ENI2.DetailViewControls
{
EditLADGDialog eld = new EditLADGDialog();
eld.LADG = new LADG();
eld.LADG.MessageHeader = _ladgMessage;
eld.LADG.Identifier = LADG.GetNewIdentifier(_ladgMessage.Elements);
eld.Core = this.Core;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
this._ladgMessage.Elements.Add(eld.LADG);
eld.LADG.MessageHeader = _ladgMessage;
if (!this._ladgMessage.Elements.Contains(eld.LADG))
this._ladgMessage.Elements.Add(eld.LADG);
this.dataGridLADG.Items.Refresh();
eld.LADG = new LADG();
eld.LADG.MessageHeader = _ladgMessage;
eld.LADG.Identifier = LADG.GetNewIdentifier(_ladgMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.LADG);
};
if (eld.ShowDialog() ?? false)
{
eld.LADG.MessageHeader = _ladgMessage;
_ladgMessage.Elements.Add(eld.LADG);
if(!_ladgMessage.Elements.Contains(eld.LADG))
_ladgMessage.Elements.Add(eld.LADG);
this.dataGridLADG.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.LADG);
}
@ -197,28 +200,32 @@ namespace ENI2.DetailViewControls
private void DataGridLADG_EditRequested(DatabaseEntity obj)
{
LADG ladg = obj as LADG;
if(ladg != null)
EditLADGDialog eld = new EditLADGDialog();
eld.Core = this.Core;
eld.LADG = ladg;
eld.AddClicked += () =>
{
EditLADGDialog eld = new EditLADGDialog();
eld.Core = this.Core;
eld.LADG = ladg;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.LADG = new LADG();
eld.LADG.Identifier = LADG.GetNewIdentifier(_ladgMessage.Elements);
eld.CopyValuesToEntity();
if(!_ladgMessage.Elements.Contains(eld.LADG))
_ladgMessage.Elements.Add(eld.LADG);
eld.LADG.MessageHeader = _ladgMessage;
this.SublistElementChanged(Message.NotificationClass.LADG);
};
this.dataGridLADG.Items.Refresh();
if (eld.ShowDialog() ?? false)
{
this.dataGridLADG.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.LADG);
}
eld.LADG = new LADG();
eld.LADG.Identifier = LADG.GetNewIdentifier(_ladgMessage.Elements);
eld.LADG.MessageHeader = _ladgMessage;
this.SublistElementChanged(Message.NotificationClass.LADG);
};
if (eld.ShowDialog() ?? false)
{
if (!_ladgMessage.Elements.Contains(eld.LADG))
_ladgMessage.Elements.Add(eld.LADG);
this.dataGridLADG.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.LADG);
}
}
private void DataGridLADG_AddingNewItem(object sender, AddingNewItemEventArgs e)
@ -235,22 +242,24 @@ namespace ENI2.DetailViewControls
EditSERVDialog esd = new EditSERVDialog();
esd.SERV = new SERV();
esd.SERV.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
esd.SERV.MessageHeader = _servMessage;
esd.AddClicked += () =>
{
esd.CopyValuesToEntity();
_servMessage.Elements.Add(esd.SERV);
esd.SERV.MessageHeader = _servMessage;
if(!_servMessage.Elements.Contains(esd.SERV))
_servMessage.Elements.Add(esd.SERV);
this.dataGridSERV.Items.Refresh();
esd.SERV = new SERV();
esd.SERV.MessageHeader = _servMessage;
esd.SERV.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.SERV);
};
if(esd.ShowDialog() ?? false)
{
esd.SERV.MessageHeader = _servMessage;
_servMessage.Elements.Add(esd.SERV);
if(!_servMessage.Elements.Contains(esd.SERV))
_servMessage.Elements.Add(esd.SERV);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
@ -271,28 +280,29 @@ namespace ENI2.DetailViewControls
}
private void DataGridSERV_EditRequested(DatabaseEntity obj)
{
SERV serv = obj as SERV;
if(serv != null)
{
EditSERVDialog esd = new EditSERVDialog();
esd.SERV = obj as SERV;
esd.AddClicked += () =>
{
EditSERVDialog esd = new EditSERVDialog();
esd.SERV = serv;
esd.AddClicked += () =>
{
esd.CopyValuesToEntity();
esd.SERV = new SERV();
esd.SERV.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
esd.CopyValuesToEntity();
if(!_servMessage.Elements.Contains(esd.SERV))
_servMessage.Elements.Add(esd.SERV);
esd.SERV.MessageHeader = _servMessage;
this.SublistElementChanged(Message.NotificationClass.SERV);
};
this.dataGridSERV.Items.Refresh();
if (esd.ShowDialog() ?? false)
{
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
esd.SERV = new SERV();
esd.SERV.Identifier = SERV.GetNewIdentifier(_servMessage.Elements);
esd.SERV.MessageHeader = _servMessage;
this.SublistElementChanged(Message.NotificationClass.SERV);
};
if (esd.ShowDialog() ?? false)
{
if (!_servMessage.Elements.Contains(esd.SERV))
_servMessage.Elements.Add(esd.SERV);
this.dataGridSERV.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SERV);
}
}

View File

@ -101,26 +101,27 @@ namespace ENI2.DetailViewControls
private void DataGridShip2ShipActivities_CreateRequested()
{
ShipToShipActivitiesDuringLastTenPortFacilitiesCalled s2s = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
s2s.Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled);
EditShip2ShipActivitiesDialog epd = new EditShip2ShipActivitiesDialog();
epd.ShipToShipActivity = s2s;
epd.ShipToShipActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
epd.ShipToShipActivity.Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled);
epd.ShipToShipActivity.SEC = this._sec;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.ShipToShipActivity.SEC = this._sec;
this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(epd.ShipToShipActivity);
if(!this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(epd.ShipToShipActivity))
this._sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(epd.ShipToShipActivity);
this.dataGridShip2ShipActivities.Items.Refresh();
epd.ShipToShipActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
epd.ShipToShipActivity.SEC = this._sec;
epd.ShipToShipActivity.Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled);
this.SublistElementChanged(Message.NotificationClass.SEC);
};
if (epd.ShowDialog() ?? false)
{
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(epd.ShipToShipActivity);
epd.ShipToShipActivity.SEC = this._sec;
if(!_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(epd.ShipToShipActivity))
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(epd.ShipToShipActivity);
this.dataGridShip2ShipActivities.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SEC);
}
@ -151,14 +152,15 @@ namespace ENI2.DetailViewControls
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(ecpd.ShipToShipActivity);
this.dataGridShip2ShipActivities.Items.Refresh();
ecpd.ShipToShipActivity = new ShipToShipActivitiesDuringLastTenPortFacilitiesCalled();
ecpd.ShipToShipActivity.SEC = this._sec;
ecpd.ShipToShipActivity.Identifier = ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.GetNewIdentifier(_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled);
this.SublistElementChanged(Message.NotificationClass.SEC);
};
if (ecpd.ShowDialog() ?? false)
{
if (!_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Contains(ecpd.ShipToShipActivity))
_sec.ShipToShipActivitiesDuringLastTenPortFacilitiesCalled.Add(ecpd.ShipToShipActivity);
this.dataGridShip2ShipActivities.Items.Refresh();
// signal up
this.dataGridShip2ShipActivities.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SEC);
}
}
@ -174,26 +176,28 @@ namespace ENI2.DetailViewControls
private void DataGridLast10PortFacilities_CreateRequested()
{
LastTenPortFacilitiesCalled l10c = new LastTenPortFacilitiesCalled();
l10c.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled);
EditLast10PortFacilitiesDialog epd = new EditLast10PortFacilitiesDialog();
epd.LastTenPortFacilitiesCalled = l10c;
epd.LastTenPortFacilitiesCalled = new LastTenPortFacilitiesCalled();
epd.LastTenPortFacilitiesCalled.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled);
epd.LastTenPortFacilitiesCalled.SEC = this._sec;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.LastTenPortFacilitiesCalled.SEC = this._sec;
this._sec.LastTenPortFacilitesCalled.Add(epd.LastTenPortFacilitiesCalled);
if(!this._sec.LastTenPortFacilitesCalled.Contains(epd.LastTenPortFacilitiesCalled))
this._sec.LastTenPortFacilitesCalled.Add(epd.LastTenPortFacilitiesCalled);
this.dataGridLast10PortFacilities.Items.Refresh();
epd.LastTenPortFacilitiesCalled = new LastTenPortFacilitiesCalled();
epd.LastTenPortFacilitiesCalled.SEC = this._sec;
epd.LastTenPortFacilitiesCalled.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled);
this.SublistElementChanged(Message.NotificationClass.SEC);
};
if (epd.ShowDialog() ?? false)
{
_sec.LastTenPortFacilitesCalled.Add(epd.LastTenPortFacilitiesCalled);
epd.LastTenPortFacilitiesCalled.SEC = this._sec;
if(!_sec.LastTenPortFacilitesCalled.Contains(epd.LastTenPortFacilitiesCalled))
_sec.LastTenPortFacilitesCalled.Add(epd.LastTenPortFacilitiesCalled);
this.dataGridLast10PortFacilities.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SEC);
}
@ -224,14 +228,15 @@ namespace ENI2.DetailViewControls
_sec.LastTenPortFacilitesCalled.Add(ecpd.LastTenPortFacilitiesCalled);
this.dataGridLast10PortFacilities.Items.Refresh();
ecpd.LastTenPortFacilitiesCalled = new LastTenPortFacilitiesCalled();
ecpd.LastTenPortFacilitiesCalled.SEC = this._sec;
ecpd.LastTenPortFacilitiesCalled.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(_sec.LastTenPortFacilitesCalled);
this.SublistElementChanged(Message.NotificationClass.SEC);
};
if (ecpd.ShowDialog() ?? false)
{
if (!_sec.LastTenPortFacilitesCalled.Contains(ecpd.LastTenPortFacilitiesCalled))
_sec.LastTenPortFacilitesCalled.Add(ecpd.LastTenPortFacilitiesCalled);
this.dataGridLast10PortFacilities.Items.Refresh();
// signal up
this.dataGridLast10PortFacilities.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SEC);
}
}
@ -243,6 +248,8 @@ namespace ENI2.DetailViewControls
#endregion
#region event handler
private void SecurityDetailControl_Loaded(object sender, RoutedEventArgs e)
{
@ -276,6 +283,8 @@ namespace ENI2.DetailViewControls
this.checkBoxKielCanalPassagePlanned.Checked += CheckBoxKielCanalPassagePlanned_Checked;
}
#endregion
#region enable / disable controls
private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e)

View File

@ -53,7 +53,7 @@
<TextBox Name="textBoxCallsign" Grid.Column="4" Grid.Row="1" Text="{Binding CallSign}" Margin="2" VerticalContentAlignment="Center"/>
<ComboBox Name="comboBoxTransportMode" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" Margin="2" SelectedValue="{Binding TransportMode}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<ComboBox Name="comboBoxFlag" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Margin="2" SelectedValue="{Binding Flag}" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<enictrl:LocodeControl x:Name="locodePortOfRegistry" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" LocodeValue="{Binding PortOfRegistry}" />
<enictrl:LocodeControl x:Name="locodePortOfRegistry" Grid.Column="4" Grid.Row="3" Grid.ColumnSpan="2" LocodeValue="{Binding PortOfRegistry, Mode=TwoWay}" />
<xctk:IntegerUpDown Name="integerUpDownGrossTonnage" Grid.Column="1" Grid.Row="4" Margin="2" Value="{Binding GrossTonnage}" ShowButtonSpinner="False" TextAlignment="Left"/>
<Label Content="t" Grid.Column="2" Grid.Row="4" />

View File

@ -17,7 +17,7 @@
</Grid.RowDefinitions>
<GroupBox Name="groupBoxTowageOnArrival" Grid.Row="0" Header="{x:Static p:Resources.textTowageOnArrival}">
<enictrl:ENIDataGrid x:Name="dataGridTowageOnArrival" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnArrivalName}" IsReadOnly="True" Width="Auto" />
@ -42,7 +42,7 @@
</GroupBox>
<GroupBox Name="groupBoxTowageOnDeparture" Grid.Row="1" Header="{x:Static p:Resources.textTowageOnDeparture}">
<enictrl:ENIDataGrid x:Name="dataGridTowageOnDeparture" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0">
AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns>
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
<DataGridTextColumn Header="{x:Static p:Resources.textName}" Binding="{Binding TowageOnDepartureName}" IsReadOnly="True" Width="Auto" />

View File

@ -46,10 +46,9 @@ namespace ENI2.DetailViewControls
private void copyItem(object sender, RoutedEventArgs e)
{
// aus dem aktuell selektierten TOWA Element ein neues TOWD Element machen
if ((this.dataGridTowageOnArrival.SelectedItems != null) && (this.dataGridTowageOnArrival.SelectedItems.Count == 1))
if (this.dataGridTowageOnArrival.SelectedItems != null)
{
TOWA selectedTOWA = this.dataGridTowageOnArrival.SelectedItems[0] as TOWA;
if (selectedTOWA != null)
foreach(TOWA selectedTOWA in this.dataGridTowageOnArrival.SelectedItems)
{
TOWD copyTOWD = new TOWD();
copyTOWD.MessageHeader = _towdMessage;
@ -112,28 +111,28 @@ namespace ENI2.DetailViewControls
private void DataGridTowageOnDeparture_CreateRequested()
{
TOWD towd = new TOWD();
towd.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
EditTOWDialog ebd = new EditTOWDialog();
ebd.TOWD = towd;
ebd.IsDeparture = true;
ebd.TOWD = new TOWD();
ebd.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
ebd.TOWD.MessageHeader = this._towdMessage;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this._towdMessage.Elements.Add(ebd.TOWD);
ebd.TOWD.MessageHeader = _towdMessage;
if(!this._towdMessage.Elements.Contains(ebd.TOWD))
this._towdMessage.Elements.Add(ebd.TOWD);
this.dataGridTowageOnDeparture.Items.Refresh();
ebd.TOWD = new TOWD();
ebd.TOWD.MessageHeader = _towdMessage;
ebd.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.TOWD);
};
if (ebd.ShowDialog() ?? false)
{
ebd.CopyValuesToEntity();
ebd.TOWD.MessageHeader = _towdMessage;
_towdMessage.Elements.Add(ebd.TOWD);
{
if(!this._towdMessage.Elements.Contains(ebd.TOWD))
_towdMessage.Elements.Add(ebd.TOWD);
this.dataGridTowageOnDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWD);
}
@ -155,29 +154,28 @@ namespace ENI2.DetailViewControls
private void DataGridTowageOnDeparture_EditRequested(DatabaseEntity obj)
{
TOWD towd = obj as TOWD;
if (towd != null)
EditTOWDialog eld = new EditTOWDialog();
eld.IsDeparture = true;
eld.TOWD = obj as TOWD;
eld.AddClicked += () =>
{
EditTOWDialog eld = new EditTOWDialog();
eld.IsDeparture = true;
eld.TOWD = towd;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.TOWD = new TOWD();
eld.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
eld.CopyValuesToEntity();
if(!_towdMessage.Elements.Contains(eld.TOWD))
_towdMessage.Elements.Add(eld.TOWD);
eld.TOWD.MessageHeader = _towdMessage;
this.SublistElementChanged(Message.NotificationClass.TOWD);
};
this.dataGridTowageOnDeparture.Items.Refresh();
eld.TOWD = new TOWD();
eld.TOWD.Identifier = TOWD.GetNewIdentifier(this._towdMessage.Elements);
eld.TOWD.MessageHeader = _towdMessage;
this.SublistElementChanged(Message.NotificationClass.TOWD);
};
if (eld.ShowDialog() ?? false)
{
eld.CopyValuesToEntity();
this.dataGridTowageOnDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWD);
}
if (eld.ShowDialog() ?? false)
{
if (!this._towdMessage.Elements.Contains(eld.TOWD))
this._towdMessage.Elements.Add(eld.TOWD);
this.dataGridTowageOnDeparture.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWD);
}
}
@ -192,28 +190,28 @@ namespace ENI2.DetailViewControls
private void DataGridTowageOnArrival_CreateRequested()
{
TOWA towa = new TOWA();
towa.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
EditTOWDialog ebd = new EditTOWDialog();
ebd.TOWA = towa;
ebd.IsDeparture = false;
ebd.TOWA = new TOWA();
ebd.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
ebd.TOWA.MessageHeader = this._towaMessage;
ebd.AddClicked += () =>
{
ebd.CopyValuesToEntity();
this._towaMessage.Elements.Add(ebd.TOWA);
ebd.TOWA.MessageHeader = _towaMessage;
if(!this._towaMessage.Elements.Contains(ebd.TOWA))
this._towaMessage.Elements.Add(ebd.TOWA);
this.dataGridTowageOnArrival.Items.Refresh();
ebd.TOWA = new TOWA();
ebd.TOWA.MessageHeader = _towaMessage;
ebd.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
this.SublistElementChanged(Message.NotificationClass.TOWA);
};
if (ebd.ShowDialog() ?? false)
{
ebd.CopyValuesToEntity();
ebd.TOWA.MessageHeader = _towaMessage;
_towaMessage.Elements.Add(ebd.TOWA);
if(!this._towaMessage.Elements.Contains(ebd.TOWA))
_towaMessage.Elements.Add(ebd.TOWA);
this.dataGridTowageOnArrival.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWA);
}
@ -235,29 +233,29 @@ namespace ENI2.DetailViewControls
private void DataGridTowageOnArrival_EditRequested(DatabaseEntity obj)
{
TOWA towa = obj as TOWA;
if (towa != null)
EditTOWDialog eld = new EditTOWDialog();
eld.IsDeparture = false;
eld.TOWA = obj as TOWA;
eld.AddClicked += () =>
{
EditTOWDialog eld = new EditTOWDialog();
eld.IsDeparture = false;
eld.TOWA = towa;
eld.AddClicked += () =>
{
eld.CopyValuesToEntity();
eld.TOWA = new TOWA();
eld.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
eld.CopyValuesToEntity();
if(!_towaMessage.Elements.Contains(eld.TOWA))
_towaMessage.Elements.Add(eld.TOWA);
eld.TOWA.MessageHeader = _towaMessage;
this.SublistElementChanged(Message.NotificationClass.TOWA);
};
this.dataGridTowageOnArrival.Items.Refresh();
if (eld.ShowDialog() ?? false)
{
eld.CopyValuesToEntity();
this.dataGridTowageOnArrival.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWA);
}
eld.TOWA = new TOWA();
eld.TOWA.Identifier = TOWA.GetNewIdentifier(this._towaMessage.Elements);
eld.TOWA.MessageHeader = _towaMessage;
this.SublistElementChanged(Message.NotificationClass.TOWA);
};
if (eld.ShowDialog() ?? false)
{
if (!this._towaMessage.Elements.Contains(eld.TOWA))
this._towaMessage.Elements.Add(eld.TOWA);
this.dataGridTowageOnArrival.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.TOWA);
}
}

View File

@ -14,8 +14,8 @@
<GroupBox Name="wasGroupBox" Header="{x:Static p:Resources.textWaste}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="220" />
<RowDefinition Height="360" />
<RowDefinition Height="250" />
<RowDefinition Height="330*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
@ -31,6 +31,7 @@
<RowDefinition Height="28" />
<RowDefinition Height="28" />
<RowDefinition Height="*" />
<RowDefinition Height="28" />
</Grid.RowDefinitions>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_AccurateDetailsGiven" Margin="0,0,10,0"/>
<!--TextBlock Grid.Row="0" Grid.Column="0" Text="{x:Static p:Resources.textAccurateDetailsGiven}" Name="label_ETAToPortOfCall" Margin="0,0,10,0" TextWrapping="Wrap" FontSize="10"/-->
@ -39,12 +40,13 @@
<Label HorizontalContentAlignment="Right" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textLastPortWasteDischarge}" Name="label_WasteLastPortDischarged" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteDisposalServiceProviders}" Name="label_WasteDisposalServiceProviders" Margin="0,0,10,0"/>
<Label HorizontalContentAlignment="Right" Grid.Row="0" Grid.Column="2" Content="{x:Static p:Resources.textValidExemption}" Name="label_ValidExemption" Margin="0,0,10,0"/>
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness}" />
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption}" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxWasteDisposal" Margin="2" SelectedIndex="{Binding WasteDisposalDelivery}"/>
<DatePicker Grid.Row="2" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate}" />
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort}" />
<CheckBox Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Name="checkBoxAccurateCorrectDetails" IsChecked="{Binding ConfirmationOfCorrectness, Mode=TwoWay}" />
<CheckBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center" Name="checkBoxValidExemption" IsChecked="{Binding WasteDisposalValidExemption, Mode=TwoWay}" />
<ComboBox Grid.Row="1" Grid.Column="1" Name="comboBoxWasteDisposal" Margin="2" SelectedIndex="{Binding WasteDisposalDelivery, Mode=TwoWay}"/>
<DatePicker Grid.Row="2" Grid.Column="1" Name="datePickerDateLastDisposal" Margin="2" SelectedDate="{Binding LastWasteDisposalDate, Mode=TwoWay}" />
<enictrl:LocodeControl Grid.Row="3" Grid.Column="1" x:Name="locodeCtrlLastWastePort" LocodeValue="{Binding LastWasteDisposalPort, Mode=TwoWay}" />
<TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Name="textBoxWasteDisposalServiceProviders" Text="{Binding WasteDisposalServiceProviderText}" Margin="2" />
<Button Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2" Name="buttonAddMissingEntries" Content="{x:Static p:Resources.textAddMissingEntries}" Margin="2" Click="buttonAddMissingEntries_Click"/>
</Grid>
<enictrl:ENIDataGrid x:Name="dataGridWaste" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
SelectionMode="Single" AutoGenerateColumns="False" Margin="0,5,0,0" Grid.Row="1">

View File

@ -56,6 +56,46 @@ namespace ENI2.DetailViewControls
this.datePickerDateLastDisposal.IsEnabled = on;
}
private void buttonAddMissingEntries_Click(object sender, RoutedEventArgs e)
{
bool changedWaste = false;
// Convenience Methode, die fehlende Waste Einträge ergänzt (interessant bei "manuellen" Anmeldungen)
foreach(int wasteCode in WAS.DKWasteCodes)
{
bool codeFound = false;
foreach(Waste waste in this._was.Waste)
{
if(waste.WasteType.HasValue && waste.WasteType.Value == wasteCode)
{
codeFound = true;
break;
}
}
if(!codeFound)
{
Waste newWaste = new Waste();
newWaste.Identifier = DatabaseEntity.GetNewIdentifier(this._was.Waste);
newWaste.WAS = _was;
newWaste.WasteAmountGeneratedTillNextPort_MTQ = 0;
newWaste.WasteAmountRetained_MTQ = 0;
newWaste.WasteCapacity_MTQ = 0;
newWaste.WasteDescription = "";
newWaste.WasteDisposalAmount_MTQ = 0;
newWaste.WasteDisposalPort = "ZZUKN";
newWaste.WasteDisposedAtLastPort_MTQ = 0;
newWaste.WasteType = wasteCode;
this._was.Waste.Add(newWaste);
changedWaste = true;
}
}
if(changedWaste)
{
this.SublistElementChanged(Message.NotificationClass.WAS);
this.dataGridWaste.Items.Refresh();
}
}
public override void Initialize()
{
base.Initialize();
@ -104,26 +144,27 @@ namespace ENI2.DetailViewControls
private void DataGridWaste_CreateRequested()
{
Waste waste = new Waste();
waste.Identifier = Waste.GetNewIdentifier(_was.Waste);
EditWasteDialog epd = new EditWasteDialog();
epd.Waste = waste;
epd.Waste = new Waste();
epd.Waste.Identifier = Waste.GetNewIdentifier(_was.Waste);
epd.Waste.WAS = this._was;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.Waste.WAS = this._was;
this._was.Waste.Add(epd.Waste);
if(!this._was.Waste.Contains(epd.Waste))
this._was.Waste.Add(epd.Waste);
this.dataGridWaste.Items.Refresh();
epd.Waste = new Waste();
epd.Waste.WAS = this._was;
epd.Waste.Identifier = Waste.GetNewIdentifier(_was.Waste);
this.SublistElementChanged(Message.NotificationClass.WAS);
};
if (epd.ShowDialog() ?? false)
{
_was.Waste.Add(epd.Waste);
epd.Waste.WAS = this._was;
if(!this._was.Waste.Contains(epd.Waste))
_was.Waste.Add(epd.Waste);
this.dataGridWaste.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.WAS);
}
@ -145,28 +186,27 @@ namespace ENI2.DetailViewControls
private void DataGridWaste_EditRequested(DatabaseEntity obj)
{
Waste waste = obj as Waste;
if (waste != null)
EditWasteDialog epd = new EditWasteDialog();
epd.Waste = obj as Waste;
epd.AddClicked += () =>
{
EditWasteDialog epd = new EditWasteDialog();
epd.Waste = waste;
epd.AddClicked += () =>
{
epd.CopyValuesToEntity();
epd.CopyValuesToEntity();
if(!_was.Waste.Contains(epd.Waste))
_was.Waste.Add(epd.Waste);
this.dataGridWaste.Items.Refresh();
epd.Waste = new Waste();
epd.Waste.Identifier = Waste.GetNewIdentifier(_was.Waste);
epd.Waste.WAS = _was;
this.SublistElementChanged(Message.NotificationClass.WAS);
};
this.dataGridWaste.Items.Refresh();
epd.Waste = new Waste();
epd.Waste.Identifier = Waste.GetNewIdentifier(_was.Waste);
epd.Waste.WAS = _was;
this.SublistElementChanged(Message.NotificationClass.WAS);
};
if (epd.ShowDialog() ?? false)
{
this.dataGridWaste.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.WAS);
}
if (epd.ShowDialog() ?? false)
{
if (!_was.Waste.Contains(epd.Waste))
_was.Waste.Add(epd.Waste);
this.dataGridWaste.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.WAS);
}
}
@ -194,6 +234,6 @@ namespace ENI2.DetailViewControls
}
#endregion
}
}

View File

@ -35,8 +35,8 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationVersion>3.7.2.%2a</ApplicationVersion>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.7.4.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -19,7 +19,7 @@
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Label Content="{x:Static p:Resources.textBunkerType}" Grid.Row="0" Grid.Column="0" />
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxBunkerType" Margin="2" MinLines="2" MaxLength="100" VerticalContentAlignment="Center"/>
<TextBox Grid.Row="0" Grid.Column="1" Width="auto" Name="textBoxBunkerType" Margin="2" MaxLength="100" VerticalContentAlignment="Center"/>
<Label Content="{x:Static p:Resources.textBunkerQuantity}" Grid.Row="1" Grid.Column="0" />
<xctk:DoubleUpDown Grid.Row="1" Grid.Column="1" Name="doubleUpDownBunkerQuantity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2,2,2,2" FormatString="N1" TextAlignment="Left" />
</Grid>

View File

@ -99,7 +99,8 @@ Copyright (c) 2017 schick Informatik
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="4" Name="decimalUpDownEmergencyTemperature" Margin="2" FormatString="N2" ShowButtonSpinner="False" TextAlignment="Left"/>
<Label Grid.Row="6" Grid.Column="5" Content="°C" />
<xctk:IntegerUpDown Grid.Row="7" Grid.Column="1" Name="integerUpDownNumberOfPackages" Margin="2" ShowButtonSpinner="False" Minimum="0" TextAlignment="Left"/>
<ComboBox Name="comboBoxPackageType" Grid.Column="4" Grid.Row="7" Grid.ColumnSpan="2" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" IsEditable="True" StaysOpenOnEdit="True" IsTextSearchEnabled="True" />
<ComboBox Name="comboBoxPackageType" Grid.Column="4" Grid.Row="7" Grid.ColumnSpan="2" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" SelectionChanged="comboBoxPackageType_SelectionChanged" />
<TextBox Grid.Row="7" Grid.Column="6" Grid.ColumnSpan="3" Margin="2" Name="textBoxPackageType" VerticalContentAlignment="Center" TextChanged="textBoxPackageType_TextChanged"/>
<CheckBox Grid.Row="8" Grid.Column="1" Name="checkBoxLimitedQuantities" VerticalAlignment="Center" Margin="2"/>
<CheckBox Grid.Row="8" Grid.Column="4" Name="checkBoxExceptedQuantities" VerticalAlignment="Center" Margin="2" />
<xctk:DoubleUpDown Grid.Row="8" Grid.Column="7" Name="doubleUpDownCargoVolume" Margin="2" Minimum="0" ShowButtonSpinner="False" FormatString="N3" TextAlignment="Left"/>

View File

@ -60,10 +60,12 @@ namespace ENI2.EditControls
this.checkBoxMarinePollutant.IsChecked = this.IMDG.MarinePollutant;
this.comboBoxPackageType.ItemsSource = HAZ.PackageTypes;
//this.comboBoxPackageType.KeyUp += ComboBox_KeyUp;
this.comboBoxPackageType.SelectedValue = this.IMDG.PackageType;
this.comboBoxPackingGroup.ItemsSource = GlobalStructures.packingGroups;
//this.comboBoxPackingGroup.KeyUp += ComboBox_KeyUp;
//if((this.IMDG.PackageType != null) && HAZ.PackageTypes.ContainsKey(this.IMDG.PackageType))
// this.comboBoxPackageType.SelectedValue = this.IMDG.PackageType;
this.textBoxPackageType.Text = this.IMDG.PackageType;
this.comboBoxPackingGroup.ItemsSource = GlobalStructures.packingGroups;
this.comboBoxPackingGroup.SelectedIndex = (int) (this.IMDG.PackingGroup ?? -1);
this.locodeControlPortOfDischarge.LocodeValue = this.IMDG.PortOfDischarge;
@ -84,7 +86,7 @@ namespace ENI2.EditControls
this.IMDG.Flashpoint_CEL = this.textBoxFlashpoint.Text.Trim();
this.IMDG.Identifier = this.textBoxIdentifier.Text.Trim();
this.IMDG.IMOClass = this.textBoxIMOClass.Text.Trim();
this.IMDG.PackageType = this.comboBoxPackageType.SelectedValue as string;
this.IMDG.PackageType = this.textBoxPackageType.Text.Trim();
this.IMDG.ProperShippingName = this.textBoxProperShippingName.Text.Trim();
this.IMDG.Remarks = this.textBoxRemarks.Text.Trim();
this.IMDG.StowagePosition = this.textBoxStowagePosition.Text.Trim();
@ -121,5 +123,20 @@ namespace ENI2.EditControls
{
this.CopyValuesToEntity();
}
private void comboBoxPackageType_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
{
if(this.comboBoxPackageType.SelectedValue != null)
this.textBoxPackageType.Text = this.comboBoxPackageType.SelectedValue as string;
}
private void textBoxPackageType_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
{
string pText = this.textBoxPackageType.Text;
if (pText.IsNullOrEmpty() || !HAZ.PackageTypes.ContainsKey(pText))
this.comboBoxPackageType.SelectedIndex = -1;
else
this.comboBoxPackageType.SelectedValue = pText;
}
}
}

View File

@ -28,28 +28,27 @@
<Label Name="labelCode" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textCode}" />
<Label Name="labelDescription" Grid.Row="1" Grid.Column="0" Content="{x:Static p:Resources.textDescription}" />
<Label Name="labelAmountWasteDischarged" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textWasteAmountDischargedLastPort}" />
<Label Name="labelAmountDisposed" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textWasteAmountToBeDisposed}" />
<Label Name="labelMaxWasteCapacity" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteMaxCapacity}" />
<Label Name="labelWasteAmountRetained" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textWasteRetained}" />
<Label Name="labelPortOfDeliver" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textWastePortOfDelivery}" />
<Label Name="labelEstimatedWasteGenerated" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textWasteGeneratedUntilNextPort}" />
<Label Name="labelAmountDisposed" Grid.Row="2" Grid.Column="0" Content="{x:Static p:Resources.textWasteAmountToBeDisposed}" />
<Label Name="labelMaxWasteCapacity" Grid.Row="3" Grid.Column="0" Content="{x:Static p:Resources.textWasteMaxCapacity}" />
<Label Name="labelWasteAmountRetained" Grid.Row="4" Grid.Column="0" Content="{x:Static p:Resources.textWasteRetained}" />
<Label Name="labelPortOfDeliver" Grid.Row="5" Grid.Column="0" Content="{x:Static p:Resources.textWastePortOfDelivery}" />
<Label Name="labelEstimatedWasteGenerated" Grid.Row="6" Grid.Column="0" Content="{x:Static p:Resources.textWasteGeneratedUntilNextPort}" />
<Label Name="labelAmountWasteDischarged" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textWasteAmountDischargedLastPort}" />
<ComboBox Name="comboBoxWasteCode" Grid.Row="0" Grid.Column="1" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
<Label Name="labelWasteCodeText" Grid.Row="0" Grid.Column="2" />
<TextBox Name="textBoxDescription" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Width="auto" MaxLength="100" />
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountWasteDischargedLastPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="5" Grid.Column="1" Name="doubleUpDownAmountRetained" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Row="6" Grid.Column="1" x:Name="locodePortOfDeliveryRemainingWaste" />
<xctk:DoubleUpDown Grid.Row="7" Grid.Column="1" Name="doubleUpDownAmountGeneratedTilNextPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="4" Grid.Column="1" Name="doubleUpDownAmountRetained" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<enictrl:LocodeControl Grid.Row="5" Grid.Column="1" x:Name="locodePortOfDeliveryRemainingWaste" />
<xctk:DoubleUpDown Grid.Row="6" Grid.Column="1" Name="doubleUpDownAmountGeneratedTilNextPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="7" Grid.Column="1" Name="doubleUpDownAmountWasteDischargedLastPort" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "2" Grid.Column="2" />
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "3" Grid.Column="2" />
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "4" Grid.Column="2" />
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "5" Grid.Column="2" />
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "6" Grid.Column="2" />
<Label Content="{x:Static p:Resources.textCubicMeters}" Grid.Row = "7" Grid.Column="2" />
</Grid>

View File

@ -647,6 +647,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Add missing entries.
/// </summary>
public static string textAddMissingEntries {
get {
return ResourceManager.GetString("textAddMissingEntries", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Administrator.
/// </summary>
@ -2078,6 +2087,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Import from SEC.
/// </summary>
public static string textImportFromSEC {
get {
return ResourceManager.GetString("textImportFromSEC", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to IMSBC item.
/// </summary>
@ -2780,6 +2798,15 @@ namespace ENI2.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to This only works if the grid is empty!.
/// </summary>
public static string textOnlyIfGridIsEmpty {
get {
return ResourceManager.GetString("textOnlyIfGridIsEmpty", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Operations.
/// </summary>

View File

@ -1513,4 +1513,13 @@
<data name="textPassengerImported" xml:space="preserve">
<value>{0} passengers imported</value>
</data>
<data name="textAddMissingEntries" xml:space="preserve">
<value>Add missing entries</value>
</data>
<data name="textImportFromSEC" xml:space="preserve">
<value>Import from SEC</value>
</data>
<data name="textOnlyIfGridIsEmpty" xml:space="preserve">
<value>This only works if the grid is empty!</value>
</data>
</root>

View File

@ -76,6 +76,10 @@ namespace ENI2.Util
"III"
};
public static string[] PackingGroups
{
get { return packingGroups; }
}
public static List<string> EdiCodes
{

Binary file not shown.

View File

@ -77,8 +77,7 @@ namespace SendNSWMessageService
if (this.processRunning) return;
else this.processRunning = true;
}
bool sendSucceeded;
if (DBManager.Instance.Connect(Properties.Settings.Default.ConnectionString))
{
@ -96,16 +95,47 @@ namespace SendNSWMessageService
if ((core.InitialHIS == Message.NSWProvider.DUDR) || (core.InitialHIS == Message.NSWProvider.DUDR_TEST))
{
// HIS-NORD: alles auf einmal
sendSucceeded = bsmd.hisnord.Request.CreateSendFile(core, messages, (core.InitialHIS == Message.NSWProvider.DUDR_TEST));
// HIS-NORD: alles auf einmal
// 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;
}
else
{
foreach (Message message in messages)
{
bool? sendResult = bsmd.hisnord.Request.CreateSendFile(core, messages, (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());
if (!sendSucceeded) core.BSMDStatusInternal = MessageCore.BSMDStatus.FAILURE;
else core.BSMDStatusInternal = MessageCore.BSMDStatus.SENT;
DBManager.Instance.Save(core);
}
else
{
bool sendSucceeded;
#region DBH / Dakosy Logik
@ -146,7 +176,9 @@ namespace SendNSWMessageService
{
// Eine Nachricht mit dem Status "Suspended / Zurückgestellt" wird so lange nicht
// versendet, bis im ENI der Status wieder explizit zurückgesetzt wird (16.4.16)
if (message.InternalStatus == Message.BSMDStatus.SUSPENDED) continue;
// Update 5.10.17: Alles was nicht explizit auf "TOSEND" steht wird nicht verschickt!
if (message.InternalStatus != Message.BSMDStatus.TOSEND) continue;
// "virtuelle" Messages nicht versenden (DK, EU)
if ((message.MessageNotificationClass == Message.NotificationClass.STO) ||
@ -176,9 +208,9 @@ namespace SendNSWMessageService
(message.MessageNotificationClass == Message.NotificationClass.TRANSIT))
continue;
if ((message.InternalStatus != Message.BSMDStatus.CONFIRMED) &&
(message.InternalStatus != Message.BSMDStatus.SENT))
{
//if ((message.InternalStatus != Message.BSMDStatus.CONFIRMED) &&
//(message.InternalStatus != Message.BSMDStatus.SENT))
//{
// 28.12.2015: Das über "Overview" eingestellte HIS ist immer "führend" (zumindest aktuell zum Testen)
// if (message.HIS == Message.NSWProvider.UNDEFINED)
@ -190,7 +222,7 @@ namespace SendNSWMessageService
message.ReportingParty = DBManager.Instance.GetReportingPartyDict()[core.DefaultReportingPartyId.Value];
}
toSendMessageList.Add(message);
}
//}
}
}
@ -208,9 +240,17 @@ namespace SendNSWMessageService
{
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;
if (!XtraSendLogic.ShouldSendMessage(message))
{
message.InternalStatus = Message.BSMDStatus.SUSPENDED;
}
else
{
sendSucceeded = bsmd.dbh.Request.SendMessage(message, (message.HIS == Message.NSWProvider.DBH_TEST));
if (!sendSucceeded)
message.InternalStatus = Message.BSMDStatus.SEND_FAILED;
}
break;
case Message.NSWProvider.DAKOSY:
@ -264,7 +304,7 @@ namespace SendNSWMessageService
}
bsmd.hisnord.transmitter.CallTransmitter(true);
bsmd.hisnord.transmitter.CallTransmitter(false);
// bsmd.hisnord.transmitter.CallTransmitter(false); // wird aktuell nicht funktionieren
// ob test oder nicht ist in stat. dict gespeicher
bsmd.hisnord.Request.ReadResponseFiles();

View File

@ -1081,14 +1081,23 @@ namespace bsmd.ExcelReadService
}
NOA_NOD noa_nod = noa_nodMessage.Elements[0] as NOA_NOD;
DateTime? eta = reader.ReadDateTime("NOA_NOD.ETADateToPortOfCall", "NOA_NOD.ETATimeToPortOfCall");
if (messageCore.IsTransit)
{
noa_nod.ETAToKielCanal = messageCore.ETAKielCanal;
if (eta.HasValue)
noa_nod.ETAToKielCanal = eta;
else
noa_nod.ETAToKielCanal = messageCore.ETAKielCanal;
}
else
{
if (eta.HasValue)
noa_nod.ETAToPortOfCall = eta;
else
noa_nod.ETAToPortOfCall = messageCore.ETA;
noa_nod.ETAToPortOfCall = messageCore.ETA;
// Zeit muss zurückkonvertiert werden, da toUniversalTime() kodiert
if(noa_nod.ETAToPortOfCall.HasValue)
reader.Conf.ConfirmDate("NOA_NOD.ETAToPortOfCall", noa_nod.ETAToPortOfCall.Value.ToLocalTime(), ExcelReader.ReadState.OK);

View File

@ -67,7 +67,7 @@ namespace bsmd.database
else
{
scmd.Parameters.AddWithValue(@"ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET BunkerFuelType = @P2, BunkerFuelQuantity_TNE = @P3, Identifiery = @P4 WHERE Id = @ID", this.Tablename);
scmd.CommandText = string.Format("UPDATE {0} SET BunkerFuelType = @P2, BunkerFuelQuantity_TNE = @P3, Identifier = @P4 WHERE Id = @ID", this.Tablename);
}
}

View File

@ -166,7 +166,7 @@ namespace bsmd.database
/// </summary>
/// <param name="sublist">Vorhandene Position</param>
/// <returns>Name des neuen Identifiers, der so nicht in der Liste vorkommt</returns>
public static string GetNewIdentifier(IEnumerable<DatabaseEntity> sublist)
public static string GetNewIdentifier(IEnumerable<DatabaseEntity> sublist, string prefix=null)
{
int maxVal = -1;
string maxString = null;
@ -199,12 +199,8 @@ namespace bsmd.database
// Spezialbalkone
try
{
Type type = sublist.GetType().GetGenericArguments()[0];
if (type == typeof(IMDGPosition)) return "IMDG-1";
if (type == typeof(IBCPosition)) return "IBC-1";
if (type == typeof(IGCPosition)) return "IGC-1";
if (type == typeof(IMSBCPosition)) return "IMSBC-1";
if (type == typeof(MARPOL_Annex_I_Position)) return "MARPOL-1";
if (prefix != null)
return string.Format("{0}1", prefix);
}
catch
{

View File

@ -250,6 +250,27 @@ namespace bsmd.database
#endregion
#region public helper
internal void SetBoolsToFalse()
{
this.AwareOfFurtherInfections = false;
this.InfectedAreaVisited = false;
this.MDHSimplification = false;
this.MedicalConsulted = false;
this.NonAccidentalDeathsDuringVoyage = false;
this.NumberOfIllPersonsHigherThanExpected = false;
this.SanitaryControlReinspectionRequired = false;
this.SanitaryMeasuresApplied = false;
this.SickAnimalOrPetOnBoard = false;
this.SickPersonsOnBoard = false;
this.StowawaysDetected = false;
this.SuspisionInfectiousNature = false;
this.ValidSanitaryControlExemptionOrCertificateOnBoard = false;
}
#endregion
#region abstract method implementation
public override void PrepareSave(System.Data.IDbCommand cmd)

View File

@ -343,6 +343,22 @@ namespace bsmd.database
/// </summary>
public bool HasReminder { get; set; }
/// <summary>
/// ENI display flag: send complete
/// </summary>
public bool SuccessfullySent
{
get
{
return this.SystemErrorList.IsNullOrEmpty() &&
this.ViolationList.IsNullOrEmpty() &&
this.ErrorList.IsNullOrEmpty() &&
this.Status.HasValue &&
!(this.Reset) &&
(this.Status.Value == MessageStatus.ACCEPTED);
}
}
#endregion
#region IDatabaseEntity implementation
@ -590,7 +606,7 @@ namespace bsmd.database
public void SaveElements()
{
foreach (DatabaseEntity dbEntity in this.Elements)
{
{
DBManager.Instance.Save(dbEntity);
if (dbEntity is ISublistContainer)
{

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("Informatikbüro Daniel Schick")]
[assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("3.7.3")]
[assembly: AssemblyInformationalVersion("3.7.4")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 Informatikbüro Daniel Schick. All rights reserved.")]
[assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("3.7.3.*")]
[assembly: AssemblyVersion("3.7.4.*")]

View File

@ -159,8 +159,17 @@ namespace bsmd.database
// abgesehen von "Listen" für die Nachrichtenklassen auch untergeordnete Elemente erzeugen
DatabaseEntity classElement = null;
if (!Message.IsListClass(notificationClass))
{
classElement = DBManager.CreateMessage(notificationClass);
// CH: 6.10.17: Für die manuelle Eingabe (wird leider nicht ganz auszuschließen sein) wäre es hilfreich, wenn alle Checkboxen nicht leer sind, sondern False beinhalten.
if(notificationClass == Message.NotificationClass.MDH)
{
((MDH)classElement).SetBoolsToFalse();
}
}
DBManager.Instance.Save(message);
if (classElement != null) // null für Visit/Transit/List

View File

@ -51,7 +51,8 @@ namespace bsmd.database
#region static methods
public static bool? CheckConditions(MessageCore core, List<Message> messages, ConditionGroup cGroup, List<ValidationField> failedFieldList, out string message)
public static bool? CheckConditions(MessageCore core, List<Message> messages, ConditionGroup cGroup, List<ValidationField> failedFieldList,
out string message)
{
bool? result = null;
message = "";
@ -59,12 +60,57 @@ namespace bsmd.database
try
{
// Bedingungen validieren
foreach (ValidationCondition condition in cGroup.Conditions)
{
object[] otherargs = null;
// switch case type
// den aktuellen Wert bestimmen
if(!ValidationRule.ValidationFieldDict.ContainsKey(condition.FieldName))
{
// TODO: Warnung absetzen
continue;
}
ValidationField vf = ValidationRule.ValidationFieldDict[condition.FieldName];
// Wert aus den Daten auslesen
// Dabei muss unterschieden werden: 1. skalarer Wert
// 2. Wert eines Listenelements
//
// als Rückgabe würde dann benötigt der Name des Property, die beteiligte Klasse und natürlich der Identifier (Index) wenn es eine Listenposition war
//if(vf.)
//object value = vf.PropertyInfo.GetValue()
switch(condition.ConditionOperator)
{
case ConditionOperatorEnum.EQUAL:
break;
case ConditionOperatorEnum.NOT_EQUAL:
break;
case ConditionOperatorEnum.LESS:
break;
case ConditionOperatorEnum.GREATER:
break;
case ConditionOperatorEnum.NULL:
break;
case ConditionOperatorEnum.NOT_NULL:
break;
}

View File

@ -13,6 +13,7 @@ namespace bsmd.database
public class ValidationRule : DatabaseEntity
{
private static List<ValidationField> _validationFields = null;
private static Dictionary<string, ValidationField> _validationFieldDict = null;
public ValidationRule()
{
@ -51,6 +52,7 @@ namespace bsmd.database
if(_validationFields == null)
{
_validationFields = new List<ValidationField>();
_validationFieldDict = new Dictionary<string, ValidationField>();
_validationFields.AddRange(GetFieldsForClass(typeof(AGNT), false, Message.NotificationClass.AGNT));
_validationFields.AddRange(GetFieldsForClass(typeof(ATA), false, Message.NotificationClass.ATA));
_validationFields.AddRange(GetFieldsForClass(typeof(ATD), false, Message.NotificationClass.ATD));
@ -97,6 +99,7 @@ namespace bsmd.database
_validationFields.AddRange(GetFieldsForClass(typeof(WAS), false, Message.NotificationClass.WAS));
_validationFields.AddRange(GetFieldsForClass(typeof(Waste), true, null));
_validationFields.AddRange(GetFieldsForClass(typeof(WasteDisposalServiceProvider), true, null));
_validationFields.AddRange(GetFieldsForClass(typeof(MessageCore), false, null));
// Ergebnis sortiert nach Klassenname - Propertyname
_validationFields.Sort(delegate (ValidationField c1, ValidationField c2) {
@ -106,11 +109,17 @@ namespace bsmd.database
return result;
});
// Dictionary aufladen
foreach (ValidationField vf in _validationFields)
_validationFieldDict[vf.FullName] = vf;
}
return _validationFields;
}
}
public static Dictionary<string, ValidationField> ValidationFieldDict { get { return _validationFieldDict; } }
private static List<ValidationField> GetFieldsForClass(Type objType, bool isList, Message.NotificationClass? notificationClass)
{
List<ValidationField> result = new List<ValidationField>();

View File

@ -21,8 +21,8 @@ namespace bsmd.database
private List<DatabaseEntity> waste = new List<DatabaseEntity>();
private static readonly int[] dkWasteCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2300, 2309, 3000, 5100, 5200, 5300, 2300 };
private static readonly string[] dkWasteTypes = { "Waste oils - Sludge", "Waste oils - Bilge water", "Waste oils - Other", "Garbage - Food waste", "Garbage - Plastic", "Garbage - Other", "Garbage - Other - Cooking oil", "Garbage - Other - Incinerator ashes and clinkers", "Garbage - Other", "Garbage - Other - Animal carcasses", "Sewage", "Cargo residues - Marpol Annex I - Other", "Cargo residues - Marpol Annex II - Other", "Cargo residues - Marpol Annex V - Other", "Garbage - Other" };
private static readonly int[] dkWasteCodes = { 1100, 1200, 1300, 2100, 2200, 2300, 2311, 2308, 2600, 2300, 2309, 3000, 5100, 5200, 5300, 2300 };
private static readonly string[] dkWasteTypes = { "Waste oils - Sludge", "Waste oils - Bilge water", "Waste oils - Other", "Garbage - Food waste", "Garbage - Plastic", "Garbage - Other", "Garbage - Other - Cooking oil", "Garbage - Other - Incinerator ashes and clinkers", "Operational wastes", "Garbage - Other", "Garbage - Other - Animal carcasses", "Sewage", "Cargo residues - Marpol Annex I - Other", "Cargo residues - Marpol Annex II - Other", "Cargo residues - Marpol Annex V - Other", "Garbage - Other" };
public WAS()
{

View File

@ -42,7 +42,8 @@ namespace bsmd.dbh
return false;
}
if (!XtraSendLogic.ShouldSendMessage(message)) return false;
message.StatusInfo = ""; // zurücksetzen analog zu HIS-Nord (5.10.17)
message.ChangedBy = "";
// map message to dbh NSWRequest object
Dbh_Osis_Answ_Ws client = new Dbh_Osis_Answ_Ws();

View File

@ -114,7 +114,7 @@ namespace bsmd.hisnord
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;
noteMessageDict[notificationClass].SentAt = DateTime.Now;
DBManager.Instance.DeleteSystemErrors(noteMessageDict[notificationClass]);
result = noteMessageDict[notificationClass];
}
@ -125,10 +125,10 @@ namespace bsmd.hisnord
return result;
}
public static bool CreateSendFile(MessageCore core, List<Message> messages, bool useTest)
public static bool? CreateSendFile(MessageCore core, List<Message> messages, bool useTest)
{
bool retval = true;
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();
@ -192,6 +192,7 @@ namespace bsmd.hisnord
}
else // liegt noch nichts vor, Id muss beantragt werden
{
retval = true;
_nsw.conveyance.Items = new object[4];
_nsw.conveyance.ItemsElementName = new ItemsChoiceType[4];
_nsw.conveyance.Items[0] = core.Shipname;
@ -202,6 +203,7 @@ namespace bsmd.hisnord
_nsw.conveyance.ItemsElementName[2] = ItemsChoiceType.PortOfCall;
_nsw.conveyance.Items[3] = core.IsTransit ? core.ETAKielCanal : core.ETA; // TODO Datum konvertieren?
_nsw.conveyance.ItemsElementName[3] = ItemsChoiceType.ETAPortOfCall;
containsData = true;
}
#endregion
@ -209,6 +211,7 @@ namespace bsmd.hisnord
#region NSW message area
Message visitTransitHeader = null;
Message message = null;
// wir wissen noch nicht wieviele es werden, von daher erstmal eine Liste!
List<Items1ChoiceType> items1ChoiceType = new List<Items1ChoiceType>();
@ -219,12 +222,11 @@ namespace bsmd.hisnord
// nur das "STORNO" Element hinzufügen
items1ChoiceType.Add(Items1ChoiceType.STORNO);
items1.Add(ytype.Y);
containsData = true;
}
else
{
Message message = null;
{
if(!core.IsTransit)
{
@ -245,6 +247,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.STAT);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_STAT);
@ -290,6 +293,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.NOA_NOD);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_NOANOD);
@ -347,6 +351,7 @@ namespace bsmd.hisnord
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_ATA);
@ -367,6 +372,7 @@ namespace bsmd.hisnord
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_ATD);
@ -389,6 +395,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.POBA);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_POBA);
@ -417,6 +424,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.POBD);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_POBD);
@ -445,6 +453,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.NAME);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_NameOfMaster);
@ -466,6 +475,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.TIEFA);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_TIEFA);
@ -489,6 +499,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.TIEFD);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_TIEFD);
@ -514,6 +525,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.INFO);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_INFO);
@ -555,6 +567,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.BKRA);
if (message != null) {
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_BKRA);
@ -582,6 +595,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.BKRD);
if (message != null) {
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_BKRD);
@ -613,6 +627,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.HAZA);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_HAZA);
@ -676,6 +691,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.HAZD);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_HAZD);
@ -741,6 +757,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.LADG);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_LADG);
@ -783,6 +800,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.SERV);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_SERV);
@ -815,6 +833,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.PRE72H);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_PRE72H);
@ -863,6 +882,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.SEC);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_SEC);
@ -1026,6 +1046,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.MDH);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_MDH);
@ -1086,18 +1107,19 @@ namespace bsmd.hisnord
if (sanitaryMeasuresApplied)
{
sanitarydetail[] sanitaryDetails = new sanitarydetail[mdh.SanitaryMeasuresDetails.Count];
//sanitarydetail[] sanitaryDetails = new sanitarydetail[mdh.SanitaryMeasuresDetails.Count];
for (int j = 0; j < mdh.SanitaryMeasuresDetails.Count; j++)
{
SanitaryMeasuresDetail detail = mdh.SanitaryMeasuresDetails[j] as SanitaryMeasuresDetail;
sanitaryDetails[j] = new sanitarydetail();
sanitarydetail aSanitaryDetail = new sanitarydetail();
//sanitaryDetails[j] = new sanitarydetail();
if (detail.SanitaryMeasuresDate.HasValue)
sanitaryDetails[j].SanitaryMeasuresDate = detail.SanitaryMeasuresDate.Value;
sanitaryDetails[j].SanitaryMeasuresLocation = detail.SanitaryMeasuresLocation;
sanitaryDetails[j].SanitaryMeasuresType = detail.SanitaryMeasuresType;
}
mdh_items.Add(sanitaryDetails);
mdh_types.Add(ItemsChoiceType5.SanitaryMeasuresDetails);
aSanitaryDetail.SanitaryMeasuresDate = detail.SanitaryMeasuresDate.Value;
aSanitaryDetail.SanitaryMeasuresLocation = detail.SanitaryMeasuresLocation;
aSanitaryDetail.SanitaryMeasuresType = detail.SanitaryMeasuresType;
mdh_items.Add(aSanitaryDetail);
mdh_types.Add(ItemsChoiceType5.SanitaryMeasuresDetails);
}
}
mdh_items.Add((mdh.StowawaysDetected ?? false) ? yorntype.Y : yorntype.N);
@ -1188,6 +1210,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.WAS);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_WAS);
@ -1289,6 +1312,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.BPOL);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_BPOL);
@ -1327,6 +1351,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.PAS);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_PAS);
@ -1374,6 +1399,7 @@ namespace bsmd.hisnord
#region CREW
message = GetSendMessage(Message.NotificationClass.CREW);
if (message != null) {
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_CREW);
@ -1416,6 +1442,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.TOWA);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_TOWA);
@ -1480,6 +1507,7 @@ namespace bsmd.hisnord
message = GetSendMessage(Message.NotificationClass.TOWD);
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_TOWD);
@ -1545,6 +1573,7 @@ namespace bsmd.hisnord
if (message != null)
{
containsData = true;
if (message.Reset)
{
items1ChoiceType.Add(Items1ChoiceType.RESET_AGNT);
@ -1581,23 +1610,30 @@ namespace bsmd.hisnord
#endregion
#region serialize and save message
string outputDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot,
Properties.Settings.Default.OutputDir);
if (containsData)
{
string outputDir = Path.Combine(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot,
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);
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;
}
coreFilenameDict[core] = filename;
coreUseTestDict[core] = useTest;
#endregion
}
@ -1679,7 +1715,7 @@ namespace bsmd.hisnord
pi.GeneralCargoIBC = imdgPosition.GeneralCargoIBC.Value ? yorntype.Y : yorntype.N;
pi.ContainerNumber = imdgPosition.ContainerNumber;
pi.VehicleLicenseNumber = imdgPosition.VehicleLicenseNumber;
if(imdgPosition.StowagePosition.IsNullOrEmpty())
if(!imdgPosition.StowagePosition.IsNullOrEmpty())
{
pi.Item = imdgPosition.StowagePosition;
}

View File

@ -26,9 +26,12 @@ namespace bsmd.hisnord
public static void CallTransmitter(bool useTest)
{
string rootDir = useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot;
Process process = new Process();
process.StartInfo.FileName = Properties.Settings.Default.Transmitter;
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(useTest ? Properties.Settings.Default.TestTransmitterRoot : Properties.Settings.Default.LiveTransmitterRoot);
process.StartInfo.WorkingDirectory = rootDir;
process.StartInfo.FileName = Path.Combine(rootDir, Properties.Settings.Default.Transmitter);
//_log.Debug(process.StartInfo.FileName);
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = false;
@ -38,7 +41,12 @@ namespace bsmd.hisnord
// Ergebnis ab
process.Start();
int timeout = Properties.Settings.Default.BatchTimeoutMins * 1000 * 60; // convert to ms
process.WaitForExit((timeout == 0) ? int.MaxValue : timeout);
if(!process.WaitForExit((timeout == 0) ? int.MaxValue : timeout))
{
_log.WarnFormat("Transmitter process not exited within {0} minute", Properties.Settings.Default.BatchTimeoutMins);
// kill Kill KILLLL!!!
process.Kill();
}
string errorString = process.StandardError.ReadToEnd();
if(!errorString.IsNullOrEmpty())
_log.ErrorFormat("HIS-Nord transmitter error: {0}", errorString);