added terminal times control

This commit is contained in:
Daniel Schick 2023-09-18 20:36:44 +02:00
parent 370270eaf3
commit df641f096c
3 changed files with 12 additions and 16 deletions

View File

@ -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 // 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; bool wasEdit = false;
if (times != null) if (times != null)
{ {
etc.Times = times; etc.Times = times;
wasEdit = true; wasEdit = true;
// wie bekommen wir hier raus ob terminal oder agent gemeint ist?
// if(_participantLookupDict[times.ParticipantId].Type ==
} }
if(etc.ShowDialog() ?? false) if(etc.ShowDialog() ?? false)
{ {

View File

@ -12,7 +12,7 @@ namespace BreCalClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [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 { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));

View File

@ -10,6 +10,7 @@ using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
namespace BreCalClient namespace BreCalClient
{ {
/// <summary> /// <summary>
@ -31,7 +32,7 @@ namespace BreCalClient
public event Action<ShipcallControl>? EditRequested; public event Action<ShipcallControl>? EditRequested;
public event Action<ShipcallControl, Times?>? EditTimesRequested; internal event Action<ShipcallControl, Times?, Extensions.ParticipantType>? EditTimesRequested;
#endregion #endregion
@ -220,7 +221,7 @@ namespace BreCalClient
if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.AGENCY) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.AGENCY))) if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.AGENCY) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.AGENCY)))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(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))) if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.MOORING) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.MOORING)))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(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))) 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); 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))) if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.PILOT) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.PILOT)))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(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))) if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TUG) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.TUG)))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(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))) if (App.Participant.IsTypeFlagSet(Extensions.ParticipantType.TERMINAL) && (App.Participant.Id == this.ShipcallControlModel?.GetParticipantIdForType(Extensions.ParticipantType.TERMINAL)))
{ {
Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL); Times? times = this.ShipcallControlModel?.GetTimesForParticipantType(Extensions.ParticipantType.TERMINAL);
this.EditTimesRequested?.Invoke(this, times); this.EditTimesRequested?.Invoke(this, times, Extensions.ParticipantType.TERMINAL);
} }
} }