|
@@ -27,17 +27,17 @@ namespace WhiteList
|
|
|
Filt();
|
|
|
}
|
|
|
|
|
|
- public void Filt()
|
|
|
+ public void Filt() //фильтрация данных
|
|
|
{
|
|
|
|
|
|
_listAgents = DB.dbCon.Agent.ToList();
|
|
|
- if(TextBoxSearch.Text.Length>0)
|
|
|
- {
|
|
|
+ if(TextBoxSearch.Text.Length>0) //по поисковику
|
|
|
+ {
|
|
|
string searchStroke = TextBoxSearch.Text.ToLower();
|
|
|
List<Agent> newList = new List<Agent>();
|
|
|
foreach(Agent a in _listAgents)
|
|
|
{
|
|
|
- if(a.Title.ToLower().Contains(searchStroke)||a.Email.ToLower().Contains(searchStroke)||a.Phone.ToLower().Contains(searchStroke))
|
|
|
+ if(a.Title.ToLower().Contains(searchStroke)||a.Email.ToLower().Contains(searchStroke)||a.Phone.ToLower().Contains(searchStroke)) //содержится в почте, названии или номере телефона
|
|
|
{
|
|
|
newList.Add(a);
|
|
|
}
|
|
@@ -67,7 +67,7 @@ namespace WhiteList
|
|
|
private void ChangePriority_Click(object sender, RoutedEventArgs e)
|
|
|
{
|
|
|
List<Agent> selected = new List<Agent>();
|
|
|
- foreach(Agent a in ListViewDataBase.SelectedItems)
|
|
|
+ foreach(Agent a in ListViewDataBase.SelectedItems) //получаем из выделенных итемов обьекты таблицы
|
|
|
{
|
|
|
selected.Add(a);
|
|
|
}
|
|
@@ -76,11 +76,11 @@ namespace WhiteList
|
|
|
w.Visibility = Visibility.Visible;
|
|
|
w.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
|
|
w.ShowDialog();
|
|
|
- ListViewDataBase.Items.Refresh();
|
|
|
+ ListViewDataBase.Items.Refresh(); //перезагрузка
|
|
|
|
|
|
}
|
|
|
|
|
|
- private void ListViewDataBase_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ private void ListViewDataBase_SelectionChanged(object sender, SelectionChangedEventArgs e) //для видимости кнопки
|
|
|
{
|
|
|
if(ListViewDataBase.SelectedItems.Count>0)
|
|
|
{
|