|
@@ -24,7 +24,12 @@ namespace WhiteList
|
|
|
public MainWindow()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
- Filt();
|
|
|
+ ComboBoxFilter.Items.Add("Все");
|
|
|
+ foreach (AgentType at in DB.dbCon.AgentType.ToList())
|
|
|
+ {
|
|
|
+ ComboBoxFilter.Items.Add(at.Title);
|
|
|
+ }
|
|
|
+ ComboBoxFilter.SelectedIndex = 0;
|
|
|
}
|
|
|
|
|
|
public void Filt() //фильтрация данных
|
|
@@ -44,7 +49,10 @@ namespace WhiteList
|
|
|
}
|
|
|
_listAgents = newList;
|
|
|
}
|
|
|
-
|
|
|
+ if(ComboBoxFilter.SelectedIndex>0)
|
|
|
+ {
|
|
|
+ _listAgents = _listAgents.Where(x => x.AgentType.Title == ComboBoxFilter.SelectedValue.ToString()).ToList();
|
|
|
+ }
|
|
|
|
|
|
ListViewDataBase.Items.Clear();
|
|
|
foreach (Agent a in _listAgents)
|