|
@@ -23,13 +23,26 @@ namespace BuzuevaDemo.Pages
|
|
|
{
|
|
|
ViewModel view = new ViewModel();
|
|
|
List<Agent> filter;
|
|
|
-
|
|
|
+ List<Agent> sortirov;
|
|
|
+ List<Agent> filtrasia;
|
|
|
+ List<Agent> agents = new List<Agent>();
|
|
|
+ public string[] typelist = new string[5];
|
|
|
public Agents()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
AllAgent.ItemsSource = view.agent.ToList();
|
|
|
AllAgent.Items.Refresh();
|
|
|
filter = view.agent.ToList();
|
|
|
+ sortirov = view.agent.ToList();
|
|
|
+ filtrasia = view.agent.ToList();
|
|
|
+ List<AgentType> type = DataBase.BaseModel.AgentType.ToList();
|
|
|
+ int i = 0;
|
|
|
+ foreach (AgentType tps in type)
|
|
|
+ {
|
|
|
+ typelist[i] = tps.Title;
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void Changeg(object sender, TextChangedEventArgs e)
|
|
@@ -57,5 +70,47 @@ namespace BuzuevaDemo.Pages
|
|
|
{
|
|
|
new CreateChange(null, 1).ShowDialog();
|
|
|
}
|
|
|
+
|
|
|
+ private void sortSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+ switch (sort.SelectedIndex)
|
|
|
+ {
|
|
|
+ case 0:
|
|
|
+ sortirov = sortirov.OrderBy(x => x.Title).ToList();
|
|
|
+ AllAgent.ItemsSource = sortirov.ToList();
|
|
|
+ break;
|
|
|
+ case 1:
|
|
|
+ sortirov = sortirov.OrderBy(x => x.Title).ToList();
|
|
|
+ sortirov.Reverse();
|
|
|
+ AllAgent.ItemsSource = sortirov.ToList();
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ sortirov = sortirov.ToList();
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ sortirov = sortirov.ToList();
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ sortirov = sortirov.OrderBy(x => x.Priority).ToList();
|
|
|
+ AllAgent.ItemsSource = sortirov.ToList();
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ sortirov = sortirov.OrderBy(x => x.Priority).ToList();
|
|
|
+ sortirov.Reverse();
|
|
|
+ AllAgent.ItemsSource = sortirov.ToList();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ sortirov = sortirov.ToList();
|
|
|
+ break;
|
|
|
+
|
|
|
+ }
|
|
|
+ AllAgent.ItemsSource = sortirov.ToList();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private void filtSelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|