|
@@ -27,6 +27,7 @@ namespace UP2022Ex.FrameFolder
|
|
|
_TemporraryFilter = _StartFilter;
|
|
|
LVAgent.ItemsSource = _StartFilter;
|
|
|
CBSort.SelectedIndex = 0;
|
|
|
+ CBFilt.SelectedIndex = 0;
|
|
|
}
|
|
|
|
|
|
public void Sort()
|
|
@@ -45,6 +46,53 @@ namespace UP2022Ex.FrameFolder
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void Filt()
|
|
|
+ {
|
|
|
+
|
|
|
+ switch (CBFilt.SelectedIndex)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ _TemporraryFilter = _StartFilter;
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.AgentTypeID == 1).ToList();
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.AgentTypeID == 2).ToList();
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.AgentTypeID == 3).ToList();
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.AgentTypeID == 4).ToList();
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.AgentTypeID == 5).ToList();
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.AgentTypeID == 6).ToList();
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ string SearchStr = TBOXSearch.Text;
|
|
|
+ if (!string.IsNullOrWhiteSpace(TBOXSearch.Text))
|
|
|
+ {
|
|
|
+ _TemporraryFilter = _StartFilter.Where(x => x.Title.Contains(SearchStr)|| x.Title.ToLower().Contains(SearchStr) || x.Email.Contains(SearchStr) || x.Email.ToLower().Contains(SearchStr) || x.Phone.Contains(SearchStr) || x.Phone.ToLower().Contains(SearchStr)).ToList();
|
|
|
+ }
|
|
|
+ if (_UpAndDown == 1)
|
|
|
+ {
|
|
|
+ _UpAndDown *= -1;
|
|
|
+ Sort();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _UpAndDown *= -1;
|
|
|
+ Sort();
|
|
|
+ _TemporraryFilter.Reverse();
|
|
|
+ }
|
|
|
+ LVAgent.ItemsSource = _TemporraryFilter;
|
|
|
+ }
|
|
|
+
|
|
|
private void CBSort_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
{
|
|
|
Sort();
|
|
@@ -70,5 +118,23 @@ namespace UP2022Ex.FrameFolder
|
|
|
}
|
|
|
LVAgent.Items.Refresh();
|
|
|
}
|
|
|
+
|
|
|
+ private void CBFilt_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+ Filt();
|
|
|
+ LVAgent.Items.Refresh();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void BAdd_Click(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ WindowFolder.AddWindow NewWindow = new WindowFolder.AddWindow();
|
|
|
+ NewWindow.Show();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void TBOXSearch_TextChanged(object sender, TextChangedEventArgs e)
|
|
|
+ {
|
|
|
+ Filt();
|
|
|
+ LVAgent.Items.Refresh();
|
|
|
+ }
|
|
|
}
|
|
|
}
|