|
@@ -26,6 +26,8 @@ namespace PRSDesktop
|
|
|
public KanbanTypeLink DocumentMilestoneKanbanType { get; set; }
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Interaction logic for JobPanel.xaml
|
|
|
/// </summary>
|
|
@@ -200,6 +202,8 @@ namespace PRSDesktop
|
|
|
JobStatus.SelectedValue = sc.Keys.First();
|
|
|
|
|
|
JobGrid.OnSelectItem += JobGrid_OnSelectItem;
|
|
|
+ JobGrid.BeforeRefresh += JobGrid_BeforeRefresh;
|
|
|
+ JobGrid.AfterRefresh += JobGrid_AfterRefresh;
|
|
|
|
|
|
Scopes.Visibility = Security.CanView<JobScope>() ? Visibility.Visible : Visibility.Collapsed;
|
|
|
Documents.Visibility = Security.CanView<JobDocumentSet>() ? Visibility.Visible : Visibility.Collapsed;
|
|
@@ -233,6 +237,26 @@ namespace PRSDesktop
|
|
|
timer.IsEnabled = true;
|
|
|
}
|
|
|
|
|
|
+ private bool _jobGridRefreshing;
|
|
|
+
|
|
|
+ private void JobGrid_BeforeRefresh(object sender, BeforeRefreshEventArgs args)
|
|
|
+ {
|
|
|
+ _jobGridRefreshing = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void JobGrid_AfterRefresh(object sender, AfterRefreshEventArgs args)
|
|
|
+ {
|
|
|
+ if (settings.CurrentJob == Guid.Empty)
|
|
|
+ {
|
|
|
+ JobGrid.SelectedRows = Array.Empty<CoreRow>();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ JobGrid.SelectedRows = JobGrid.Data.Rows.Where(x => x.Get<Job, Guid>(x => x.ID) == settings.CurrentJob).ToArray();
|
|
|
+ }
|
|
|
+ _jobGridRefreshing = false;
|
|
|
+ }
|
|
|
+
|
|
|
public void Shutdown(CancelEventArgs? cancel)
|
|
|
{
|
|
|
timer.IsEnabled = false;
|
|
@@ -316,7 +340,9 @@ namespace PRSDesktop
|
|
|
|
|
|
public void Refresh()
|
|
|
{
|
|
|
- JobGrid.StatusID = (Guid)JobStatus.SelectedValue; // Refresh(false, true);
|
|
|
+ JobGrid.StatusID = (Guid)JobStatus.SelectedValue;
|
|
|
+ JobGrid.Refresh(false, true);
|
|
|
+
|
|
|
lastselection = DateTime.MinValue;
|
|
|
}
|
|
|
|
|
@@ -520,6 +546,11 @@ namespace PRSDesktop
|
|
|
private void JobGrid_OnSelectItem(object sender, DynamicGridSelectionEventArgs e)
|
|
|
{
|
|
|
lastselection = DateTime.Now;
|
|
|
+ if (IsReady && !_jobGridRefreshing)
|
|
|
+ {
|
|
|
+ settings.CurrentJob = e.Rows?.FirstOrDefault()?.Get<Job, Guid>(x => x.ID) ?? Guid.Empty;
|
|
|
+ new UserConfiguration<JobScreenSettings>().Save(settings);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void ShowEmailInterface(PanelAction obj)
|
|
@@ -712,6 +743,7 @@ namespace PRSDesktop
|
|
|
settings.JobStatus = (Guid)JobStatus.SelectedValue;
|
|
|
new UserConfiguration<JobScreenSettings>().Save(settings);
|
|
|
JobGrid.StatusID = (Guid)JobStatus.SelectedValue;
|
|
|
+ JobGrid.Refresh(false, true);
|
|
|
}
|
|
|
}
|
|
|
|