|
|
@@ -28,10 +28,12 @@ namespace HKCardOUT.Logic.Service |
|
|
|
//10秒防止重复刷卡 |
|
|
|
if (Old.CreateTime.Subtract(DateTime.Now).TotalSeconds > 10d) |
|
|
|
{ |
|
|
|
if (DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0) |
|
|
|
var entity = DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteReturnEntity(); |
|
|
|
if (entity.Id!=Guid.Empty) |
|
|
|
{ |
|
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Money); |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
DbContext.Context.Updateable<SaleLog>().SetColumns(t => t.IsSync == true).Where(t => t.Id == entity.Id).ExecuteCommand(); |
|
|
|
return res; |
|
|
|
} |
|
|
|
} |
|
|
@@ -39,10 +41,12 @@ namespace HKCardOUT.Logic.Service |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0) |
|
|
|
var entity = DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteReturnEntity(); |
|
|
|
if (entity.Id!=Guid.Empty) |
|
|
|
{ |
|
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Money); |
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
DbContext.Context.Updateable<SaleLog>().SetColumns(t => t.IsSync == true).Where(t => t.Id == entity.Id).ExecuteCommand(); |
|
|
|
return res; |
|
|
|
} |
|
|
|
return false; |
|
|
|