|
@@ -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))
|