Explorar el Código

测试OK

Lishi
xxe hace 2 años
padre
commit
e0f7cd2d42
Se han modificado 5 ficheros con 23 adiciones y 6 borrados
  1. +13
    -1
      HKCardIN/ViewModels/RootViewModel.cs
  2. +1
    -1
      HKCardOUT/Helper/HKHelpers.cs
  3. +6
    -2
      HKCardOUT/Logic/Service/HKCore.cs
  4. +2
    -1
      HKCardOUT/ViewModels/RootViewModel.cs
  5. +1
    -1
      HKCardOUT/Views/RootView.xaml

+ 13
- 1
HKCardIN/ViewModels/RootViewModel.cs Ver fichero

@@ -4,6 +4,7 @@ using HKCardIN.Logic.Model;
using Stylet;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;

namespace HKCardIN.ViewModels
@@ -16,7 +17,6 @@ namespace HKCardIN.ViewModels
{
CodeVisible = Visibility.Collapsed;
ContentVisible = Visibility.Visible;
MainThread();
}

#region 属性
@@ -93,13 +93,25 @@ namespace HKCardIN.ViewModels
}

if (BaseLogic.GetInstance().PushMoneyToServer(CardNo, ShowMoney))
{
HandyControl.Controls.Growl.SuccessGlobal($"【{CardNo}】充值成功");
Task.Run(() =>
{
Thread.Sleep(5 * 1000);
Info = null;
});
}
else
HandyControl.Controls.Growl.InfoGlobal($"【{CardNo}】充值失败");
}
#endregion

#region 方法
protected override void OnViewLoaded()
{
MainThread();
//Info = BaseLogic.GetInstance().PullUserAndCardInfo("1569245210230263808");
}
private void MainThread()
{
ThreadManage.GetInstance().StartLong(new Action(() =>


HKCardOUT/Helper/HKHelper.cs → HKCardOUT/Helper/HKHelpers.cs Ver fichero

@@ -8,7 +8,7 @@ using System.Threading.Tasks;

namespace HKCardOUT.Helper
{
public class HKHelper: Singleton<HKHelper>
public class HKHelpers: Singleton<HKHelpers>
{
/// <summary>
/// 判断网络状况的方法,返回值true为连接,false为未连接

+ 6
- 2
HKCardOUT/Logic/Service/HKCore.cs Ver fichero

@@ -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;


+ 2
- 1
HKCardOUT/ViewModels/RootViewModel.cs Ver fichero

@@ -1,5 +1,6 @@
using DTO;
using HKCardOUT.Helper;
using HKCardOUT.Logic;
using HKCardOUT.Logic.Model;
using HKCardOUT.Logic.Service;
using Stylet;
@@ -63,7 +64,7 @@ namespace HKCardOUT.ViewModels
try
{
//1.检测网络上下线
bool network = HKHelper.GetInstance().GetNetworkState();
bool network = HKHelpers.GetInstance().GetNetworkState();
if (network != DataBus.NetWordState)
{
if (network) HandyControl.Controls.Growl.InfoGlobal("网络连接成功");


+ 1
- 1
HKCardOUT/Views/RootView.xaml Ver fichero

@@ -105,7 +105,7 @@
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn
Width="260"
Width="300"
Binding="{Binding CardNo}"
ElementStyle="{StaticResource CenterAlignmentStyle}"
Header="卡号"


Cargando…
Cancelar
Guardar