added terminal times control
This commit is contained in:
parent
370270eaf3
commit
df641f096c
@ -529,20 +529,15 @@ namespace BreCalClient
|
||||
}
|
||||
}
|
||||
|
||||
private async void Sc_EditTimesRequested(ShipcallControl obj, Times? times)
|
||||
private async void Sc_EditTimesRequested(ShipcallControl obj, Times? times, Extensions.ParticipantType participantType)
|
||||
{
|
||||
// show a dialog that lets the user create / update times for the given shipcall
|
||||
IEditTimesControl etc = new EditTimesControl();
|
||||
IEditTimesControl etc = (participantType == ParticipantType.TERMINAL) ? new EditTimesTerminalControl() : new EditTimesControl();
|
||||
bool wasEdit = false;
|
||||
if (times != null)
|
||||
{
|
||||
etc.Times = times;
|
||||
wasEdit = true;
|
||||
|
||||
// wie bekommen wir hier raus ob terminal oder agent gemeint ist?
|
||||
|
||||
// if(_participantLookupDict[times.ParticipantId].Type ==
|
||||
|
||||
wasEdit = true;
|
||||
}
|
||||
if(etc.ShowDialog() ?? false)
|
||||
{
|
||||
|
||||
2
src/BreCalClient/Properties/Settings.Designer.cs
generated
2
src/BreCalClient/Properties/Settings.Designer.cs
generated
@ -12,7 +12,7 @@ namespace BreCalClient.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
@ -10,6 +10,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
|
||||
namespace BreCalClient
|
||||
{
|
||||
/// <summary>
|
||||
@ -31,7 +32,7 @@ namespace BreCalClient
|
||||
|
||||
public event Action<ShipcallControl>? EditRequested;
|
||||
|
||||
public event Action<ShipcallControl, Times?>? EditTimesRequested;
|
||||
internal event Action<ShipcallControl, Times?, Extensions.ParticipantType>? EditTimesRequested;
|
||||
|
||||
#endregion
|
||||
|
||||
@ -220,7 +221,7 @@ namespace BreCalClient
|
||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.AGENCY) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.AGENCY)))
|
||||
{
|
||||
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.AGENCY);
|
||||
this.EditTimesRequested?.Invoke(this, times);
|
||||
this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.AGENCY);
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,7 +230,7 @@ namespace BreCalClient
|
||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.MOORING) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.MOORING)))
|
||||
{
|
||||
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.MOORING);
|
||||
this.EditTimesRequested?.Invoke(this, times);
|
||||
this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.MOORING);
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,7 +239,7 @@ namespace BreCalClient
|
||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.PORT_ADMINISTRATION) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.PORT_ADMINISTRATION)))
|
||||
{
|
||||
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PORT_ADMINISTRATION);
|
||||
this.EditTimesRequested?.Invoke(this, times);
|
||||
this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.PORT_ADMINISTRATION);
|
||||
}
|
||||
}
|
||||
|
||||
@ -247,7 +248,7 @@ namespace BreCalClient
|
||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.PILOT) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.PILOT)))
|
||||
{
|
||||
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.PILOT);
|
||||
this.EditTimesRequested?.Invoke(this, times);
|
||||
this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.PILOT);
|
||||
}
|
||||
}
|
||||
|
||||
@ -256,7 +257,7 @@ namespace BreCalClient
|
||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TUG) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.TUG)))
|
||||
{
|
||||
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TUG);
|
||||
this.EditTimesRequested?.Invoke(this, times);
|
||||
this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.TUG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,7 +266,7 @@ namespace BreCalClient
|
||||
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TERMINAL) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.TERMINAL)))
|
||||
{
|
||||
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL);
|
||||
this.EditTimesRequested?.Invoke(this, times);
|
||||
this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.TERMINAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user