瀏覽代碼

PRS MOBILE - changes to assignments on MainPage (no more prompts to user)

Nick-PRSDigital@bitbucket.org 2 年之前
父節點
當前提交
62ff0afb7b

+ 1 - 1
prs.mobile/comal.timesheets/DigitalForms/Renderer/QAFormViewer.cs

@@ -2059,7 +2059,7 @@ namespace comal.timesheets.QAForms
 
         public void SetFieldColour(string field, System.Drawing.Color? colour = null)
         {
-
+            //find the view, set the background colour
         }
         #endregion
 

+ 4 - 15
prs.mobile/comal.timesheets/Main/MainPage.xaml.cs

@@ -100,25 +100,14 @@ namespace comal.timesheets
 
                     MainPageUtils.OnRequestUserInput += (taskID) => { RequestUserInput(taskID); };
                     MainPageUtils.OnTaskTitleChanged += (title) => { taskBtn.Text = title; };
+                    MainPageUtils.Job.OnJobIDChanged += MainPageUtils.OnJobIDChanged;
+                    MainPageUtils.Job.OnJobNumberChanged += Job_OnJobNumberChanged;
 
                     if (assgn == null)
                         return;
 
-                    Device.BeginInvokeOnMainThread(async () =>
-                    {
-                        string chosenOption = await DisplayActionSheet("Continue with current unfinished assignment? (" + assgn.Title + " )", "Cancel", null, "Yes", "No");
-                        switch (chosenOption)
-                        {
-                            case "Yes":
-                                MainPageUtils.UseCurrentAssignment(assgn);
-                                RefreshJobBtn();
-                                break;
-                            default:
-                                MainPageUtils.Job.OnJobIDChanged += MainPageUtils.OnJobIDChanged;
-                                break;
-                        };
-                        MainPageUtils.Job.OnJobNumberChanged += Job_OnJobNumberChanged;
-                    });
+                    MainPageUtils.UseCurrentAssignment(assgn);
+                    RefreshJobBtn();
                 }
                 catch { }
             });

+ 5 - 1
prs.mobile/comal.timesheets/Main/MainPageUtils.cs

@@ -18,6 +18,7 @@ using comal.timesheets.Tasks;
 using System.IO;
 using static comal.timesheets.CustomControls.JobShell;
 using static InABox.Mobile.LocationServices;
+using iText.Kernel.XMP.Impl;
 
 namespace comal.timesheets
 {
@@ -120,7 +121,7 @@ namespace comal.timesheets
             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),
+                     .And(x => x.Completed).IsEqualTo(null),
                      null,
                      new SortOrder<Assignment>(x => x.Actual.Start, SortDirection.Ascending));
             if (!table.Rows.Any())
@@ -149,7 +150,10 @@ namespace comal.timesheets
             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;
+                CurrentAssignment.Completed = DateTime.Now;
+            }              
 
             new Client<Assignment>().Save(CurrentAssignment, auditnote);
         }