fixed removing of assignments (delete times record), removed green bg color
This commit is contained in:
parent
b7a8b3aa1b
commit
d439b7ed12
@ -65,14 +65,6 @@
|
|||||||
<ColumnDefinition Width=".5*" />
|
<ColumnDefinition Width=".5*" />
|
||||||
<ColumnDefinition Width=".5*" />
|
<ColumnDefinition Width=".5*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<ComboBox Name="comboBoxDepartureBerth" Grid.Column="1" Margin="2" DisplayMemberPath="Name" SelectedValuePath="Id">
|
|
||||||
<ComboBox.ContextMenu>
|
|
||||||
<ContextMenu>
|
|
||||||
<MenuItem Header="{x:Static p:Resources.textClearValue}" Name="contextMenuItemArrivalBerth" Click="contextMenuItemArrivalBerth_Click" />
|
|
||||||
</ContextMenu>
|
|
||||||
</ComboBox.ContextMenu>
|
|
||||||
</ComboBox>
|
|
||||||
<ComboBox Name="comboBoxArrivalBerth" Grid.Column="0" Margin="2" DisplayMemberPath="Name" SelectedValuePath="Id">
|
<ComboBox Name="comboBoxArrivalBerth" Grid.Column="0" Margin="2" DisplayMemberPath="Name" SelectedValuePath="Id">
|
||||||
<ComboBox.ContextMenu>
|
<ComboBox.ContextMenu>
|
||||||
<ContextMenu>
|
<ContextMenu>
|
||||||
@ -80,6 +72,13 @@
|
|||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
</ComboBox.ContextMenu>
|
</ComboBox.ContextMenu>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
<ComboBox Name="comboBoxDepartureBerth" Grid.Column="1" Margin="2" DisplayMemberPath="Name" SelectedValuePath="Id">
|
||||||
|
<ComboBox.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="{x:Static p:Resources.textClearValue}" Name="contextMenuItemArrivalBerth" Click="contextMenuItemArrivalBerth_Click" />
|
||||||
|
</ContextMenu>
|
||||||
|
</ComboBox.ContextMenu>
|
||||||
|
</ComboBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<xctk:DateTimePicker x:Name="datePickerETA" Grid.Column="3" Grid.Row="2" Margin="2" Format="Custom" FormatString="dd.MM. yyyy HH:mm" IsEnabled="False"/>
|
<xctk:DateTimePicker x:Name="datePickerETA" Grid.Column="3" Grid.Row="2" Margin="2" Format="Custom" FormatString="dd.MM. yyyy HH:mm" IsEnabled="False"/>
|
||||||
|
|||||||
@ -71,26 +71,61 @@ namespace BreCalClient
|
|||||||
name = _agency?.Name;
|
name = _agency?.Name;
|
||||||
if (name != null) agentName = name;
|
if (name != null) agentName = name;
|
||||||
this.labelAgent.Content = name ?? "- / -";
|
this.labelAgent.Content = name ?? "- / -";
|
||||||
|
if(_agency == null)
|
||||||
|
{
|
||||||
|
// clear agency display controls
|
||||||
|
this.labelAgencyBerth.Content = "";
|
||||||
|
this.labelAgencyETAETDValue.Content = "";
|
||||||
|
this.textBlockAgencyRemarks.Text = "";
|
||||||
|
this.textBlockAgencyBerthRemarks.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
_mooring = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.MOORING);
|
_mooring = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.MOORING);
|
||||||
name = _mooring?.Name;
|
name = _mooring?.Name;
|
||||||
this.labelMooring.Content = name ?? "- / -";
|
this.labelMooring.Content = name ?? "- / -";
|
||||||
|
if(_mooring == null)
|
||||||
|
{
|
||||||
|
this.labelMooringETAETDValue.Content = "";
|
||||||
|
this.textBlockMooringRemarks.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
_pilot = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.PILOT);
|
_pilot = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.PILOT);
|
||||||
name = _pilot?.Name;
|
name = _pilot?.Name;
|
||||||
this.labelPilot.Content = name ?? "- / - ";
|
this.labelPilot.Content = name ?? "- / - ";
|
||||||
|
if(_pilot == null)
|
||||||
|
{
|
||||||
|
this.labelPilotETAETDValue.Content = "";
|
||||||
|
this.textBlockPilotRemarks.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
_tug = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.TUG);
|
_tug = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.TUG);
|
||||||
name = _tug?.Name;
|
name = _tug?.Name;
|
||||||
this.labelTug.Content = name ?? "- / - ";
|
this.labelTug.Content = name ?? "- / - ";
|
||||||
|
if(_tug == null)
|
||||||
|
{
|
||||||
|
this.labelTugETAETDValue.Content = "";
|
||||||
|
this.textBlockTugRemarks.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
_port_administration = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.PORT_ADMINISTRATION);
|
_port_administration = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.PORT_ADMINISTRATION);
|
||||||
name = _port_administration?.Name;
|
name = _port_administration?.Name;
|
||||||
this.labelPortAuthority.Content = name ?? "- / - ";
|
this.labelPortAuthority.Content = name ?? "- / - ";
|
||||||
|
if(_port_administration == null)
|
||||||
|
{
|
||||||
|
this.labelPortAuthorityETAETDValue.Content = "";
|
||||||
|
this.textBlockPortAuthorityRemarks.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
_terminal = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.TERMINAL);
|
_terminal = this.ShipcallControlModel.GetParticipantForType(Extensions.ParticipantType.TERMINAL);
|
||||||
name = _terminal?.Name;
|
name = _terminal?.Name;
|
||||||
this.labelTerminal.Content = name ?? "- / - ";
|
this.labelTerminal.Content = name ?? "- / - ";
|
||||||
|
if(_terminal == null)
|
||||||
|
{
|
||||||
|
this.textBlockTerminalRemarks.Text = "";
|
||||||
|
this.textBlockTerminalBerthRemarks.Text = "";
|
||||||
|
this.labelTerminalBerth.Content = "";
|
||||||
|
this.labelOperationsStart.Content = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TERMINAL) && (App.Participant.Id == _terminal?.Id))
|
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TERMINAL) && (App.Participant.Id == _terminal?.Id))
|
||||||
{
|
{
|
||||||
@ -171,9 +206,9 @@ namespace BreCalClient
|
|||||||
ShipcallControlModel.TrafficLightMode resultColor = (ShipcallControlModel.TrafficLightMode) (this.ShipcallControlModel?.Shipcall?.Evaluation ?? 0); // der nullable Operator hier ist so doof, die VS validation blickts einfach nicht
|
ShipcallControlModel.TrafficLightMode resultColor = (ShipcallControlModel.TrafficLightMode) (this.ShipcallControlModel?.Shipcall?.Evaluation ?? 0); // der nullable Operator hier ist so doof, die VS validation blickts einfach nicht
|
||||||
switch (resultColor)
|
switch (resultColor)
|
||||||
{
|
{
|
||||||
case ShipcallControlModel.TrafficLightMode.GREEN:
|
//case ShipcallControlModel.TrafficLightMode.GREEN:
|
||||||
this.Background = Brushes.LightGreen;
|
// this.Background = Brushes.LightGreen;
|
||||||
break;
|
// break;
|
||||||
case ShipcallControlModel.TrafficLightMode.YELLOW:
|
case ShipcallControlModel.TrafficLightMode.YELLOW:
|
||||||
this.Background= Brushes.LightYellow;
|
this.Background= Brushes.LightYellow;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -142,6 +142,33 @@ namespace BreCalClient
|
|||||||
await _api.TimesPutAsync(times);
|
await _api.TimesPutAsync(times);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if somebody just removed an assignment it is gone fom AssignedParticipants, but there is still a
|
||||||
|
// times record left which must be removed
|
||||||
|
|
||||||
|
List<Times> deleteTimes = new();
|
||||||
|
foreach (Times times in this.Times)
|
||||||
|
{
|
||||||
|
bool foundTimes = false;
|
||||||
|
foreach (ParticipantAssignment pa in this.AssignedParticipants.Values)
|
||||||
|
{
|
||||||
|
if((pa.ParticipantId == times.ParticipantId) && (pa.Type == times.ParticipantType))
|
||||||
|
{
|
||||||
|
foundTimes = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!foundTimes)
|
||||||
|
{
|
||||||
|
deleteTimes.Add(times);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach(Times times in deleteTimes)
|
||||||
|
{
|
||||||
|
_api.TimesDelete(times.Id);
|
||||||
|
this.Times.Remove(times);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user