bugfix enable controls correctly on dialog load
This commit is contained in:
parent
5ed0a08ca2
commit
2d8a895e9f
@ -90,31 +90,10 @@ namespace BreCalClient
|
|||||||
this.EnableControls();
|
this.EnableControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
private void comboBoxCategories_SelectionChanged(object? sender, SelectionChangedEventArgs? e)
|
||||||
|
|
||||||
#region Context menu handlers
|
|
||||||
|
|
||||||
private void contextMenuItemClearAgency_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.comboBoxAgency.SelectedIndex = -1;
|
|
||||||
this.ShipcallModel.AssignedParticipants.Remove(Extensions.ParticipantType.AGENCY);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void contextMenuItemArrivalBerth_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.comboBoxArrivalBerth.SelectedIndex = -1;
|
|
||||||
this.ShipcallModel.Berth = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void contextMenuItemDepartureBerth_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
this.comboBoxDepartureBerth.SelectedIndex -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void comboBoxCategories_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
{
|
||||||
TypeEnum? type = this.comboBoxCategories.SelectedItem as TypeEnum?;
|
TypeEnum? type = this.comboBoxCategories.SelectedItem as TypeEnum?;
|
||||||
if(type != null)
|
if (type != null)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
@ -146,6 +125,27 @@ namespace BreCalClient
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Context menu handlers
|
||||||
|
|
||||||
|
private void contextMenuItemClearAgency_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.comboBoxAgency.SelectedIndex = -1;
|
||||||
|
this.ShipcallModel.AssignedParticipants.Remove(Extensions.ParticipantType.AGENCY);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void contextMenuItemArrivalBerth_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.comboBoxArrivalBerth.SelectedIndex = -1;
|
||||||
|
this.ShipcallModel.Berth = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void contextMenuItemDepartureBerth_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this.comboBoxDepartureBerth.SelectedIndex -= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region private methods
|
#region private methods
|
||||||
|
|
||||||
private void CopyToModel()
|
private void CopyToModel()
|
||||||
@ -184,7 +184,8 @@ namespace BreCalClient
|
|||||||
// get port authority from berth
|
// get port authority from berth
|
||||||
|
|
||||||
int? berthId = this.ShipcallModel.Shipcall.ArrivalBerthId;
|
int? berthId = this.ShipcallModel.Shipcall.ArrivalBerthId;
|
||||||
if (berthId == null) berthId = this.ShipcallModel.Shipcall.DepartureBerthId;
|
berthId ??= this.ShipcallModel.Shipcall.DepartureBerthId;
|
||||||
|
|
||||||
if (berthId != null)
|
if (berthId != null)
|
||||||
{
|
{
|
||||||
Berth? selectedBerth = BreCalLists.Berths.Find((x) => x.Id == berthId);
|
Berth? selectedBerth = BreCalLists.Berths.Find((x) => x.Id == berthId);
|
||||||
@ -266,8 +267,9 @@ namespace BreCalClient
|
|||||||
this.datePickerETA.IsEnabled = isAgency || isBsmd;
|
this.datePickerETA.IsEnabled = isAgency || isBsmd;
|
||||||
this.datePickerETD.IsEnabled = isAgency;
|
this.datePickerETD.IsEnabled = isAgency;
|
||||||
|
|
||||||
|
|
||||||
this.labelBSMDGranted.Visibility = editRightGrantedForBSMD ? Visibility.Visible : Visibility.Hidden;
|
this.labelBSMDGranted.Visibility = editRightGrantedForBSMD ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
|
||||||
|
this.comboBoxCategories_SelectionChanged(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user