|
@@ -1,10 +1,12 @@ |
|
|
using HandyControl.Controls; |
|
|
using HandyControl.Controls; |
|
|
using HKCardOUT.Logic.Model; |
|
|
using HKCardOUT.Logic.Model; |
|
|
|
|
|
using HKControl; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
using XExten.Advance.LinqFramework; |
|
|
|
|
|
|
|
|
namespace HKCardOUT.Logic.Service |
|
|
namespace HKCardOUT.Logic.Service |
|
|
{ |
|
|
{ |
|
@@ -18,6 +20,7 @@ namespace HKCardOUT.Logic.Service |
|
|
public bool DeviceSale(SaleLog input) |
|
|
public bool DeviceSale(SaleLog input) |
|
|
{ |
|
|
{ |
|
|
if (RemoteService.CheckCardStuatas(input.CardNo) != 1) return false; |
|
|
if (RemoteService.CheckCardStuatas(input.CardNo) != 1) return false; |
|
|
|
|
|
if (!Main.GetInstance.GetIsSwipe(input.Location.AsInt())) return false; |
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
var Old = DbContext.Context.Queryable<SaleLog>() |
|
|
.Where(t => t.CardNo == input.CardNo).OrderByDescending(t => t.CreateTime).First(); |
|
|
.Where(t => t.CardNo == input.CardNo).OrderByDescending(t => t.CreateTime).First(); |
|
|
if (Old != null) |
|
|
if (Old != null) |
|
@@ -28,14 +31,22 @@ namespace HKCardOUT.Logic.Service |
|
|
if (DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0) |
|
|
if (DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0) |
|
|
{ |
|
|
{ |
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Money); |
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Money); |
|
|
|
|
|
|
|
|
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
|
|
return res; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
return DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
if (DbContext.Context.Insertable(input).CallEntityMethod(t => t.Create()).ExecuteCommand() > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
var res = RemoteService.SyncSaleLog(input.CardNo, input.Money); |
|
|
|
|
|
Main.GetInstance.Start(input.Location.AsInt()); |
|
|
|
|
|
return res; |
|
|
|
|
|
} |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 获取当天消费前100条展示 |
|
|
/// 获取当天消费前100条展示 |
|
|