|
@@ -5,6 +5,8 @@ using System.Globalization;
|
|
|
using System.Linq;
|
|
|
using System.Linq.Expressions;
|
|
|
using System.Reflection;
|
|
|
+using System.Threading;
|
|
|
+using System.Threading.Tasks;
|
|
|
using System.Windows;
|
|
|
using System.Windows.Controls;
|
|
|
using System.Windows.Data;
|
|
@@ -15,6 +17,7 @@ using Comal.Classes;
|
|
|
using InABox.Clients;
|
|
|
using InABox.Core;
|
|
|
using InABox.DynamicGrid;
|
|
|
+using InABox.Wpf;
|
|
|
using InABox.WPF;
|
|
|
using org.omg.CORBA;
|
|
|
using Syncfusion.UI.Xaml.Kanban;
|
|
@@ -96,7 +99,7 @@ namespace PRSDesktop
|
|
|
{
|
|
|
This
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private BitmapImage _attachimg = PRSDesktop.Resources.attachment.AsBitmapImage();
|
|
|
|
|
|
private readonly ObservableCollection<EmployeeModel> _employeelist = new();
|
|
@@ -171,7 +174,7 @@ namespace PRSDesktop
|
|
|
if (models.Any(x => x.Locked))
|
|
|
e.IsCancel = true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void Kanban_CardDragEnd(object sender, KanbanDragEndEventArgs e)
|
|
|
{
|
|
|
using (new WaitCursor())
|
|
@@ -205,7 +208,7 @@ namespace PRSDesktop
|
|
|
|
|
|
private void TaskTypes_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
if (!IsReady || EventSuppressor.IsSet(Suppress.This))
|
|
|
return;
|
|
|
if (e.AddedItems.Count > 0)
|
|
@@ -261,7 +264,7 @@ namespace PRSDesktop
|
|
|
return;
|
|
|
Host.Settings.StatusSettings.CompactView = ViewType.SelectedIndex > 0;
|
|
|
Host.SaveSettings();
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private static bool UpdatingEmployees = false;
|
|
@@ -474,7 +477,7 @@ namespace PRSDesktop
|
|
|
new SortOrder<KanbanType>(x => x.Description)
|
|
|
);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
var tasktypes = new Dictionary<Guid, string>
|
|
|
{
|
|
|
{ CoreUtils.FullGuid, "All Types" },
|
|
@@ -891,10 +894,32 @@ namespace PRSDesktop
|
|
|
|
|
|
private void FilterKanbans()
|
|
|
{
|
|
|
- Kanban.ItemsSource = _models
|
|
|
- .Where(x => x.Search(Search.Text.Split()))
|
|
|
- .OrderBy(x => x.EmployeeID == EmployeeID ? 0 : 1).ThenBy(x => x.DueDate);
|
|
|
- ;
|
|
|
+ Progress.ShowModal("Loading", (progress) =>
|
|
|
+ {
|
|
|
+ Dispatcher.BeginInvoke(() => { Progress.Show("Loading"); });
|
|
|
+ if (JobFilterID == Guid.Empty)
|
|
|
+ {
|
|
|
+ var list = _models
|
|
|
+ .Where(x => x.Search(Search.Text.Split()))
|
|
|
+ .OrderBy(x => x.EmployeeID == EmployeeID ? 0 : 1).ThenBy(x => x.DueDate);
|
|
|
+ Dispatcher.BeginInvoke(() => { Kanban.ItemsSource = list; });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var list = _models
|
|
|
+ .Where(x => x.Search(Search.Text.Split()) && x.JobSearch(JobFilterID))
|
|
|
+ .OrderBy(x => x.EmployeeID == EmployeeID ? 0 : 1).ThenBy(x => x.DueDate);
|
|
|
+ Dispatcher.BeginInvoke(() => { Kanban.ItemsSource = list; });
|
|
|
+ }
|
|
|
+ Task.Run(() =>
|
|
|
+ {
|
|
|
+ Thread.Sleep(500);
|
|
|
+ Dispatcher.BeginInvoke(() =>
|
|
|
+ {
|
|
|
+ Progress.Close();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
@@ -1514,5 +1539,49 @@ namespace PRSDesktop
|
|
|
list.ShowDialog();
|
|
|
SetupKanbanTypesLookup(true);
|
|
|
}
|
|
|
+
|
|
|
+ private void JobFilterBtn_OnClick(object sender, RoutedEventArgs e)
|
|
|
+ {
|
|
|
+ if (JobFilterID != Guid.Empty)
|
|
|
+ {
|
|
|
+ JobFilterBtn.Content = "Filter Job";
|
|
|
+ JobFilterID = Guid.Empty;
|
|
|
+ FilterKanbans();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var window = new ThemableWindow();
|
|
|
+ var grid = new JobGrid();
|
|
|
+ grid.Options.Remove(DynamicGridOption.EditRows);
|
|
|
+ grid.Options.Remove(DynamicGridOption.DeleteRows);
|
|
|
+ grid.Options.Remove(DynamicGridOption.AddRows);
|
|
|
+ grid.Options.Remove(DynamicGridOption.MultiSelect);
|
|
|
+ grid.Options.Remove(DynamicGridOption.ExportData);
|
|
|
+ grid.Options.Remove(DynamicGridOption.ImportData);
|
|
|
+ grid.OnSelectItem += (object sender, DynamicGridSelectionEventArgs e) =>
|
|
|
+ {
|
|
|
+ if ((sender as JobGrid).SelectedRows.Count() == 0)
|
|
|
+ return;
|
|
|
+
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var item = (sender as JobGrid).SelectedRows[0];
|
|
|
+ AddJobFilter(item);
|
|
|
+ window.Close();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ grid.Refresh(true, true);
|
|
|
+ window.Content = grid;
|
|
|
+ window.ShowDialog();
|
|
|
+ }
|
|
|
+
|
|
|
+ Guid JobFilterID = Guid.Empty;
|
|
|
+
|
|
|
+ private void AddJobFilter(CoreRow item)
|
|
|
+ {
|
|
|
+ JobFilterID = item.Get<Job, Guid>(x => x.ID);
|
|
|
+ JobFilterBtn.Content = item.Get<Job, string>(x => x.JobNumber) + " (click to cancel)";
|
|
|
+ FilterKanbans();
|
|
|
+ }
|
|
|
}
|
|
|
}
|