From 613003be0f541f76e9896d47408938721fc93406 Mon Sep 17 00:00:00 2001 From: xxe Date: Tue, 13 Sep 2022 16:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B7=E5=8D=A1=E6=B6=88=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HKCardOUT/Logic/Service/HKCore.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/HKCardOUT/Logic/Service/HKCore.cs b/HKCardOUT/Logic/Service/HKCore.cs index bf05ebd..7765fa9 100644 --- a/HKCardOUT/Logic/Service/HKCore.cs +++ b/HKCardOUT/Logic/Service/HKCore.cs @@ -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() .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; + } } /// /// 获取当天消费前100条展示