소스 검색

PRS MOBILE - colour expressions for Digital Forms, Improvement to Assignments on mainpage

Nick-PRSDigital@bitbucket.org 2 년 전
부모
커밋
9e06e923a2
2개의 변경된 파일20개의 추가작업 그리고 6개의 파일을 삭제
  1. 18 5
      prs.mobile/comal.timesheets/DigitalForms/Renderer/QAFormViewer.cs
  2. 2 1
      prs.mobile/comal.timesheets/Main/MainPageUtils.cs

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

@@ -15,6 +15,7 @@ using Comal.Classes;
 using PRSClasses;
 using Newtonsoft.Json;
 using Java.Security.Cert;
+using Xamarin.Essentials;
 
 namespace comal.timesheets.QAForms
 {
@@ -488,7 +489,7 @@ namespace comal.timesheets.QAForms
 
                 if (loadData.TryGetValue(dfLayoutStringField.Name, out value))
                 {
-                    item.Text = value;           
+                    item.Text = value;
                     button.Text = value.Length > 25 ? value.Substring(0, 25) + "..." : value;
                 }
                 if (loadRetainedForm)
@@ -1867,10 +1868,10 @@ namespace comal.timesheets.QAForms
                 {
                     (view as DataButtonControl).Data = value.ToString();
                     (view as DataButtonControl).Text = value.ToString();
-                }                  
+                }
                 else
                     (view as Editor).Text = value.ToString();
-            }             
+            }
 
             else if (field is DFLayoutDateField)
                 (view as DatePicker).Date = (DateTime)(value as DateTime?);
@@ -1945,7 +1946,7 @@ namespace comal.timesheets.QAForms
                 else
                     return (view as Editor).Text;
             }
-                
+
             else if (field is DFLayoutIntegerField)
                 return int.Parse((view as Editor).Text);
 
@@ -2112,7 +2113,19 @@ namespace comal.timesheets.QAForms
 
         public void SetFieldColour(string field, System.Drawing.Color? colour = null)
         {
-            //find the view, set the background colour
+            if (colour != null)
+            {
+                try
+                {
+                    System.Drawing.Color color = (System.Drawing.Color)colour;
+                    FindView(field).Item2.BackgroundColor = Color.FromRgba(
+                        Convert.ToDouble(color.R),
+                        Convert.ToDouble(color.G),
+                        Convert.ToDouble(color.B),
+                        Convert.ToDouble(color.A));
+                }
+                catch { }
+            }
         }
         #endregion
 

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

@@ -121,7 +121,8 @@ 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.Completed).IsEqualTo(null),
+                     .And(x => x.Completed).IsEqualTo(null)
+                     .And(x => x.Booked.Finish).IsEqualTo(null),
                      null,
                      new SortOrder<Assignment>(x => x.Actual.Start, SortDirection.Ascending));
             if (!table.Rows.Any())