Neue Filter nach Betreuungsart und Funktion bei Klienten bzw. Personen hinzugefügt
This commit is contained in:
@@ -206,6 +206,7 @@
|
||||
<Compile Include="View\Document\RtfEditView.xaml.cs">
|
||||
<DependentUpon>RtfEditView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Navigation\Filter\ValueListFilter.cs" />
|
||||
<Compile Include="View\TemplateSelectors\AiConversationMessageTemplateSelector.cs" />
|
||||
<Compile Include="View\Windows\AnimatedBeWoWindow.xaml.cs">
|
||||
<DependentUpon>AnimatedBeWoWindow.xaml</DependentUpon>
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace BeWo.Converter
|
||||
{
|
||||
var showOnlyArchived = false;
|
||||
var showOnlyOnlyDeleted = false;
|
||||
CustomFilter customFilter = null;
|
||||
IList<CustomFilter> customFilters = null;
|
||||
|
||||
if (values.Length >= 3)
|
||||
{
|
||||
@@ -29,9 +29,9 @@ namespace BeWo.Converter
|
||||
|
||||
if (values.Length >= 4)
|
||||
{
|
||||
if (values[3] is CustomFilter)
|
||||
if (values[3] is IList<CustomFilter>)
|
||||
{
|
||||
customFilter = values[3] as CustomFilter;
|
||||
customFilters = values[3] as IList<CustomFilter>;
|
||||
}
|
||||
|
||||
if (values.Length >= 5)
|
||||
@@ -51,14 +51,15 @@ namespace BeWo.Converter
|
||||
var ret = (values[0] as IEnumerable<IFilterableDC>).Where(
|
||||
dc =>
|
||||
{
|
||||
var filterRelevants = dc.FilterRelevants != null && dc.FilterRelevants.ContainsAll(lFilter) && (customFilter == null || customFilter.IsValid(dc));
|
||||
var filterRelevants = dc.FilterRelevants != null && dc.FilterRelevants.ContainsAll(lFilter);
|
||||
var aktiv = (!showOnlyOnlyDeleted && !showOnlyArchived && dc.ActivationType == ActivationTypeId.Active);
|
||||
var archiviert = ((showOnlyArchived && dc.ActivationType == ActivationTypeId.Archived));
|
||||
var geloescht = ((!showOnlyArchived && showOnlyOnlyDeleted && dc.ActivationType == ActivationTypeId.Deleted));
|
||||
|
||||
var geloeschtOderArchiviert = (showOnlyArchived && dc.ActivationType == ActivationTypeId.Archived || showOnlyOnlyDeleted && dc.ActivationType == ActivationTypeId.Deleted) && filterRelevants;
|
||||
|
||||
var ergebnis = (aktiv || archiviert || geloescht || geloeschtOderArchiviert) && filterRelevants;
|
||||
var customerFilterValid = (customFilters == null || customFilters.All(f => f.IsValid(dc)));
|
||||
|
||||
var ergebnis = (aktiv || archiviert || geloescht || geloeschtOderArchiviert) && filterRelevants && customerFilterValid;
|
||||
|
||||
return ergebnis;
|
||||
});
|
||||
|
||||
@@ -31,6 +31,7 @@ using System.Collections;
|
||||
using System.Windows.Input;
|
||||
using BeWo.Core.Commands;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
using DevExpress.Xpf.Editors;
|
||||
|
||||
namespace BeWo.View.Navigation
|
||||
{
|
||||
@@ -42,8 +43,9 @@ namespace BeWo.View.Navigation
|
||||
//private readonly CheckBox chkShowOnlyMyCustomers;
|
||||
//private readonly CheckBox chkShowOnlyTeamCustomers;
|
||||
private readonly ComboBox supportConceptFilterComboBox;
|
||||
|
||||
private IEnumerable<IFilterableDC> objectList;
|
||||
private readonly ComboBoxEdit betreuungsartFilterComboBox;
|
||||
|
||||
private IEnumerable<IFilterableDC> objectList;
|
||||
private IEnumerable<IFilterableDC> recentList;
|
||||
|
||||
public CustomerNavigationView()
|
||||
@@ -169,10 +171,46 @@ namespace BeWo.View.Navigation
|
||||
mainNavigationView.sortPanel.Children.Insert(3, lbl);
|
||||
mainNavigationView.sortPanel.Children.Insert(4, supportConceptFilterComboBox);
|
||||
|
||||
betreuungsartFilterComboBox = new ComboBoxEdit();
|
||||
betreuungsartFilterComboBox.FontSize = 12;
|
||||
betreuungsartFilterComboBox.Margin = new Thickness(10, 0, 0, 0);
|
||||
betreuungsartFilterComboBox.Width = 150;
|
||||
betreuungsartFilterComboBox.IsTextEditable = false;
|
||||
betreuungsartFilterComboBox.NullText = Translator.Translate("Nach Betreuungsart filtern");
|
||||
betreuungsartFilterComboBox.ItemsSource = ServiceFacade.DoValueListServiceSync(s => s.GetAllValueListEntrysByType(ValueListEntryType.CustomerCareType));
|
||||
betreuungsartFilterComboBox.DisplayMember = "TypeDescription";
|
||||
betreuungsartFilterComboBox.StyleSettings = new CheckedComboBoxStyleSettings();
|
||||
betreuungsartFilterComboBox.EditValueChanged += BetreuungsartComboBox_EditValueChanged;
|
||||
|
||||
//< dxe:ComboBoxEdit x:Name = "checkedComboBox"
|
||||
// NullText = "Select categories"
|
||||
// IsTextEditable = "False"
|
||||
// ItemsSource = "{Binding Categories}"
|
||||
// EditValue = "{Binding SelectedCategories}"
|
||||
// DisplayMember = "CategoryName"
|
||||
// ShowCustomItems = "True" >
|
||||
// < dxe:ComboBoxEdit.StyleSettings >
|
||||
// < dxe:CheckedComboBoxStyleSettings />
|
||||
// </ dxe:ComboBoxEdit.StyleSettings >
|
||||
// </ dxe:ComboBoxEdit >
|
||||
|
||||
lbl = new TextBlock
|
||||
{
|
||||
Text = Translator.Translate("Betreuungsart:"),
|
||||
FontSize = 12,
|
||||
Margin = new Thickness(8, 2, -3, 0)
|
||||
};
|
||||
|
||||
mainNavigationView.sortPanel.Children.Insert(5, lbl);
|
||||
mainNavigationView.sortPanel.Children.Insert(6, betreuungsartFilterComboBox);
|
||||
|
||||
|
||||
|
||||
|
||||
UpdateCustomFilter();
|
||||
}
|
||||
|
||||
public Dictionary<TableID, long[]> GetVisibleInformationReferences()
|
||||
public Dictionary<TableID, long[]> GetVisibleInformationReferences()
|
||||
{
|
||||
var visible = mainNavigationView.objectListBox.ItemsSource;
|
||||
|
||||
@@ -218,14 +256,37 @@ namespace BeWo.View.Navigation
|
||||
UpdateCustomFilter();
|
||||
}
|
||||
|
||||
private CustomFilter CreateNewCustomFilter()
|
||||
|
||||
|
||||
private void BetreuungsartComboBox_EditValueChanged(object sender, EditValueChangedEventArgs e)
|
||||
{
|
||||
UpdateCustomFilter();
|
||||
}
|
||||
|
||||
private CustomFilter CreateNewCustomerFilter()
|
||||
{
|
||||
var filter = new CustomerNavigationFilter { CustomerFilter = ((CustomerFilterItem)supportConceptFilterComboBox.SelectedItem)?.CustomerFilter ?? CustomerFilterEnum.MyCustomer };
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
private CustomFilter CreateNewBetreuungsartFilter()
|
||||
{
|
||||
if (betreuungsartFilterComboBox.SelectedItems == null)
|
||||
return null;
|
||||
|
||||
var list = new List<ValueListEntryDC>();
|
||||
foreach (var item in betreuungsartFilterComboBox.SelectedItems)
|
||||
{
|
||||
list.Add(item as ValueListEntryDC);
|
||||
}
|
||||
|
||||
var filter = new ValueListFilter { SelectedValueListEntries = list, ValueListProperty = "CustomerCareTypes" };
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ServiceFacade.DoCustomerServiceAsync(s => s.ConvertToNewSubstitutionType(), n => this.Dispatch(delegate
|
||||
{
|
||||
@@ -237,8 +298,8 @@ namespace BeWo.View.Navigation
|
||||
|
||||
private void UpdateCustomFilter()
|
||||
{
|
||||
mainNavigationView.CustomFilter = CreateNewCustomFilter();
|
||||
}
|
||||
mainNavigationView.CustomFilters = new List<CustomFilter> { CreateNewCustomerFilter(), CreateNewBetreuungsartFilter() };
|
||||
}
|
||||
|
||||
private void ChkShowOnlyMyCustomers_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
50
BeWo/View/Navigation/Filter/ValueListFilter.cs
Normal file
50
BeWo/View/Navigation/Filter/ValueListFilter.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
|
||||
namespace BeWo.View.Navigation.Filter
|
||||
{
|
||||
public class ValueListFilter : CustomFilter
|
||||
{
|
||||
public IList<ValueListEntryDC> SelectedValueListEntries { get; set; }
|
||||
public string ValueListProperty { get; set; }
|
||||
public override bool IsValid(IFilterableDC dc)
|
||||
{
|
||||
var val = GetPropertyValue(dc, ValueListProperty);
|
||||
|
||||
if (SelectedValueListEntries != null && SelectedValueListEntries.Count > 0)
|
||||
{
|
||||
if (val != null)
|
||||
{
|
||||
foreach (var cct in SelectedValueListEntries)
|
||||
{
|
||||
if (val.ToString().Contains(cct.DisplayName))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private object GetPropertyValue(object obj, string propertyName)
|
||||
{
|
||||
if (obj == null || string.IsNullOrWhiteSpace(propertyName))
|
||||
return null;
|
||||
|
||||
var prop = obj.GetType().GetProperty(
|
||||
propertyName,
|
||||
BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase
|
||||
);
|
||||
|
||||
return prop?.GetValue(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
<Binding />
|
||||
<Binding ElementName="textbox_search" Path="Text" />
|
||||
<Binding ElementName="chkShowArchived" Path="IsChecked" />
|
||||
<Binding Path="CustomFilter">
|
||||
<Binding Path="CustomFilters">
|
||||
<Binding.RelativeSource>
|
||||
<RelativeSource AncestorType="{x:Type localNavView:MainNavigationView}" Mode="FindAncestor" />
|
||||
</Binding.RelativeSource>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
@@ -27,7 +28,7 @@ namespace BeWo.View.Navigation
|
||||
{
|
||||
public partial class MainNavigationView : INotifyPropertyChanged
|
||||
{
|
||||
internal CustomFilter _CustomFilter;
|
||||
internal IList<CustomFilter> _CustomFilters;
|
||||
|
||||
private readonly string _DetailsLoadLock = string.Empty;
|
||||
|
||||
@@ -164,18 +165,18 @@ namespace BeWo.View.Navigation
|
||||
}
|
||||
}
|
||||
|
||||
public CustomFilter CustomFilter
|
||||
public IList<CustomFilter> CustomFilters
|
||||
{
|
||||
get
|
||||
{
|
||||
return _CustomFilter;
|
||||
return _CustomFilters;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_CustomFilter = value;
|
||||
_CustomFilters = value.Where(f => f != null).ToList();
|
||||
|
||||
FirePropertyChanged("CustomFilter");
|
||||
FirePropertyChanged("CustomFilters");
|
||||
|
||||
// if (listBoxMultiBinding.Bindings.Count == 4)
|
||||
// listBoxMultiBinding.Bindings.RemoveAt(3);
|
||||
|
||||
@@ -22,6 +22,8 @@ using System.Windows.Input;
|
||||
using BeWo.Core.Commands;
|
||||
using DevExpress.XtraBars.Docking;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
using DevExpress.Xpf.Editors;
|
||||
using BS.Shared.Translation;
|
||||
|
||||
namespace BeWo.View.Navigation
|
||||
{
|
||||
@@ -31,8 +33,9 @@ namespace BeWo.View.Navigation
|
||||
public partial class PersonNavigationView
|
||||
{
|
||||
private readonly ComboBox filterComboBox;
|
||||
private readonly ComboBoxEdit functionFilterComboBox;
|
||||
|
||||
private IEnumerable<IFilterableDC> objectList;
|
||||
private IEnumerable<IFilterableDC> objectList;
|
||||
private IEnumerable<IFilterableDC> recentList;
|
||||
|
||||
public PersonNavigationView()
|
||||
@@ -85,7 +88,41 @@ namespace BeWo.View.Navigation
|
||||
mainNavigationView.sortPanel.Children.Insert(3, lbl);
|
||||
mainNavigationView.sortPanel.Children.Insert(4, filterComboBox);
|
||||
|
||||
UpdateCustomFilter();
|
||||
|
||||
functionFilterComboBox = new ComboBoxEdit();
|
||||
functionFilterComboBox.FontSize = 12;
|
||||
functionFilterComboBox.Margin = new Thickness(10, 0, 0, 0);
|
||||
functionFilterComboBox.Width = 150;
|
||||
functionFilterComboBox.IsTextEditable = false;
|
||||
functionFilterComboBox.NullText = Translator.Translate("Nach Funktion filtern");
|
||||
functionFilterComboBox.ItemsSource = ServiceFacade.DoValueListServiceSync(s => s.GetAllValueListEntrysByType(ValueListEntryType.FunctionType));
|
||||
functionFilterComboBox.DisplayMember = "TypeDescription";
|
||||
functionFilterComboBox.StyleSettings = new CheckedComboBoxStyleSettings();
|
||||
functionFilterComboBox.EditValueChanged += FunctionComboBox_EditValueChanged;
|
||||
|
||||
//< dxe:ComboBoxEdit x:Name = "checkedComboBox"
|
||||
// NullText = "Select categories"
|
||||
// IsTextEditable = "False"
|
||||
// ItemsSource = "{Binding Categories}"
|
||||
// EditValue = "{Binding SelectedCategories}"
|
||||
// DisplayMember = "CategoryName"
|
||||
// ShowCustomItems = "True" >
|
||||
// < dxe:ComboBoxEdit.StyleSettings >
|
||||
// < dxe:CheckedComboBoxStyleSettings />
|
||||
// </ dxe:ComboBoxEdit.StyleSettings >
|
||||
// </ dxe:ComboBoxEdit >
|
||||
|
||||
lbl = new TextBlock
|
||||
{
|
||||
Text = Translator.Translate("Funktion:"),
|
||||
FontSize = 12,
|
||||
Margin = new Thickness(8, 2, -3, 0)
|
||||
};
|
||||
|
||||
mainNavigationView.sortPanel.Children.Insert(5, lbl);
|
||||
mainNavigationView.sortPanel.Children.Insert(6, functionFilterComboBox);
|
||||
|
||||
UpdateCustomFilter();
|
||||
}
|
||||
|
||||
public Dictionary<TableID, long[]> GetVisibleInformationReferences()
|
||||
@@ -135,12 +172,33 @@ namespace BeWo.View.Navigation
|
||||
UpdateCustomFilter();
|
||||
}
|
||||
|
||||
private void UpdateCustomFilter()
|
||||
{
|
||||
mainNavigationView.CustomFilter = CreateNewPersonFilter();
|
||||
}
|
||||
private void FunctionComboBox_EditValueChanged(object sender, EditValueChangedEventArgs e)
|
||||
{
|
||||
UpdateCustomFilter();
|
||||
}
|
||||
|
||||
private PersonNavigationFilter CreateNewPersonFilter()
|
||||
private void UpdateCustomFilter()
|
||||
{
|
||||
mainNavigationView.CustomFilters = new List<CustomFilter> { CreateNewPersonFilter(), CreateNewFunctionFilter() };
|
||||
}
|
||||
|
||||
private CustomFilter CreateNewFunctionFilter()
|
||||
{
|
||||
if (functionFilterComboBox.SelectedItems == null)
|
||||
return null;
|
||||
|
||||
var list = new List<ValueListEntryDC>();
|
||||
foreach (var item in functionFilterComboBox.SelectedItems)
|
||||
{
|
||||
list.Add(item as ValueListEntryDC);
|
||||
}
|
||||
|
||||
var filter = new ValueListFilter { SelectedValueListEntries = list, ValueListProperty = "Function" };
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
private PersonNavigationFilter CreateNewPersonFilter()
|
||||
{
|
||||
var filter = new PersonNavigationFilter { PersonFilter = ((PersonFilterItem)filterComboBox.SelectedItem)?.Filter ?? PersonFilterEnum.ContactPersons };
|
||||
|
||||
|
||||
@@ -283,9 +283,8 @@ namespace BeWo.View.Navigation
|
||||
|
||||
private void UpdateCustomFilter()
|
||||
{
|
||||
this.mainNavigationView.CustomFilter = this.CreateNewCustomFilter();
|
||||
mainNavigationView.CustomFilters = new List<CustomFilter> { CreateNewCustomFilter() };
|
||||
}
|
||||
|
||||
|
||||
private bool mainNavigationView_ArchiveObject(IFilterableDC obj)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user