Enter Agency Time as highlighted suggestion for other participants (not terminal)
This commit is contained in:
parent
bc6a9e95ea
commit
36e853fcda
@ -7,6 +7,7 @@ using BreCalClient.misc.Model;
|
|||||||
using System;
|
using System;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
using Xceed.Wpf.Toolkit;
|
||||||
|
|
||||||
namespace BreCalClient
|
namespace BreCalClient
|
||||||
{
|
{
|
||||||
@ -29,6 +30,8 @@ namespace BreCalClient
|
|||||||
|
|
||||||
public Times Times { get; set; } = new();
|
public Times Times { get; set; } = new();
|
||||||
|
|
||||||
|
public Times? AgencyTimes { get; set; } = new();
|
||||||
|
|
||||||
public ShipcallControlModel ShipcallModel { get; set; } = new();
|
public ShipcallControlModel ShipcallModel { get; set; } = new();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -37,8 +40,8 @@ namespace BreCalClient
|
|||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
this.CopyToControls();
|
|
||||||
this.EnableControls();
|
this.EnableControls();
|
||||||
|
this.CopyToControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonOK_Click(object sender, RoutedEventArgs e)
|
private void buttonOK_Click(object sender, RoutedEventArgs e)
|
||||||
@ -93,7 +96,20 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
this.textBoxRemarks.Text = this.Times.Remarks;
|
this.textBoxRemarks.Text = this.Times.Remarks;
|
||||||
this.datePickerETABerth.Value = this.Times.EtaBerth;
|
this.datePickerETABerth.Value = this.Times.EtaBerth;
|
||||||
|
if(this.datePickerETABerth.IsEnabled && (this.Times.EtaBerth == null) && (this.AgencyTimes?.EtaBerth != null) && (ShipcallModel.Shipcall?.Type == ShipcallType.Arrival))
|
||||||
|
{
|
||||||
|
this.datePickerETABerth.Value = this.AgencyTimes.EtaBerth;
|
||||||
|
WatermarkTextBox? tb = this.datePickerETABerth.Template.FindName("PART_TextBox", this.datePickerETABerth) as WatermarkTextBox;
|
||||||
|
if (tb != null) { tb.Focus(); tb.SelectAll(); }
|
||||||
|
}
|
||||||
this.datePickerETDBerth.Value = this.Times.EtdBerth;
|
this.datePickerETDBerth.Value = this.Times.EtdBerth;
|
||||||
|
if(this.datePickerETDBerth.IsEnabled && (this.Times.EtdBerth == null) && (this.AgencyTimes?.EtdBerth != null) && ((ShipcallModel.Shipcall?.Type == ShipcallType.Departure) || (ShipcallModel.Shipcall?.Type == ShipcallType.Shifting)))
|
||||||
|
{
|
||||||
|
this.datePickerETDBerth.Value = this.AgencyTimes.EtdBerth;
|
||||||
|
WatermarkTextBox? tb = this.datePickerETDBerth.Template.FindName("PART_TextBox", this.datePickerETDBerth) as WatermarkTextBox;
|
||||||
|
if (tb != null) tb.SelectAll();
|
||||||
|
}
|
||||||
|
|
||||||
this.datePickerLockTime.Value = this.Times.LockTime;
|
this.datePickerLockTime.Value = this.Times.LockTime;
|
||||||
this.datePickerZoneEntry.Value = this.Times.ZoneEntry;
|
this.datePickerZoneEntry.Value = this.Times.ZoneEntry;
|
||||||
this.datePickerATA.Value = this.Times.Ata;
|
this.datePickerATA.Value = this.Times.Ata;
|
||||||
|
|||||||
@ -854,10 +854,14 @@ namespace BreCalClient
|
|||||||
if( obj.ShipcallControlModel == null) { return; }
|
if( obj.ShipcallControlModel == null) { return; }
|
||||||
if (!obj.ShipcallControlModel.AssignedParticipants.ContainsKey(participantType)) return; // no assigment means no dialog my friend
|
if (!obj.ShipcallControlModel.AssignedParticipants.ContainsKey(participantType)) return; // no assigment means no dialog my friend
|
||||||
|
|
||||||
|
Times? agencyTimes = obj.ShipcallControlModel.GetTimesForParticipantType(ParticipantType.AGENCY);
|
||||||
|
|
||||||
// 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 = (participantType == ParticipantType.TERMINAL) ? new EditTimesTerminalControl() : new EditTimesControl();
|
IEditTimesControl etc = (participantType == ParticipantType.TERMINAL) ? new EditTimesTerminalControl() : new EditTimesControl();
|
||||||
etc.Title = obj.ShipcallControlModel.Title;
|
etc.Title = obj.ShipcallControlModel.Title;
|
||||||
etc.ShipcallModel = obj.ShipcallControlModel;
|
etc.ShipcallModel = obj.ShipcallControlModel;
|
||||||
|
if (etc is EditTimesControl control)
|
||||||
|
control.AgencyTimes = agencyTimes;
|
||||||
|
|
||||||
bool wasEdit = false;
|
bool wasEdit = false;
|
||||||
if (times != null)
|
if (times != null)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user