|
@@ -306,7 +306,11 @@ namespace PRSDesktop
|
|
|
Shipment = null;
|
|
|
Requi = null;
|
|
|
|
|
|
- var row = CheckShipment(code);
|
|
|
+ var row = CheckShipmentLocalCache(code);
|
|
|
+
|
|
|
+ if (row == null)
|
|
|
+ row = CheckShipmentOnServer(code);
|
|
|
+
|
|
|
if (row != null)
|
|
|
{
|
|
|
Shipments.ScrollIntoView(row);
|
|
@@ -360,8 +364,7 @@ namespace PRSDesktop
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private CoreRow CheckShipment(string code)
|
|
|
+ private CoreRow CheckShipmentLocalCache(string code)
|
|
|
{
|
|
|
var row = Shipments.MasterData.Rows.FirstOrDefault(r => r.Get<Shipment, string>(c => c.BarCode).Equals(code));
|
|
|
if (row != null)
|
|
@@ -369,6 +372,18 @@ namespace PRSDesktop
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private CoreRow? CheckShipmentOnServer(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;
|
|
|
+ }
|
|
|
+
|
|
|
private DeliveryItem CheckItem(string code)
|
|
|
{
|
|
|
var row = ItemCache.Rows.FirstOrDefault(r => String.Equals(r.Get<DeliveryItem, string>(c => c.Barcode),code));
|