Parcourir la source

PRS MOBILE - Store Requis add notes to various places

Nick il y a 2 ans
Parent
commit
ce3c125037

+ 1 - 1
prs.mobile/comal.timesheets/StoreRequis/StoreRequiList.xaml

@@ -113,7 +113,7 @@
 
                                             <!--row 2-->
                                             <Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
-                                       Text="{Binding Request}" FontSize="Small" VerticalTextAlignment="Center" LineBreakMode="WordWrap" MaxLines="3"/>
+                                       Text="{Binding Request}" FontSize="Small" VerticalTextAlignment="Center" LineBreakMode="WordWrap"/>
 
                                         </Grid>
                                     </Frame>

+ 18 - 2
prs.mobile/comal.timesheets/StoreRequis/StoreRequiList.xaml.cs

@@ -55,7 +55,8 @@ namespace comal.timesheets.StoreRequis
                             x => x.RequestedBy.Name, //3
                             x => x.JobLink.JobNumber, //4
                             x => x.JobLink.Name, //5
-                            x => x.Request //6
+                            x => x.Request, //6
+                            x => x.Notes
                             ),
                         new SortOrder<Requisition>(x => x.Due)
                     );
@@ -77,6 +78,8 @@ namespace comal.timesheets.StoreRequis
                     requiShell.Contact = "Contact: " + list[3].ToString();
                     requiShell.Job = "(" + list[4].ToString() + ") " + list[5].ToString();
                     requiShell.Request = list[6].ToString();
+                    string notes = CheckNotes(row.Get<Requisition, string[]>(x => x.Notes));
+                    requiShell.Request = requiShell.Request + System.Environment.NewLine + notes;
 
                     requiShells.Add(requiShell);
                 }
@@ -89,6 +92,19 @@ namespace comal.timesheets.StoreRequis
             });
         }
 
+        private string CheckNotes(string[] notes)
+        {
+            string combinednotes = "----------" + System.Environment.NewLine + "NOTES: " + System.Environment.NewLine;
+            if (notes.Count() > 0)
+            {
+                foreach (var note in notes)
+                {
+                    combinednotes = combinednotes + note + System.Environment.NewLine;
+                }
+            }
+            return combinednotes;
+        }
+
         private void Requi_Clicked(object sender, EventArgs e)
         {
             RequiShell requiShell = requisListView.SelectedItem as RequiShell;
@@ -106,7 +122,7 @@ namespace comal.timesheets.StoreRequis
         {
             StoreRequiConfirmationPage storeRequiConfirmationPage = new StoreRequiConfirmationPage();
             Navigation.PushAsync(storeRequiConfirmationPage);
-        }       
+        }
     }
 
     public class RequiShell

+ 12 - 7
prs.mobile/comal.timesheets/StoreRequis/StoreRequiScannerPage.xaml

@@ -19,7 +19,7 @@
                 Text="Save" Clicked="SaveBtn_Clicked"/>
         </Grid>
     </NavigationPage.TitleView>
-    
+
     <ContentPage.Content>
         <Grid Padding="0">
             <Grid.RowDefinitions>
@@ -99,7 +99,7 @@
                         />
 
                     <Label x:Name="countLbl" HorizontalOptions="Center" VerticalOptions="Center" IsVisible="false"/>
-                    
+
                     <ListView x:Name="requiItemListView" HasUnevenRows="True" BackgroundColor="Transparent" Grid.Row="1"
                                 Margin="0,5,0,0">
                         <ListView.ItemTemplate>
@@ -110,12 +110,17 @@
                                             <Grid.RowDefinitions>
                                                 <RowDefinition Height="auto"/>
                                                 <RowDefinition Height="auto"/>
+                                                <RowDefinition Height="auto"/>
                                             </Grid.RowDefinitions>
                                             <Grid.ColumnDefinitions>
-                                                <ColumnDefinition Width="60"/><!--col 0-->
-                                                <ColumnDefinition Width="60"/><!--col 1-->
-                                                <ColumnDefinition Width="*"/><!--col 2-->
-                                                <ColumnDefinition Width="60"/><!--col 3-->
+                                                <ColumnDefinition Width="60"/>
+                                                <!--col 0-->
+                                                <ColumnDefinition Width="60"/>
+                                                <!--col 1-->
+                                                <ColumnDefinition Width="*"/>
+                                                <!--col 2-->
+                                                <ColumnDefinition Width="60"/>
+                                                <!--col 3-->
                                             </Grid.ColumnDefinitions>
 
                                             <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" 
@@ -140,7 +145,7 @@
                                             <Label Grid.Row="0" Grid.Column="2" IsVisible="{Binding IsNotNotes}"
                                              x:Name="productLbl" Text="{Binding ProductName}"
                                              FontSize="Medium" FontAttributes="Bold" HorizontalTextAlignment="Start" VerticalTextAlignment="Center" VerticalOptions="Center"/>
-                                            
+
                                             <!--row 1-->
                                             <Label Grid.Row="1" Grid.Column="2" IsVisible="{Binding IsNotNotes}"
                                              x:Name="locationLbl" Text="{Binding LocationName}" TextColor="#9f4576"

+ 24 - 7
prs.mobile/comal.timesheets/StoreRequis/StoreRequiScannerPage.xaml.cs

@@ -110,15 +110,19 @@ namespace comal.timesheets
                 requisition = new Client<Requisition>().Query(
                        new Filter<Requisition>(x => x.ID).IsEqualTo(requisition.ID)
                        ).Rows.FirstOrDefault().ToObject<Requisition>();
-                if (!string.IsNullOrWhiteSpace(requisition.Request))
+
+                string notes = CheckNotes(requisition.Notes);
+
+                if (!string.IsNullOrWhiteSpace(requisition.Request) || !string.IsNullOrWhiteSpace(notes))
                 {
                     StoreRequiItemShell shell1 = new StoreRequiItemShell()
                     {
                         IsNotes = true,
                         IsNotNotes = false,
-                        Summary = requisition.Request,
                         BorderColor = Color.FromHex("#9f4576")
                     };
+                    shell1.Summary = !string.IsNullOrWhiteSpace(requisition.Request) ? "REQUEST: " + requisition.Request + System.Environment.NewLine : "";
+                    shell1.Summary = shell1.Summary + notes;
                     shells.Insert(0, shell1);
                     containsNotes = true;
                 }
@@ -175,6 +179,19 @@ namespace comal.timesheets
             });
         }
 
+        private string CheckNotes(string[] notes)
+        {
+            string combinednotes = "----------" + System.Environment.NewLine + "NOTES: " + System.Environment.NewLine;
+            if (notes.Count() > 0)
+            {
+                foreach (var note in notes)
+                {
+                    combinednotes = combinednotes + note + System.Environment.NewLine;
+                }
+            }
+            return combinednotes;
+        }
+
         void ConfigDisplay()
         {
             loadingLbl.IsVisible = false;
@@ -296,10 +313,10 @@ namespace comal.timesheets
 
                     else if (list.Count > 1)  //more than one stockholding - user choose shelf                    
                         UserSelectFromList(list, product, rawResult, processedResultQtyTuple);
-                    
-                    else if (list.Count == 0)                   
+
+                    else if (list.Count == 0)
                         DisplayAlert("No Holdings Found for Product", "", "OK");
-                    
+
                     loading = false;
                 }
                 catch (Exception e)
@@ -338,14 +355,14 @@ namespace comal.timesheets
             {
                 if (row.Get<StockHolding, double>(x => x.Units) == 0.0)
                     continue;
-                
+
                 list.Add(CreateHoldingShell(row));
             }
             return list;
         }
 
         private CoreTable DoHoldingsQuery(Guid productID)
-        { 
+        {
             return new Client<StockHolding>().Query(
                 new Filter<StockHolding>(x => x.Product.ID).IsEqualTo(productID),
                 new Columns<StockHolding>(