|
@@ -31,7 +31,6 @@ namespace ROGOZ.Pages
|
|
|
|
|
|
|
|
|
|
DGTasks.ItemsSource = user1Entities.GetContext().Task.ToList();
|
|
DGTasks.ItemsSource = user1Entities.GetContext().Task.ToList();
|
|
- //DGTasks.ItemsSource = user1Entities.GetContext().Manager.ToList();
|
|
|
|
|
|
|
|
foreach (var user in _context.User.ToList())
|
|
foreach (var user in _context.User.ToList())
|
|
{
|
|
{
|
|
@@ -68,19 +67,18 @@ namespace ROGOZ.Pages
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ //сортировка по названию
|
|
private void TBoxSearch_TextChanged(object sender, TextChangedEventArgs e)
|
|
private void TBoxSearch_TextChanged(object sender, TextChangedEventArgs e)
|
|
{
|
|
{
|
|
UpdateTasks();
|
|
UpdateTasks();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //Очистка фильтров
|
|
private void ClearFilters_Click(object sender, RoutedEventArgs e)
|
|
private void ClearFilters_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
CmbExecutorSort.SelectedIndex = -1;
|
|
CmbExecutorSort.SelectedIndex = -1;
|
|
CmbStatusSort.SelectedIndex = -1;
|
|
CmbStatusSort.SelectedIndex = -1;
|
|
TBoxSearch.Clear();
|
|
TBoxSearch.Clear();
|
|
- UpdateTasks();
|
|
|
|
}
|
|
}
|
|
private void UpdateTasks()
|
|
private void UpdateTasks()
|
|
{
|
|
{
|
|
@@ -89,10 +87,6 @@ namespace ROGOZ.Pages
|
|
//сортировка по статусу
|
|
//сортировка по статусу
|
|
if (CmbStatusSort.SelectedIndex == -1 || CmbStatusSort.Text == null)
|
|
if (CmbStatusSort.SelectedIndex == -1 || CmbStatusSort.Text == null)
|
|
DGTasks.ItemsSource = tasks.OrderBy(p => p.Status).ToList();
|
|
DGTasks.ItemsSource = tasks.OrderBy(p => p.Status).ToList();
|
|
- //if (CmbStatusSort.SelectedIndex != -1 || CmbStatusSort.Text != null)
|
|
|
|
- // DGTasks.ItemsSource = tasks.Where(p => p.Status == CmbStatusSort.Text).ToList();
|
|
|
|
- //else
|
|
|
|
- // DGTasks.ItemsSource = tasks.OrderBy(p => p.Status).ToList();
|
|
|
|
|
|
|
|
//сортировка по исполнителю
|
|
//сортировка по исполнителю
|
|
//if (CmbExecutorSort.SelectedIndex == -1)
|
|
//if (CmbExecutorSort.SelectedIndex == -1)
|
|
@@ -102,35 +96,15 @@ namespace ROGOZ.Pages
|
|
|
|
|
|
//сортировка по поиску
|
|
//сортировка по поиску
|
|
DGTasks.ItemsSource = tasks.Where(p => p.Title.ToLower().Contains(TBoxSearch.Text.ToLower())).ToList(); //
|
|
DGTasks.ItemsSource = tasks.Where(p => p.Title.ToLower().Contains(TBoxSearch.Text.ToLower())).ToList(); //
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- //private void CmbStatusSort_LostFocus(object sender, RoutedEventArgs e)
|
|
|
|
- //{
|
|
|
|
- // var tasks = user1Entities.GetContext().Task.ToList();
|
|
|
|
- // if(CmbStatusSort.Text != null || CmbStatusSort.SelectedIndex != -1)
|
|
|
|
- // {
|
|
|
|
- // DGTasks.ItemsSource = tasks.Where(x => x.Status == CmbStatusSort.Text).ToList();
|
|
|
|
- // }
|
|
|
|
- // else
|
|
|
|
- // DGTasks.ItemsSource = user1Entities.GetContext().Task.ToList();
|
|
|
|
- //}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- //private void CmbStatusSort_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
|
- //{
|
|
|
|
- // UpdateTasks();
|
|
|
|
- //}
|
|
|
|
-
|
|
|
|
|
|
+ //Сортировка по статусу
|
|
private void CmbStatusSort_LostFocus(object sender, RoutedEventArgs e)
|
|
private void CmbStatusSort_LostFocus(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
var tasks = user1Entities.GetContext().Task.ToList();
|
|
var tasks = user1Entities.GetContext().Task.ToList();
|
|
if (CmbStatusSort.SelectedIndex != -1 )
|
|
if (CmbStatusSort.SelectedIndex != -1 )
|
|
DGTasks.ItemsSource = tasks.Where(p => p.Status == CmbStatusSort.Text).ToList();
|
|
DGTasks.ItemsSource = tasks.Where(p => p.Status == CmbStatusSort.Text).ToList();
|
|
- //if (CmbStatusSort.SelectedIndex == -1 )
|
|
|
|
- // DGTasks.ItemsSource = user1Entities.GetContext().Task.ToList();
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
private void CmbStatusSort_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
private void CmbStatusSort_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
{
|
|
{
|
|
UpdateTasks();
|
|
UpdateTasks();
|