|
|
@@ -1,4 +1,5 @@ |
|
|
|
using HandyControl.Controls; |
|
|
|
using HKCardOUT.Helper; |
|
|
|
using HKCardOUT.Logic.Model; |
|
|
|
using HKControl; |
|
|
|
using System; |
|
|
@@ -20,7 +21,8 @@ namespace HKCardOUT.Logic.Service |
|
|
|
public bool DeviceSale(SaleLog input) |
|
|
|
{ |
|
|
|
if (RemoteService.CheckCardStuatas(input.CardNo) != 1) return false; |
|
|
|
if (!Main.GetInstance.GetIsSwipe(input.Location.AsInt())) return false; |
|
|
|
if (!DataBus.IsTest) |
|
|
|
if (!Main.GetInstance.GetIsSwipe(input.Location.AsInt())) return false; |
|
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
|
.Where(t => t.CardNo == input.CardNo).OrderByDescending(t => t.CreateTime).First(); |
|
|
|
if (Old != null) |
|
|
@@ -29,7 +31,8 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (entity.Id != Guid.Empty) |
|
|
|
{ |
|
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Location); |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
if (!DataBus.IsTest) |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
DbContext.Context.Updateable<SaleLog>().SetColumns(t => t.IsSync == true).Where(t => t.Id == entity.Id).ExecuteCommand(); |
|
|
|
return res; |
|
|
|
} |
|
|
@@ -41,7 +44,8 @@ namespace HKCardOUT.Logic.Service |
|
|
|
if (entity.Id != Guid.Empty) |
|
|
|
{ |
|
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Location); |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
if (!DataBus.IsTest) |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
DbContext.Context.Updateable<SaleLog>().SetColumns(t => t.IsSync == true).Where(t => t.Id == entity.Id).ExecuteCommand(); |
|
|
|
return res; |
|
|
|
} |
|
|
|