Make nomination comboboxes dependant on selected harbour
This commit is contained in:
parent
3b3601baeb
commit
de94d63a41
@ -4,7 +4,6 @@
|
||||
|
||||
using BreCalClient.misc.Model;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Windows;
|
||||
using static BreCalClient.Extensions;
|
||||
|
||||
@ -42,22 +41,27 @@ namespace BreCalClient
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.comboBoxMooring.ItemsSource = BreCalLists.Participants_Mooring;
|
||||
this.comboBoxPilot.ItemsSource = BreCalLists.Participants_Pilot;
|
||||
this.comboBoxTug.ItemsSource = BreCalLists.Participants_Tug;
|
||||
this.comboBoxTerminal.ItemsSource = BreCalLists.Participants_Terminal;
|
||||
|
||||
if ((this.ShipcallModel != null) && (this.ShipcallModel.Shipcall != null))
|
||||
this.comboBoxArrivalBerth.ItemsSource = BreCalLists.GetBerthsByPort(this.ShipcallModel.Shipcall.PortId);
|
||||
else
|
||||
this.comboBoxArrivalBerth.ItemsSource = BreCalLists.Berths;
|
||||
{
|
||||
int portId = this.ShipcallModel.Shipcall.PortId;
|
||||
this.comboBoxArrivalBerth.ItemsSource = BreCalLists.GetBerthsByPort(portId);
|
||||
this.comboBoxMooring.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.MOORING);
|
||||
this.comboBoxPilot.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.PILOT);
|
||||
this.comboBoxTug.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.TUG);
|
||||
this.comboBoxTerminal.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.TERMINAL);
|
||||
}
|
||||
|
||||
this.CopyToControls();
|
||||
|
||||
this.Title = this.ShipcallModel?.Title;
|
||||
|
||||
Participant? p = null;
|
||||
if (this.ShipcallModel != null)
|
||||
{
|
||||
if (this.ShipcallModel.AssignedParticipants.ContainsKey(ParticipantType.AGENCY))
|
||||
p = BreCalLists.Participants.Find(x => x.Id == this.ShipcallModel.AssignedParticipants[ParticipantType.AGENCY].ParticipantId);
|
||||
}
|
||||
|
||||
bool allowBSMD = false;
|
||||
if (p != null)
|
||||
|
||||
@ -49,23 +49,27 @@ namespace BreCalClient
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.comboBoxMooring.ItemsSource = BreCalLists.Participants_Mooring;
|
||||
this.comboBoxPilot.ItemsSource = BreCalLists.Participants_Pilot;
|
||||
this.comboBoxTug.ItemsSource = BreCalLists.Participants_Tug;
|
||||
this.comboBoxTerminal.ItemsSource = BreCalLists.Participants_Terminal;
|
||||
|
||||
if ((this.ShipcallModel != null) && (this.ShipcallModel.Shipcall != null))
|
||||
this.comboBoxDepartureBerth.ItemsSource = BreCalLists.GetBerthsByPort(this.ShipcallModel.Shipcall.PortId);
|
||||
else
|
||||
this.comboBoxDepartureBerth.ItemsSource = BreCalLists.Berths;
|
||||
{
|
||||
int portId = this.ShipcallModel.Shipcall.PortId;
|
||||
this.comboBoxDepartureBerth.ItemsSource = BreCalLists.GetBerthsByPort(portId);
|
||||
this.comboBoxMooring.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.MOORING);
|
||||
this.comboBoxPilot.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.PILOT);
|
||||
this.comboBoxTug.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.TUG);
|
||||
this.comboBoxTerminal.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.TERMINAL);
|
||||
}
|
||||
|
||||
this.CopyToControls();
|
||||
|
||||
this.Title = this.ShipcallModel?.Title;
|
||||
|
||||
Participant? p = null;
|
||||
if (this.ShipcallModel != null)
|
||||
{
|
||||
if (this.ShipcallModel.AssignedParticipants.ContainsKey(ParticipantType.AGENCY))
|
||||
p = BreCalLists.Participants.Find(x => x.Id == this.ShipcallModel.AssignedParticipants[ParticipantType.AGENCY].ParticipantId);
|
||||
|
||||
}
|
||||
bool allowBSMD = false;
|
||||
if (p != null)
|
||||
{
|
||||
|
||||
@ -43,30 +43,29 @@ namespace BreCalClient
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.comboBoxMooring.ItemsSource = BreCalLists.Participants_Mooring;
|
||||
this.comboBoxPilot.ItemsSource = BreCalLists.Participants_Pilot;
|
||||
this.comboBoxTug.ItemsSource = BreCalLists.Participants_Tug;
|
||||
this.comboBoxTerminal.ItemsSource = BreCalLists.Participants_Terminal;
|
||||
|
||||
if ((this.ShipcallModel != null) && (this.ShipcallModel.Shipcall != null))
|
||||
{
|
||||
List<Berth> availableBerths = BreCalLists.GetBerthsByPort(this.ShipcallModel.Shipcall.PortId);
|
||||
int portId = this.ShipcallModel.Shipcall.PortId;
|
||||
List<Berth> availableBerths = BreCalLists.GetBerthsByPort(portId);
|
||||
this.comboBoxArrivalBerth.ItemsSource = availableBerths;
|
||||
this.comboBoxDepartureBerth.ItemsSource = availableBerths;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.comboBoxDepartureBerth.ItemsSource = BreCalLists.Berths;
|
||||
this.comboBoxArrivalBerth.ItemsSource = BreCalLists.Berths;
|
||||
this.comboBoxMooring.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.MOORING);
|
||||
this.comboBoxPilot.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.PILOT);
|
||||
this.comboBoxTug.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.TUG);
|
||||
this.comboBoxTerminal.ItemsSource = BreCalLists.GetParticipants(portId, ParticipantType.TERMINAL);
|
||||
}
|
||||
|
||||
this.CopyToControls();
|
||||
|
||||
this.Title = this.ShipcallModel.Title;
|
||||
|
||||
Participant? p = null;
|
||||
|
||||
if (this.ShipcallModel != null)
|
||||
{
|
||||
this.Title = this.ShipcallModel.Title;
|
||||
if (this.ShipcallModel.AssignedParticipants.ContainsKey(ParticipantType.AGENCY))
|
||||
p = BreCalLists.Participants.Find(x => x.Id == this.ShipcallModel.AssignedParticipants[ParticipantType.AGENCY].ParticipantId);
|
||||
}
|
||||
|
||||
bool allowBSMD = false;
|
||||
if (p != null)
|
||||
|
||||
Reference in New Issue
Block a user