|
|
@@ -4,6 +4,7 @@ using InABox.Clients;
|
|
|
using InABox.Core;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using System.Threading.Tasks;
|
|
|
using Xamarin.Forms;
|
|
|
using PRSSecurity = InABox.Core.Security;
|
|
|
@@ -22,8 +23,14 @@ namespace comal.timesheets
|
|
|
List<JobShell> jobShells = new List<JobShell>();
|
|
|
|
|
|
if (GlobalVariables.IsJobOnlyEmployee)
|
|
|
- foreach (var job in GlobalVariables.EmployeeJobs)
|
|
|
- jobShells.Add(job);
|
|
|
+ {
|
|
|
+ CoreTable table = new Client<JobEmployee>().Query(new Filter<JobEmployee>(x => x.EmployeeLink.ID).IsEqualTo(GlobalVariables.EmpID));
|
|
|
+ if (!table.Rows.Any())
|
|
|
+ return;
|
|
|
+
|
|
|
+ foreach (CoreRow row in table.Rows)
|
|
|
+ jobShells.Add(AddJobShell(row));
|
|
|
+ }
|
|
|
|
|
|
else
|
|
|
foreach (CoreRow row in DoJobsQuery(AssignFilter()).Rows)
|
|
|
@@ -86,6 +93,7 @@ namespace comal.timesheets
|
|
|
JobStatusDescription = job.JobStatus.Description,
|
|
|
Color = Color.FromHex(job.Color)
|
|
|
};
|
|
|
+
|
|
|
if (jobshell.JobStatusDescription.Equals("Active Projects"))
|
|
|
jobshell.JobStatusDescription = "Active";
|
|
|
else if (jobshell.JobStatusDescription.Equals("Projects - Hidden from View"))
|
|
|
@@ -97,6 +105,17 @@ namespace comal.timesheets
|
|
|
|
|
|
return jobshell;
|
|
|
}
|
|
|
+
|
|
|
+ private static JobShell AddJobShell(CoreRow row)
|
|
|
+ {
|
|
|
+ JobShell job = new JobShell();
|
|
|
+ job.ID = row.Get<JobEmployee, Guid>(x => x.JobLink.ID);
|
|
|
+ job.JobNumber = row.Get<JobEmployee, string>(x => x.JobLink.JobNumber);
|
|
|
+ job.Name = row.Get<JobEmployee, string>(x => x.JobLink.Name);
|
|
|
+ job.JobStatusDescription = row.Get<JobEmployee, string>(x => x.JobLink.JobStatus.Description);
|
|
|
+ job.DisplayName = "(" + job.JobNumber + ") " + job.Name;
|
|
|
+ return job;
|
|
|
+ }
|
|
|
#endregion
|
|
|
}
|
|
|
}
|