aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
index aef6dd549..86c53440e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
@@ -272,15 +272,20 @@ namespace Tango.PPC.Jobs.ViewModels
{
LogManager.Log($"Job '{job.Name}' selected.");
+ RaiseMessage(new JobSelectedMessage() { Job = job, Context = _db });
+
if (!directlyToEdit && MachineProvider.MachineOperator.Status == Integration.Operation.MachineStatuses.ReadyToDye)
{
- await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView));
+ await NavigationManager.NavigateWithObject<JobsModule, JobSummeryView, JobSummeryNavigationObject>(new JobSummeryNavigationObject()
+ {
+ Context = _db,
+ Job = job,
+ });
}
else
{
await NavigationManager.NavigateTo<JobsModule>(nameof(JobView));
}
- RaiseMessage(new JobSelectedMessage() { Job = job, Context = _db });
}
/// <summary>
@@ -307,7 +312,7 @@ namespace Tango.PPC.Jobs.ViewModels
Jobs = jobs;
DraftJobsCollectionView = new ListCollectionView(Jobs);
DraftJobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending));
- DraftJobsCollectionView.Filter = new Predicate<object>(x =>
+ DraftJobsCollectionView.Filter = new Predicate<object>(x =>
{
var job = x as Job;
@@ -324,7 +329,7 @@ namespace Tango.PPC.Jobs.ViewModels
HistoryJobsCollectionView = new ListCollectionView(Jobs);
HistoryJobsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Job.LastUpdated), ListSortDirection.Descending));
- HistoryJobsCollectionView.Filter = new Predicate<object>(x =>
+ HistoryJobsCollectionView.Filter = new Predicate<object>(x =>
{
var job = x as Job;
@@ -427,7 +432,7 @@ namespace Tango.PPC.Jobs.ViewModels
job.RmlGuid = machine.DefaultRml != null ? machine.DefaultRmlGuid : Adapter.Rmls.FirstOrDefault().Guid;
job.WindingMethodGuid = Adapter.WindingMethods.FirstOrDefault().Guid;
job.SpoolTypeGuid = machine.DefaultSpoolType != null ? machine.DefaultSpoolTypeGuid : Adapter.SpoolTypes.FirstOrDefault().Guid;
-
+
if (Jobs.Count > 0)
{
job.JobIndex = Jobs.Max(x => x.JobIndex) + 1;