|  | @@ -39,10 +39,11 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |          bool bSharedDeviceFirstLoad = true;
 | 
	
		
			
				|  |  |          bool bSharedDevice = false;
 | 
	
		
			
				|  |  |          int NumberOfNotfications = 0;
 | 
	
		
			
				|  |  | -        private Job _job = new Job();
 | 
	
		
			
				|  |  | +        private JobShell _job = new JobShell();
 | 
	
		
			
				|  |  |          string deviceName = "";
 | 
	
		
			
				|  |  |          string matchedDeviceName = "";
 | 
	
		
			
				|  |  |          int notCount = 1;
 | 
	
		
			
				|  |  | +        Assignment currentAssignment = null;
 | 
	
		
			
				|  |  |          #endregion
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #region Constructor
 | 
	
	
		
			
				|  | @@ -92,6 +93,9 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                  //if (GlobalVariables.EmpID == Guid.Parse("40f6ccd9-5272-4b1a-99bf-de7542205aac"))
 | 
	
		
			
				|  |  |                  //RunCustomScript();
 | 
	
		
			
				|  |  |                  NotifyChanges();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +                CheckCurrentAssignment();
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              catch (Exception e)
 | 
	
		
			
				|  |  |              {
 | 
	
	
		
			
				|  | @@ -100,20 +104,63 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              NavigationPage.SetHasBackButton(this, false);
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        private void CheckCurrentAssignment()
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            Task.Run(() =>
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                Thread.Sleep(5000);
 | 
	
		
			
				|  |  | +                StartAssignmentTimer();
 | 
	
		
			
				|  |  | +                CoreTable table = new Client<Assignment>().Query(
 | 
	
		
			
				|  |  | +                    new Filter<Assignment>(x => x.EmployeeLink.ID).IsEqualTo(GlobalVariables.EmpID)
 | 
	
		
			
				|  |  | +                    .And(x => x.Date).IsEqualTo(DateTime.Today.Date)
 | 
	
		
			
				|  |  | +                    .And(x => x.Actual.Finish).IsEqualTo(null),
 | 
	
		
			
				|  |  | +                    null,
 | 
	
		
			
				|  |  | +                    new SortOrder<Assignment>(x => x.Actual.Start, SortDirection.Ascending));
 | 
	
		
			
				|  |  | +                if (!table.Rows.Any())
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    _job.OnJobIDChanged += OnJobIDChanged;
 | 
	
		
			
				|  |  | +                    return;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +                var assgn = table.Rows.LastOrDefault().ToObject<Assignment>();
 | 
	
		
			
				|  |  | +                Device.BeginInvokeOnMainThread(async () =>
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    string chosenOption = await DisplayActionSheet("Continue with current unfinished assignment?", "Cancel", null, "Yes", "No");
 | 
	
		
			
				|  |  | +                    switch(chosenOption) 
 | 
	
		
			
				|  |  | +                    {
 | 
	
		
			
				|  |  | +                        case "Yes":
 | 
	
		
			
				|  |  | +                            currentAssignment = assgn;
 | 
	
		
			
				|  |  | +                            SaveCurrentAssignment("PRS Mobile main screen - saving assignment on re-login to App");
 | 
	
		
			
				|  |  | +                            if (currentAssignment.JobLink.ID != Guid.Empty)
 | 
	
		
			
				|  |  | +                            {
 | 
	
		
			
				|  |  | +                                _job.ID = currentAssignment.JobLink.ID;
 | 
	
		
			
				|  |  | +                                var job = new Client<Job>().Query(new Filter<Job>(x => x.ID).IsEqualTo(_job.ID)).Rows.FirstOrDefault().ToObject<Job>();
 | 
	
		
			
				|  |  | +                                _job.JobNumber = job.JobNumber;
 | 
	
		
			
				|  |  | +                                _job.Name = job.Name;
 | 
	
		
			
				|  |  | +                                RefreshJobBtn();
 | 
	
		
			
				|  |  | +                                _job.OnJobIDChanged += OnJobIDChanged;
 | 
	
		
			
				|  |  | +                            }            
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                        default:
 | 
	
		
			
				|  |  | +                            _job.OnJobIDChanged += OnJobIDChanged;
 | 
	
		
			
				|  |  | +                            break;
 | 
	
		
			
				|  |  | +                    };
 | 
	
		
			
				|  |  | +                });               
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private void RunCustomScript()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            
 | 
	
		
			
				|  |  | -        }      
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private void NotifyChanges()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            Task.Run(() => 
 | 
	
		
			
				|  |  | +            Task.Run(() =>
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  string changes = NotifyMobileChanges.Notifiy();
 | 
	
		
			
				|  |  |                  if (!string.IsNullOrWhiteSpace(changes))
 | 
	
		
			
				|  |  | -                    Device.BeginInvokeOnMainThread(() => 
 | 
	
		
			
				|  |  | +                    Device.BeginInvokeOnMainThread(() =>
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  |                          DisplayAlert("Latest changes", changes, "OK");
 | 
	
		
			
				|  |  |                      });
 | 
	
	
		
			
				|  | @@ -301,8 +348,9 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                          addNoteBtn.IsEnabled = false;
 | 
	
		
			
				|  |  |                          jobBtn.IsEnabled = false;
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  | -                    if (firstLoad)
 | 
	
		
			
				|  |  | -                        RefreshJobFromTimeSheet(timesheet);
 | 
	
		
			
				|  |  | +                    //if (firstLoad)
 | 
	
		
			
				|  |  | +                    //    RefreshJobFromTimeSheet(timesheet);
 | 
	
		
			
				|  |  | +                    RefreshJobBtn();
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |                      homeScreenGrid.RaiseChild(CurrentLocation);
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -318,6 +366,14 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              //CurrentLocation.IsEnabled = PRSReady && GateReady;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        private void RefreshJobBtn()
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            if (_job.ID == Guid.Empty)
 | 
	
		
			
				|  |  | +                jobBtn.Text = "No Job Selected";
 | 
	
		
			
				|  |  | +            else if(!string.IsNullOrWhiteSpace(_job.JobNumber))
 | 
	
		
			
				|  |  | +                jobBtn.Text = "Job: " + _job.JobNumber;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          private void RefreshJobFromTimeSheet(CoreRow timesheet)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              Guid jobid = timesheet == null ? Guid.Empty : timesheet.Get<TimeSheet, Guid>(x => x.JobLink.ID);
 | 
	
	
		
			
				|  | @@ -331,7 +387,7 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |              else
 | 
	
		
			
				|  |  |              {
 | 
	
		
			
				|  |  |                  jobBtn.Text = "No Job Selected";
 | 
	
		
			
				|  |  | -                _job = new Job();
 | 
	
		
			
				|  |  | +                _job = new JobShell();
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -640,6 +696,61 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |          #endregion
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          #region Utilities
 | 
	
		
			
				|  |  | +        private void OnJobIDChanged(Guid jobid)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            if (currentAssignment == null)
 | 
	
		
			
				|  |  | +                CreateNewAssignment(jobid);
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +            {
 | 
	
		
			
				|  |  | +                SaveCurrentAssignment("PRS Mobile main screen - saving assignment on job change", true);
 | 
	
		
			
				|  |  | +                CreateNewAssignment(jobid);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void StartAssignmentTimer()
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            Timer t = new Timer(AssignmentTimerCallback, null, 300000, 300000);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void AssignmentTimerCallback(object state)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            if (currentAssignment != null)
 | 
	
		
			
				|  |  | +                SaveCurrentAssignment("PRS MObile main screen - Saving assignment on 5 minute timer");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void CreateNewAssignment(Guid jobid)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            currentAssignment = new Assignment { Date = DateTime.Now.Date };
 | 
	
		
			
				|  |  | +            currentAssignment.EmployeeLink.ID = GlobalVariables.EmpID;
 | 
	
		
			
				|  |  | +            currentAssignment.JobLink.ID = jobid;
 | 
	
		
			
				|  |  | +            currentAssignment.Actual.Start = RoundToNearestInterval(DateTime.Now, new TimeSpan(0, 5, 0)).TimeOfDay;
 | 
	
		
			
				|  |  | +            currentAssignment.Booked.Start = currentAssignment.Actual.Start;
 | 
	
		
			
				|  |  | +            currentAssignment.Booked.Finish = RoundToNearestInterval(DateTime.Now, new TimeSpan(0, 5, 0)).TimeOfDay.Add(new TimeSpan(0, 5, 0));
 | 
	
		
			
				|  |  | +            var job = new Client<Job>().Query(new Filter<Job>(x => x.ID).IsEqualTo(jobid)).Rows.FirstOrDefault().ToObject<Job>();
 | 
	
		
			
				|  |  | +            currentAssignment.Title = "Clocking on to job " + job.Name + " (" + job.JobNumber + ") on PRS Mobile";
 | 
	
		
			
				|  |  | +            new Client<Assignment>().Save(currentAssignment, "Changed job on mobile - creating new assignment");
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        private void SaveCurrentAssignment(string auditnote, bool complete = false)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            if (!complete)
 | 
	
		
			
				|  |  | +                currentAssignment.Booked.Finish = RoundToNearestInterval(DateTime.Now, new TimeSpan(0, 5, 0)).TimeOfDay;
 | 
	
		
			
				|  |  | +            else
 | 
	
		
			
				|  |  | +                currentAssignment.Actual.Finish = RoundToNearestInterval(DateTime.Now, new TimeSpan(0, 5, 0)).TimeOfDay;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            new Client<Assignment>().Save(currentAssignment, auditnote);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        static DateTime RoundToNearestInterval(DateTime dt, TimeSpan d)
 | 
	
		
			
				|  |  | +        {
 | 
	
		
			
				|  |  | +            int f = 0;
 | 
	
		
			
				|  |  | +            double m = (double)(dt.Ticks % d.Ticks) / d.Ticks;
 | 
	
		
			
				|  |  | +            if (m >= 0.5)
 | 
	
		
			
				|  |  | +                f = 1;
 | 
	
		
			
				|  |  | +            return new DateTime(((dt.Ticks / d.Ticks) + f) * d.Ticks);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          private void InitNotificationCentre()
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  |              try
 | 
	
	
		
			
				|  | @@ -925,6 +1036,12 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                  midnightTimerOn = false;
 | 
	
		
			
				|  |  |                  Timer last60Seconds = new Timer(Last60SecondsTimerCallBack, null, 5000, Timeout.Infinite);
 | 
	
		
			
				|  |  |                  clockedOffInLast5Seconds = true;
 | 
	
		
			
				|  |  | +                if (currentAssignment != null)
 | 
	
		
			
				|  |  | +                {
 | 
	
		
			
				|  |  | +                    SaveCurrentAssignment("PRS Mobile - clocking off", true);
 | 
	
		
			
				|  |  | +                    currentAssignment = null;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              catch { }
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -999,6 +1116,7 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                      _job.ID = jobSelectionPage.Job.ID;
 | 
	
		
			
				|  |  |                      _job.JobNumber = jobSelectionPage.Job.JobNumber;
 | 
	
		
			
				|  |  |                      _job.Name = jobSelectionPage.Job.Name;
 | 
	
		
			
				|  |  | +                    RefreshScreen();
 | 
	
		
			
				|  |  |                      JobPage_OnItemSelected(jobSelectionPage.Job);
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  |                  Navigation.PushAsync(jobSelectionPage);
 | 
	
	
		
			
				|  | @@ -1008,60 +1126,60 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private void JobPage_OnItemSelected(JobShell job)
 | 
	
		
			
				|  |  |          {
 | 
	
		
			
				|  |  | -            try
 | 
	
		
			
				|  |  | -            {
 | 
	
		
			
				|  |  | -                TimeSheet timesheet = App.Data.TimeSheets?.Rows.FirstOrDefault()?.ToObject<TimeSheet>();
 | 
	
		
			
				|  |  | -                if (timesheet == null)
 | 
	
		
			
				|  |  | -                    return;
 | 
	
		
			
				|  |  | +            //try
 | 
	
		
			
				|  |  | +            //{
 | 
	
		
			
				|  |  | +            //    TimeSheet timesheet = App.Data.TimeSheets?.Rows.FirstOrDefault()?.ToObject<TimeSheet>();
 | 
	
		
			
				|  |  | +            //    if (timesheet == null)
 | 
	
		
			
				|  |  | +            //        return;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                String auditmessage = String.Format("Changed Selected Job to: {0}: {1}", timesheet.JobLink.JobNumber, timesheet.JobLink.Name);
 | 
	
		
			
				|  |  | -                if (ZeroLengthTimesheet())
 | 
	
		
			
				|  |  | -                {
 | 
	
		
			
				|  |  | -                    timesheet.JobLink.ID = job.ID;
 | 
	
		
			
				|  |  | -                    timesheet.JobLink.JobNumber = job.JobNumber;
 | 
	
		
			
				|  |  | -                    timesheet.JobLink.Name = job.Name;
 | 
	
		
			
				|  |  | -                    bUpdatingTimesheet = true;
 | 
	
		
			
				|  |  | -                    new Client<TimeSheet>().Save(timesheet, auditmessage);
 | 
	
		
			
				|  |  | +            //    String auditmessage = String.Format("Changed Selected Job to: {0}: {1}", timesheet.JobLink.JobNumber, timesheet.JobLink.Name);
 | 
	
		
			
				|  |  | +            //    if (ZeroLengthTimesheet())
 | 
	
		
			
				|  |  | +            //    {
 | 
	
		
			
				|  |  | +            //        timesheet.JobLink.ID = job.ID;
 | 
	
		
			
				|  |  | +            //        timesheet.JobLink.JobNumber = job.JobNumber;
 | 
	
		
			
				|  |  | +            //        timesheet.JobLink.Name = job.Name;
 | 
	
		
			
				|  |  | +            //        bUpdatingTimesheet = true;
 | 
	
		
			
				|  |  | +            //        new Client<TimeSheet>().Save(timesheet, auditmessage);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -                    Device.BeginInvokeOnMainThread(() =>
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -                        if (timesheet.JobLink.ID != Guid.Empty)
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            jobBtn.Text = "(" + timesheet.JobLink.JobNumber + ") " + timesheet.JobLink.Name;
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                        else
 | 
	
		
			
				|  |  | -                        {
 | 
	
		
			
				|  |  | -                            jobBtn.Text = "No Job Selected";
 | 
	
		
			
				|  |  | -                        }
 | 
	
		
			
				|  |  | -                    });
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                else
 | 
	
		
			
				|  |  | -                {
 | 
	
		
			
				|  |  | -                    InABox.Core.Location here = new InABox.Core.Location()
 | 
	
		
			
				|  |  | -                    {
 | 
	
		
			
				|  |  | -                        Latitude = App.GPS.Latitude,
 | 
	
		
			
				|  |  | -                        Longitude = App.GPS.Longitude,
 | 
	
		
			
				|  |  | -                        Timestamp = DateTime.Now
 | 
	
		
			
				|  |  | -                    };
 | 
	
		
			
				|  |  | -                    TimeSpan tod = DateTime.Now - DateTime.Today;
 | 
	
		
			
				|  |  | -                    timesheet.Finish = new TimeSpan(tod.Hours, tod.Minutes, 0);
 | 
	
		
			
				|  |  | -                    timesheet.FinishLocation = here;
 | 
	
		
			
				|  |  | -                    new Client<TimeSheet>().Save(timesheet, "Changing Job");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -                    CreateTimeSheet(
 | 
	
		
			
				|  |  | -                        job.ID,
 | 
	
		
			
				|  |  | -                        job.JobNumber,
 | 
	
		
			
				|  |  | -                        job.Name,
 | 
	
		
			
				|  |  | -                        here,
 | 
	
		
			
				|  |  | -                        App.GPS.Address,
 | 
	
		
			
				|  |  | -                        auditmessage
 | 
	
		
			
				|  |  | -                    );
 | 
	
		
			
				|  |  | -                }
 | 
	
		
			
				|  |  | -                RefreshScreen();
 | 
	
		
			
				|  |  | -            }
 | 
	
		
			
				|  |  | -            catch { }
 | 
	
		
			
				|  |  | +            //        Device.BeginInvokeOnMainThread(() =>
 | 
	
		
			
				|  |  | +            //        {
 | 
	
		
			
				|  |  | +            //            if (timesheet.JobLink.ID != Guid.Empty)
 | 
	
		
			
				|  |  | +            //            {
 | 
	
		
			
				|  |  | +            //                jobBtn.Text = "(" + timesheet.JobLink.JobNumber + ") " + timesheet.JobLink.Name;
 | 
	
		
			
				|  |  | +            //            }
 | 
	
		
			
				|  |  | +            //            else
 | 
	
		
			
				|  |  | +            //            {
 | 
	
		
			
				|  |  | +            //                jobBtn.Text = "No Job Selected";
 | 
	
		
			
				|  |  | +            //            }
 | 
	
		
			
				|  |  | +            //        });
 | 
	
		
			
				|  |  | +            //    }
 | 
	
		
			
				|  |  | +            //    else
 | 
	
		
			
				|  |  | +            //    {
 | 
	
		
			
				|  |  | +            //        InABox.Core.Location here = new InABox.Core.Location()
 | 
	
		
			
				|  |  | +            //        {
 | 
	
		
			
				|  |  | +            //            Latitude = App.GPS.Latitude,
 | 
	
		
			
				|  |  | +            //            Longitude = App.GPS.Longitude,
 | 
	
		
			
				|  |  | +            //            Timestamp = DateTime.Now
 | 
	
		
			
				|  |  | +            //        };
 | 
	
		
			
				|  |  | +            //        TimeSpan tod = DateTime.Now - DateTime.Today;
 | 
	
		
			
				|  |  | +            //        timesheet.Finish = new TimeSpan(tod.Hours, tod.Minutes, 0);
 | 
	
		
			
				|  |  | +            //        timesheet.FinishLocation = here;
 | 
	
		
			
				|  |  | +            //        new Client<TimeSheet>().Save(timesheet, "Changing Job");
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            //        CreateTimeSheet(
 | 
	
		
			
				|  |  | +            //            job.ID,
 | 
	
		
			
				|  |  | +            //            job.JobNumber,
 | 
	
		
			
				|  |  | +            //            job.Name,
 | 
	
		
			
				|  |  | +            //            here,
 | 
	
		
			
				|  |  | +            //            App.GPS.Address,
 | 
	
		
			
				|  |  | +            //            auditmessage
 | 
	
		
			
				|  |  | +            //        );
 | 
	
		
			
				|  |  | +            //    }
 | 
	
		
			
				|  |  | +            //    RefreshScreen();
 | 
	
		
			
				|  |  | +            //}
 | 
	
		
			
				|  |  | +            //catch { }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          private bool CheckTimeSheetAgainstGates(TimeSheet timesheet)
 | 
	
	
		
			
				|  | @@ -1646,7 +1764,7 @@ namespace comal.timesheets
 | 
	
		
			
				|  |  |                      };
 | 
	
		
			
				|  |  |                      Site.OnTapped += ((object sender, EventArgs e) =>
 | 
	
		
			
				|  |  |                      {
 | 
	
		
			
				|  |  | -                        Site site = new Site(_job);
 | 
	
		
			
				|  |  | +                        Site site = new Site(new Job { ID = _job.ID, Name = _job.Name, JobNumber = _job.JobNumber });
 | 
	
		
			
				|  |  |                          Navigation.PushAsync(site);
 | 
	
		
			
				|  |  |                          //if (_job.ID == Guid.Empty)
 | 
	
		
			
				|  |  |                          //{
 |