Added Filter flag (checkbox) to select only shipcalls the users participant is assigned to
This commit is contained in:
parent
32296f7d15
commit
0ca8e1f916
@ -675,6 +675,22 @@ namespace BreCalClient
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sfm.MineOnly ?? false)
|
||||||
|
{
|
||||||
|
_ = _visibleControlModels.RemoveAll(x =>
|
||||||
|
{
|
||||||
|
bool contained = false;
|
||||||
|
foreach(ParticipantAssignment p in x.AssignedParticipants.Values)
|
||||||
|
{
|
||||||
|
if(p.ParticipantId.Equals(App.Participant.Id))
|
||||||
|
{
|
||||||
|
contained = true; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !contained;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if(!_showCanceled ?? true) // canceled calls are filtered by default
|
if(!_showCanceled ?? true) // canceled calls are filtered by default
|
||||||
{
|
{
|
||||||
_ = this._visibleControlModels.RemoveAll(x => x.Shipcall?.Canceled ?? false);
|
_ = this._visibleControlModels.RemoveAll(x => x.Shipcall?.Canceled ?? false);
|
||||||
|
|||||||
9
src/BreCalClient/Resources/Resources.Designer.cs
generated
9
src/BreCalClient/Resources/Resources.Designer.cs
generated
@ -654,6 +654,15 @@ namespace BreCalClient.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to mine only.
|
||||||
|
/// </summary>
|
||||||
|
public static string textMineOnly {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("textMineOnly", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Moored in lock.
|
/// Looks up a localized string similar to Moored in lock.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -457,6 +457,9 @@
|
|||||||
<data name="textShowHistory" xml:space="preserve">
|
<data name="textShowHistory" xml:space="preserve">
|
||||||
<value>Änderungshistorie der Anläufe anzeigen</value>
|
<value>Änderungshistorie der Anläufe anzeigen</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textMineOnly" xml:space="preserve">
|
||||||
|
<value>nur eigene</value>
|
||||||
|
</data>
|
||||||
<data name="textOperation" xml:space="preserve">
|
<data name="textOperation" xml:space="preserve">
|
||||||
<value>Vorgang</value>
|
<value>Vorgang</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@ -310,6 +310,9 @@
|
|||||||
<data name="textLogin" xml:space="preserve">
|
<data name="textLogin" xml:space="preserve">
|
||||||
<value>Login</value>
|
<value>Login</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="textMineOnly" xml:space="preserve">
|
||||||
|
<value>mine only</value>
|
||||||
|
</data>
|
||||||
<data name="textMooredLock" xml:space="preserve">
|
<data name="textMooredLock" xml:space="preserve">
|
||||||
<value>Moored in lock</value>
|
<value>Moored in lock</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@ -74,8 +74,17 @@
|
|||||||
<Label Grid.Column="1" Content="{x:Static p:Resources.textTo}" />
|
<Label Grid.Column="1" Content="{x:Static p:Resources.textTo}" />
|
||||||
<xctk:DoubleUpDown x:Name="upDownShiplengthTo" Grid.Column="2" Margin="2" Minimum="0" Maximum="1000" ValueChanged="upDownShiplengthTo_ValueChanged" Value="{Binding Path=ShipLengthTo}"/>
|
<xctk:DoubleUpDown x:Name="upDownShiplengthTo" Grid.Column="2" Margin="2" Minimum="0" Maximum="1000" ValueChanged="upDownShiplengthTo_ValueChanged" Value="{Binding Path=ShipLengthTo}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<xctk:WatermarkTextBox x:Name="textBoxSearch" Grid.Column="2" Grid.Row="1" Margin="2" Watermark="{x:Static p:Resources.textEnterKeyword}" PreviewTextInput="textBoxSearch_PreviewTextInput"
|
<Grid Grid.Column="2" Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width=".5*" />
|
||||||
|
<ColumnDefinition Width="30" />
|
||||||
|
<ColumnDefinition Width=".5*" />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<xctk:WatermarkTextBox x:Name="textBoxSearch" Grid.Column="0" Margin="2" Watermark="{x:Static p:Resources.textEnterKeyword}" PreviewTextInput="textBoxSearch_PreviewTextInput"
|
||||||
DataObject.Pasting="textBoxSearch_Pasting" TextChanged="textBoxSearch_TextChanged" />
|
DataObject.Pasting="textBoxSearch_Pasting" TextChanged="textBoxSearch_TextChanged" />
|
||||||
|
<CheckBox x:Name="checkBoxOwn" VerticalAlignment="Center" Grid.Column="1" HorizontalAlignment="Right" Margin="2" Checked="checkBoxOwn_Checked" Unchecked="checkBoxOwn_Checked" />
|
||||||
|
<Label Content="{x:Static p:Resources.textMineOnly}" Grid.Column="2" />
|
||||||
|
</Grid>
|
||||||
<xctk:CheckComboBox x:Name="comboBoxBerths" DisplayMemberPath="Name" Grid.Column="4" Grid.Row="1" Margin="2" ItemSelectionChanged="comboBoxBerths_ItemSelectionChanged" />
|
<xctk:CheckComboBox x:Name="comboBoxBerths" DisplayMemberPath="Name" Grid.Column="4" Grid.Row="1" Margin="2" ItemSelectionChanged="comboBoxBerths_ItemSelectionChanged" />
|
||||||
<xctk:CheckComboBox x:Name="comboBoxAgencies" DisplayMemberPath="Name" Grid.Column="6" Grid.Row="1" Margin="2" ItemSelectionChanged="comboBoxAgencies_ItemSelectionChanged" />
|
<xctk:CheckComboBox x:Name="comboBoxAgencies" DisplayMemberPath="Name" Grid.Column="6" Grid.Row="1" Margin="2" ItemSelectionChanged="comboBoxAgencies_ItemSelectionChanged" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -76,7 +76,8 @@ namespace BreCalClient
|
|||||||
this.datePickerETATo.SelectedDate = null;
|
this.datePickerETATo.SelectedDate = null;
|
||||||
this.textBoxSearch.Clear();
|
this.textBoxSearch.Clear();
|
||||||
this.upDownShiplengthFrom.Value = null;
|
this.upDownShiplengthFrom.Value = null;
|
||||||
this.upDownShiplengthTo.Value = null;
|
this.upDownShiplengthTo.Value = null;
|
||||||
|
this.checkBoxOwn.IsChecked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,6 +109,7 @@ namespace BreCalClient
|
|||||||
this.upDownShiplengthTo.Value = sfm.ShipLengthTo;
|
this.upDownShiplengthTo.Value = sfm.ShipLengthTo;
|
||||||
this.datePickerETAFrom.SelectedDate = sfm.EtaFrom;
|
this.datePickerETAFrom.SelectedDate = sfm.EtaFrom;
|
||||||
this.datePickerETATo.SelectedDate = sfm.EtaTo;
|
this.datePickerETATo.SelectedDate = sfm.EtaTo;
|
||||||
|
this.checkBoxOwn.IsChecked = sfm.MineOnly;
|
||||||
|
|
||||||
this._model = sfm;
|
this._model = sfm;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
@ -192,6 +194,12 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
this.SearchFilter.SearchString = this.textBoxSearch.Text;
|
this.SearchFilter.SearchString = this.textBoxSearch.Text;
|
||||||
SearchFilterChanged?.Invoke();
|
SearchFilterChanged?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkBoxOwn_Checked(object sender, System.Windows.RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
this._model.MineOnly = this.checkBoxOwn.IsChecked;
|
||||||
|
SearchFilterChanged?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@ -31,8 +31,12 @@ namespace BreCalClient
|
|||||||
|
|
||||||
public double? ShipLengthTo { get; set; }
|
public double? ShipLengthTo { get; set; }
|
||||||
|
|
||||||
|
public bool? MineOnly { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Serialisation
|
||||||
|
|
||||||
public static SearchFilterModel? Deserialize(string json)
|
public static SearchFilterModel? Deserialize(string json)
|
||||||
{
|
{
|
||||||
return (SearchFilterModel?) JsonConvert.DeserializeObject(json, typeof(SearchFilterModel));
|
return (SearchFilterModel?) JsonConvert.DeserializeObject(json, typeof(SearchFilterModel));
|
||||||
@ -43,5 +47,7 @@ namespace BreCalClient
|
|||||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user