Ver código fonte

Update Version 7.18b + shipping panel bug fix

Nick-PRSDigital@bitbucket.org 2 anos atrás
pai
commit
9cee90e591

+ 17 - 16
prs.desktop/Panels/Shipments/ShippingPanel.xaml.cs

@@ -8,6 +8,7 @@ using InABox.Clients;
 using InABox.Core;
 using InABox.DynamicGrid;
 using InABox.WPF;
+using MailKit.Net.Imap;
 using Motorola.Snapi;
 using Motorola.Snapi.Constants.Enums;
 using Motorola.Snapi.EventArguments;
@@ -306,10 +307,7 @@ namespace PRSDesktop
                 Shipment = null;
                 Requi = null;
 
-                var row = CheckShipmentLocalCache(code);
-
-                if (row == null)                
-                    row = CheckShipmentOnServer(code);
+                var row = CheckShipment(code);
                 
                 if (row != null)
                 {
@@ -324,6 +322,10 @@ namespace PRSDesktop
                 if (Shipments.SelectedRows.Any())
                 {
                     var item = CheckItem(code);
+
+                    if (item == null)
+                        item = CheckServer(code);
+
                     if (item != null)
                     {
                         var icount = Shipments.SelectedRows.First().Get<Shipment, int>(x => x.ItemCount);
@@ -364,7 +366,9 @@ namespace PRSDesktop
             }
         }
 
-        private CoreRow CheckShipmentLocalCache(string code)
+
+
+        private CoreRow CheckShipment(string code)
         {
             var row = Shipments.MasterData.Rows.FirstOrDefault(r => r.Get<Shipment, string>(c => c.BarCode).Equals(code));
             if (row != null)
@@ -372,25 +376,22 @@ namespace PRSDesktop
             return null;
         }
 
-        private CoreRow? CheckShipmentOnServer(string code)
+        private DeliveryItem CheckItem(string code)
         {
-            var row = new Client<Shipment>().Query(new Filter<Shipment>(x => x.BarCode).IsEqualTo(code))
-                .Rows.FirstOrDefault();
-            if (row != null)
-            {
-                Shipments.AddRow(row);
-                return row;
-            }             
-            return null;
+            var row = ItemCache.Rows.FirstOrDefault(r => String.Equals(r.Get<DeliveryItem, string>(c => c.Barcode),code));
+            return row != null ? row.ToObject<DeliveryItem>() : null;
         }
 
-        private DeliveryItem CheckItem(string code)
+        private DeliveryItem CheckServer(string code)
         {
-            var row = ItemCache.Rows.FirstOrDefault(r => String.Equals(r.Get<DeliveryItem, string>(c => c.Barcode),code));
+            var row = new Client<DeliveryItem>().Query(new Filter<DeliveryItem>(x => x.Barcode).IsEqualTo(code)).Rows.FirstOrDefault();
+            if(row != null)
+                ItemCache.LoadRow(row);
             return row != null ? row.ToObject<DeliveryItem>() : null;
         }
 
 
+
         //private void Timer_Tick(object sender, EventArgs e)
         //{
         //    if (lastselection < DateTime.Now.AddMilliseconds(-500))

+ 1 - 1
prs.desktop/prsdesktop.iss

@@ -5,7 +5,7 @@
 #pragma verboselevel 9
 
 #define MyAppName "PRS Desktop"
-#define MyAppVersion "7.18a"
+#define MyAppVersion "7.18b"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSDesktop.exe"

+ 1 - 1
prs.server/PRSServer.iss

@@ -5,7 +5,7 @@
 #pragma verboselevel 9
 
 #define MyAppName "PRS Server"
-#define MyAppVersion "7.18a"
+#define MyAppVersion "7.18b"
 #define MyAppPublisher "PRS Digital"
 #define MyAppURL "https://www.prs-software.com.au"
 #define MyAppExeName "PRSServer.exe"