Browse Source

手动输入卡号

Lishi
xxe 2 years ago
parent
commit
5740b1473f
3 changed files with 21 additions and 3 deletions
  1. +8
    -0
      HKCardIN/ViewModels/RootViewModel.cs
  2. +12
    -2
      HKCardIN/Views/RootView.xaml
  3. +1
    -1
      HKCardOUT/COM/COMHelper.cs

+ 8
- 0
HKCardIN/ViewModels/RootViewModel.cs View File

@@ -47,6 +47,12 @@ namespace HKCardIN.ViewModels
ShowMoney = data; ShowMoney = data;
} }
} }
string _CardNo;
public string CardNo
{
get => _CardNo;
set => SetAndNotify(ref _CardNo, value);
}
#endregion #endregion


#region 命令 #region 命令
@@ -72,6 +78,8 @@ namespace HKCardIN.ViewModels
} }
public void SaveAction() public void SaveAction()
{ {
var c = CardNo;
var m = ShowMoney;
if (!DataBus.NetWordState) if (!DataBus.NetWordState)
{ {
HandyControl.Controls.Growl.InfoGlobal("系统已离线,请连接网络!!!"); HandyControl.Controls.Growl.InfoGlobal("系统已离线,请连接网络!!!");


+ 12
- 2
HKCardIN/Views/RootView.xaml View File

@@ -11,10 +11,11 @@
x:Name="Root" x:Name="Root"
Title="海科智慧一卡通平台" Title="海科智慧一卡通平台"
Width="800" Width="800"
Height="420"
Height="460"
d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}" d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}"
ResizeMode="CanMinimize"
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d" ResizeMode="CanMinimize">
mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<Style <Style
x:Key="充值" x:Key="充值"
@@ -285,6 +286,15 @@
</TextBox.Text> </TextBox.Text>
</TextBox> </TextBox>
</WrapPanel> </WrapPanel>
<WrapPanel HorizontalAlignment="Center">
<TextBox
Width="330"
Margin="5,0,0,10"
HorizontalAlignment="Left"
hc:InfoElement.Placeholder="手动录入卡号"
Style="{StaticResource TextBoxExtend}"
Text="{Binding CardNo}" />
</WrapPanel>
<hc:Divider <hc:Divider
Content="操作" Content="操作"
FontSize="16" FontSize="16"


+ 1
- 1
HKCardOUT/COM/COMHelper.cs View File

@@ -12,7 +12,7 @@ namespace COM
public void OpenCOM() public void OpenCOM()
{ {
serialPort = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One); serialPort = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
//数据接
//数据接
serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceived); serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceived);
serialPort.ReceivedBytesThreshold = 1; serialPort.ReceivedBytesThreshold = 1;
serialPort.RtsEnable = true; serialPort.RtsEnable = true;


Loading…
Cancel
Save