Browse Source

刷卡消费

Lishi
xxe 2 years ago
parent
commit
613003be0f
1 changed files with 14 additions and 3 deletions
  1. +14
    -3
      HKCardOUT/Logic/Service/HKCore.cs

+ 14
- 3
HKCardOUT/Logic/Service/HKCore.cs View File

@@ -1,10 +1,12 @@
using HandyControl.Controls;
using HKCardOUT.Logic.Model;
using HKControl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XExten.Advance.LinqFramework;

namespace HKCardOUT.Logic.Service
{
@@ -18,6 +20,7 @@ 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;
var Old = DbContext.Context.Queryable<SaleLog>()
.Where(t => t.CardNo == input.CardNo).OrderByDescending(t => t.CreateTime).First();
if (Old != null)
@@ -28,14 +31,22 @@ namespace HKCardOUT.Logic.Service
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;
}
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>
/// 获取当天消费前100条展示


Loading…
Cancel
Save