Browse Source

Added Number Fields to EntityForm classes

Frank van den Bos 2 years ago
parent
commit
dce39673e2

+ 3 - 0
prs.mobile.new/PRS.Mobile/Data Models/Details/Assignment/AssignmentFormShell.cs

@@ -11,6 +11,7 @@ namespace PRS.Mobile
         {
             columns
                 .Map(nameof(ID), x => x.ID)
+                .Map(nameof(Number), x=>x.Number)
                 .Map(nameof(ParentID), x => x.Parent.ID)
                 .Map(nameof(FormID), x=>x.Form.ID)
                 .Map(nameof(FormCode), x => x.Form.Code)
@@ -22,6 +23,8 @@ namespace PRS.Mobile
 
         public Guid ID => Get<Guid>();
 
+        public String Number => Get<String>();
+        
         public Guid ParentID
         {
             get => Get<Guid>();

+ 3 - 0
prs.mobile.new/PRS.Mobile/Data Models/Details/Employee/EmployeeFormShell.cs

@@ -9,6 +9,7 @@ namespace PRS.Mobile
         {
             columns
                 .Map(nameof(ID), x => x.ID)
+                .Map(nameof(Number), x=>x.Number)
                 .Map(nameof(ParentID), x => x.Parent.ID)
                 .Map(nameof(FormID), x => x.Form.ID)
                 .Map(nameof(FormCode), x => x.Form.Code)
@@ -20,6 +21,8 @@ namespace PRS.Mobile
 
         public Guid ID => Get<Guid>();
 
+        public String Number => Get<String>();
+
         public Guid ParentID
         {
             get => Get<Guid>();

+ 1 - 1
prs.mobile.new/PRS.Mobile/Data Models/Lists/DigitalForm/DigitalFormShell.cs

@@ -8,7 +8,7 @@ namespace PRS.Mobile
         protected override void ConfigureColumns(ShellColumns<DigitalFormModel, EmployeeDigitalForm> columns)
         {
             columns
-                .Map(nameof(ID), x => x.ID)
+                .Map(nameof(ID), x => x.Form.ID)
                 .Map(nameof(Code), x => x.Form.Code)
                 .Map(nameof(Description), x => x.Form.Description)
                 .Map(nameof(AppliesTo), x => x.Form.AppliesTo)

+ 1 - 0
prs.mobile.new/PRS.Mobile/Data Models/Lists/DigitalFormInstance/IDigitalFormInstanceShell.cs

@@ -6,6 +6,7 @@ namespace PRS.Mobile
     public interface IDigitalFormInstanceShell
     {
         Guid ID { get; }
+        String Number { get; }
         Guid ParentID { get; set; }
         Guid FormID { get; set; }
         String FormCode { get; set; }

+ 3 - 0
prs.mobile.new/PRS.Mobile/Data Models/Lists/JobForm/JobDetailFormShell.cs

@@ -10,6 +10,7 @@ namespace PRS.Mobile
         {
             columns
                 .Map(nameof(ID), x => x.ID)
+                .Map(nameof(Number), x=>x.Number)
                 .Map(nameof(ParentID), x => x.Parent.ID)
                 .Map(nameof(FormID), x=>x.Form.ID)
                 .Map(nameof(FormCode), x => x.Form.Code)
@@ -21,6 +22,8 @@ namespace PRS.Mobile
 
         public Guid ID => Get<Guid>();
 
+        public String Number => Get<String>();
+
         public Guid ParentID
         {
             get => Get<Guid>();

+ 3 - 0
prs.mobile.new/PRS.Mobile/Data Models/Lists/JobITPForm/JobITPFormShell.cs

@@ -11,6 +11,7 @@ namespace PRS.Mobile
         {
             columns
                 .Map(nameof(ID), x => x.ID)
+                .Map(nameof(Number), x=>x.Number)
                 .Map(nameof(ParentID), x => x.Parent.ID)
                 .Map(nameof(FormID), x=>x.Form.ID)
                 .Map(nameof(FormCode), x => x.Form.Code)
@@ -21,6 +22,8 @@ namespace PRS.Mobile
         }
 
         public Guid ID => Get<Guid>();
+        
+        public String Number => Get<String>();
 
         public Guid ParentID
         {

+ 3 - 0
prs.mobile.new/PRS.Mobile/Data Models/Lists/KanbanForm/KanbanFormShell.cs

@@ -11,6 +11,7 @@ namespace PRS.Mobile
         {
             columns
                 .Map(nameof(ID), x => x.ID)
+                .Map(nameof(Number), x=>x.Number)
                 .Map(nameof(ParentID), x => x.Parent.ID)
                 .Map(nameof(FormID), x=>x.Form.ID)
                 .Map(nameof(FormCode), x => x.Form.Code)
@@ -22,6 +23,8 @@ namespace PRS.Mobile
 
         public Guid ID => Get<Guid>();
 
+        public String Number => Get<String>();
+
         public Guid ParentID
         {
             get => Get<Guid>();

+ 16 - 0
prs.mobile.new/PRS.Mobile/DigitalForms/ExistingForms/ExistingForms.xaml

@@ -67,6 +67,7 @@
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition Width="Auto"/>
                                     <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="Auto"/>
                                 </Grid.ColumnDefinitions>
                             
                                 <Image 
@@ -83,6 +84,7 @@
                                 <ui:MaterialLabel 
                                     Grid.Row="0"
                                     Grid.Column="1"
+                                    Grid.ColumnSpan="2"
                                     Text="{Binding FormDescription}" 
                                     TypeScale="H6" 
                                     HorizontalOptions="Fill" 
@@ -104,6 +106,20 @@
                                     LineBreakMode="WordWrap"
                                     LineHeight="1.0"
                                     Margin="0"/>
+                                    
+                                                                    
+                                <ui:MaterialLabel 
+                                    Grid.Row="1"
+                                    Grid.Column="2"
+                                    Text="{Binding Number}" 
+                                    TypeScale="Body2" 
+                                    HorizontalOptions="Fill" 
+                                    HorizontalTextAlignment="Start" 
+                                    VerticalOptions="Fill"
+                                    VerticalTextAlignment="Start"
+                                    LineBreakMode="WordWrap"
+                                    LineHeight="1.0"
+                                    Margin="0"/>
                                 
                             </Grid>
 

+ 1 - 1
prs.mobile.new/PRS.Mobile/DigitalForms/NewForms/NewForms.xaml

@@ -65,7 +65,7 @@
                                     Grid.RowSpan="2" 
                                     Grid.Column="0" 
                                     Margin="5"
-                                    Source="forms.png" 
+                                    Source="digitalform.png" 
                                     HeightRequest="48" 
                                     WidthRequest="48" 
                                     VerticalOptions="Center" 

+ 7 - 2
prs.mobile.new/PRS.Mobile/DigitalForms/NewForms/NewForms.xaml.cs

@@ -13,7 +13,12 @@ namespace PRS.Mobile
 
     public class NewFormSelectedArgs : EventArgs
     {
-        
+        public DigitalFormShell Form { get; private set; }
+
+        public NewFormSelectedArgs(DigitalFormShell form)
+        {
+            Form = form;
+        }
     }
     
     public delegate void NewFormSelectedEvent(object sender, NewFormSelectedArgs args);
@@ -80,7 +85,7 @@ namespace PRS.Mobile
 
         private async void _digitalforms_OnItemTapped(object sender, MobileListItemTappedEventArgs args)
         {
-            ItemSelected?.Invoke(this, new NewFormSelectedArgs());
+            ItemSelected?.Invoke(this, new NewFormSelectedArgs(sender as DigitalFormShell));
             Navigation.PopAsync();
         }
     }

+ 9 - 1
prs.mobile.new/PRS.Mobile/Modules/Site/SiteForms/SiteForms.xaml.cs

@@ -39,7 +39,15 @@ namespace PRS.Mobile
 
         private async void CreateNewForm(object sender, NewFormSelectedArgs args)
         {
-            await MaterialDialog.Instance.AlertAsync("Not Implemented Yet!");
+            var instance = _model.AddItem();
+            instance.ParentID = JobID;
+            instance.FormID = args.Form.ID;
+            instance.FormCode = args.Form.Code;
+            instance.FormDescription = args.Form.Description;
+            instance.Save("Created on Mobile Device");
+            
+            _model.Search(null);
+            _forms.RefreshData(false,false);
         }
     }
 }