MTR
rexlin 4 years ago
parent 25f22a0241
commit 2bce29c071
  1. BIN
      DLLSample_HK_MTR.rar
  2. 6
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/App.config
  3. 9
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/App.xaml
  4. 17
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/App.xaml.cs
  5. 132
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/ECR_N5_DLL_TestUI.csproj
  6. 106
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/MainWindow.xaml
  7. 901
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/MainWindow.xaml.cs
  8. 55
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/Properties/AssemblyInfo.cs
  9. 63
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/Properties/Resources.Designer.cs
  10. 117
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/Properties/Resources.resx
  11. 26
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/Properties/Settings.Designer.cs
  12. 7
      DLLSample_HK_MTR/ECR_N5_DLL_TestUI/Properties/Settings.settings
  13. BIN
      DLLSample_HK_MTR/n5coredll.dll
  14. 102
      ECR_N5_DLL_TestUI/MainWindow.xaml
  15. 390
      ECR_N5_DLL_TestUI/MainWindow.xaml.cs
  16. BIN
      n5coredll.dll
  17. 321
      n5coredll/InstllResult.cs
  18. 72
      n5coredll/LogUtil.cs
  19. 1545
      n5coredll/N5Core.cs
  20. 6
      n5coredll/RefundResult.cs
  21. 36
      n5coredll/RequestResult.cs
  22. 8
      n5coredll/RetrievalResult.cs
  23. BIN
      n5coredll/dll/IbmsSerialPort.dll
  24. BIN
      n5coredll/dll/IbmsSerialPort.lib
  25. 5
      n5coredll/n5coredll.csproj

Binary file not shown.

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>

@ -0,0 +1,9 @@
<Application x:Class="ECR_N5_DLL_TestUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ECR_N5_DLL_TestUI"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace ECR_N5_DLL_TestUI
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
}
}

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{DEF387D0-3F98-4720-874D-8A753399B206}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>ECR_N5_DLL_TestUI</RootNamespace>
<AssemblyName>ECR_N5_DLL_TestUI</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\n5coredll\n5coredll.csproj">
<Project>{1f0c1d84-fd97-41f1-bc8b-f2f22c1997a1}</Project>
<Name>n5coredll</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -0,0 +1,106 @@
<Window x:Class="ECR_N5_DLL_TestUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ECR_N5_DLL_TestUI"
mc:Ignorable="d"
Title="ECR N5 DLL TEST" Height="881" Width="810">
<ScrollViewer>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="644*"/>
<RowDefinition Height="68*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="295" Margin="46,495,0,0" VerticalAlignment="Top" Width="702" Grid.RowSpan="2" />
<TextBox x:Name="result1TextBox" HorizontalAlignment="Left" Height="237" Margin="406,520,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330"/>
<Label Content="ECR N5 TEST" HorizontalAlignment="Left" Margin="248,-1,0,0" VerticalAlignment="Top" Width="304" Height="45" FontSize="36"/>
<RadioButton Content="Refund" HorizontalAlignment="Left" Margin="264,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Retrieval" HorizontalAlignment="Left" Margin="409,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Sale" HorizontalAlignment="Left" Margin="26,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Void" HorizontalAlignment="Left" Margin="145,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Please select test function:" HorizontalAlignment="Left" Margin="46,45,0,0" VerticalAlignment="Top" FontSize="16"/>
<Label Content="Please input test data:" HorizontalAlignment="Left" Margin="26,161,0,0" VerticalAlignment="Top" FontSize="16"/>
<Label Content="Payment Application : " HorizontalAlignment="Left" Margin="434,183,0,0" VerticalAlignment="Top"/>
<Label Content="Transaction Amount : " HorizontalAlignment="Left" Margin="61,187,0,0" VerticalAlignment="Top" Width="140"/>
<TextBox x:Name="txnAmtTextBox" HorizontalAlignment="Left" Height="23" Margin="201,187,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="205"/>
<Label Content="QR Code Value : " HorizontalAlignment="Left" Margin="61,213,0,0" VerticalAlignment="Top" Width="114"/>
<TextBox x:Name="qrValueTextBox" HorizontalAlignment="Left" Height="23" Margin="201,213,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<Button x:Name="submit_1_Button" Content="Submit" HorizontalAlignment="Left" Margin="467,472,0,0" VerticalAlignment="Top" Width="69" Click="Submit_1_Button_Click" Height="21"/>
<Label Content="response:" HorizontalAlignment="Left" Margin="408,495,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="paymentAppIdComboBox" SelectedIndex="0" HorizontalAlignment="Left" Margin="578,187,0,0" VerticalAlignment="Top" Width="164" >
<ComboBoxItem Content="CC"/>
<ComboBoxItem Content="QRC"/>
<ComboBoxItem Content="CPN"/>
<ComboBoxItem Content="AE"/>
<ComboBoxItem Content="DC"/>
<ComboBoxItem Content="EPS"/>
<ComboBoxItem Content="OPS"/>
<ComboBoxItem Content="FPS"/>
<ComboBoxItem Content="EPS"/>
<ComboBoxItem Content="NONE"/>
</ComboBox>
<Label Content="Transaction Id : " HorizontalAlignment="Left" Margin="61,240,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="ecrTxnIdTextBox" HorizontalAlignment="Left" Height="23" Margin="201,240,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="Settlement" HorizontalAlignment="Left" Margin="547,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Reprint" HorizontalAlignment="Left" Margin="694,74,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Link Request" HorizontalAlignment="Left" Margin="28,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="portName : " HorizontalAlignment="Left" Margin="59,468,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="portNameComboBox" SelectedIndex="2" HorizontalAlignment="Left" Margin="145,472,0,0" VerticalAlignment="Top" Width="205" SelectionChanged="PortNameComboBox_SelectionChanged">
<ComboBoxItem Content="COM1"/>
<ComboBoxItem Content="COM2"/>
<ComboBoxItem Content="COM3"/>
<ComboBoxItem Content="COM4"/>
<ComboBoxItem Content="COM5"/>
<ComboBoxItem Content="COM6"/>
<ComboBoxItem Content="COM7"/>
<ComboBoxItem Content="COM8"/>
<ComboBoxItem Content="COM9"/>
<ComboBoxItem Content="COM10"/>
<ComboBoxItem Content="COM11"/>
<ComboBoxItem Content="COM12"/>
<ComboBoxItem Content="COM13"/>
<ComboBoxItem Content="COM14"/>
<ComboBoxItem Content="COM15"/>
<ComboBoxItem Content="COM16"/>
<ComboBoxItem Content="COM17"/>
<ComboBoxItem Content="COM18"/>
<ComboBoxItem Content="COM19"/>
<ComboBoxItem Content="COM20"/>
</ComboBox>
<TextBox x:Name="requestTextBox" HorizontalAlignment="Left" Height="239" Margin="58,520,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330"/>
<Label Content="request:" HorizontalAlignment="Left" Margin="59,495,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="logPathTextBox" HorizontalAlignment="Left" Height="23" Margin="48,44,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="680" Grid.Row="1"/>
<Button x:Name="reset_Button" Content="Reset" HorizontalAlignment="Left" Margin="382,472,0,0" VerticalAlignment="Top" Width="69" Click="Reset_Button_Click" Height="21"/>
<RadioButton Content="Terminaion" HorizontalAlignment="Left" Margin="145,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Pan : " HorizontalAlignment="Left" Margin="61,269,0,0" VerticalAlignment="Top" Width="114"/>
<TextBox x:Name="panTextBox" HorizontalAlignment="Left" Height="23" Margin="201,269,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<Label Content="Exp Date : " HorizontalAlignment="Left" Margin="61,296,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="expDateTextBox" HorizontalAlignment="Left" Height="23" Margin="201,296,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="BatchEnquiry" HorizontalAlignment="Left" Margin="264,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="SettleEnquiry" HorizontalAlignment="Left" Margin="409,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Authcode" HorizontalAlignment="Left" Margin="61,380,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="authCodeTextBox" Height="23" Margin="201,380,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="SettleDate" HorizontalAlignment="Left" Margin="489,410,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="settleDateTextBox" Height="23" Margin="578,410,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="BatchId" HorizontalAlignment="Left" Margin="63,410,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="batchIdTextBox" Height="23" Margin="201,410,341,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="HostRefNo" HorizontalAlignment="Left" Margin="489,437,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="hostRefNoTextBox" Height="23" Margin="578,437,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="OriTxnDate" HorizontalAlignment="Left" Margin="63,437,0,0" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="oriTxnDateTextBox" Height="23" Margin="201,437,341,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<RadioButton Content="GetInfo" HorizontalAlignment="Left" Margin="694,110,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Payment Type:" HorizontalAlignment="Left" Margin="61,324,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="paymentTypeTextBox" HorizontalAlignment="Left" Height="23" Margin="201,324,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="CheckUpdate" HorizontalAlignment="Left" Margin="29,139,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="SummaryEnquiry" HorizontalAlignment="Left" Margin="547,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Enquiry Period:" HorizontalAlignment="Left" Margin="61,352,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="periodTextBox" HorizontalAlignment="Left" Height="23" Margin="201,352,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="ExecuteUpdate" HorizontalAlignment="Left" Margin="145,139,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
</Grid>
</ScrollViewer>
</Window>

@ -0,0 +1,901 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Threading;
using System.Security.Cryptography;
using System.Windows.Threading;
using n5coredll;
namespace ECR_N5_DLL_TestUI
{
public partial class MainWindow : Window
{
private string portName = "COM3";
private string baudRate = "9600";
private string dataBits = "8";
private string stopBits = "One";
private string parity = "None";
private string timeOut = "12000";
private string thisEvent;
public bool addLogFlag = true;
public string currEventName = null;
public string jsonResultByThead = null;
public string requestStrByThead = null;
public string showResultStr = null;
public string txnAmtTextBoxValue = null;
public string paymentAppIdComboBoxValue = null;
public string qrValueTextBoxValue = null;
public string ecrTxnIdTextBoxValue = null;
public string panTextBoxValue = null;
public string authCodeTextBoxValue = null;
public string batchIdTextBoxValue = null;
public string settleDateTextBoxValue = null;
public string expDateTextBoxValue = null;
public string oriTxnDateTextBoxValue = null;
public string hostRefNoTextBoxValue = null;
public string paymentTypeTextBoxValue = null;
private n5coredll.N5Core n5Core = null;
private bool n5CoreInitSuccess = false;
private string txnIdForSale = null;
private string txnIdForRefund = null;
private string txnIdForPreAuth = null;
private string txnIdForOffline = null;
private string txnIdForAdjust = null;
private string txnIdForCreateOrder = null;
private string enquiryPeriod = null;
private string saleRequestMsg = null;
private string preAuthRequestMsg = null;
private string offlineRequestMsg = null;
private string adjustRequestMsg = null;
private string createOrderRequestMsg = null;
private string refundRequestMsg = null;
private string retrievalRequestMsg = null;
private string voidRequestMsg = null;
private string settlementRequestMsg = null;
private string getInfoRequestMsg = null;
private string checkUpdateRequestMsg = null;
private string executeUpdateRequestMsg = null;
private string linkTestRequestMsg = null;
private string reprintRequestMsg = null;
private string terminaionRequestMsg = null;
private string scanRequestMsg = null;
private string readCardRequestMsg = null;
private string addPointRequestMsg = null;
private string batchEnquiryRequestMsg = null;
private string settleEnquiryRequestMsg = null;
private string summaryEnquiryRequestMsg = null;
private string checkHealthRequestMsg = null;
private Boolean isRepeatSubmit = false;
private string timeout = "300000";
public MainWindow()
{
InitializeComponent();
}
private void requestSummaryEnquiryThead()
{
jsonResultByThead = n5Core.sendSummaryEnquiryRequest(enquiryPeriod, timeout);
this.requestStrByThead = this.summaryEnquiryRequestMsg;
showResult();
}
private void requestSaleThead()
{
jsonResultByThead = n5Core.requestSale(txnIdForSale, txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue, timeout);
this.requestStrByThead = this.saleRequestMsg;
showResult();
}
private void requestRefundThead()
{
jsonResultByThead = n5Core.requestRefund(txnIdForRefund, txnAmtTextBoxValue, paymentAppIdComboBoxValue, qrValueTextBoxValue, oriTxnDateTextBoxValue, hostRefNoTextBoxValue , timeout);
this.requestStrByThead = this.refundRequestMsg;
showResult();
}
private void requestRetrievalThead()
{
jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, timeout);
this.requestStrByThead = this.retrievalRequestMsg;
showResult();
}
private void requestRepeatRetrievalThead()
{
while (isRepeatSubmit)
{
/*
String result = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 10000);
addRepeatLog("=============================count" + repeatCount + "=============================");
addRepeatLog("ecrTxnId = " + ecrTxnIdTextBoxValue);
RetrievalResult retrievalResult = RetrievalResult.toRetrievalResultFromJsonMsg(result);*/
String result = n5Core.requestSale(getTxnId(), "10", "0", "CC", "", "30000");
addRepeatLog("=============================count" + repeatCount + "=============================");
addRepeatLog("ecrTxnId = " + ecrTxnIdTextBoxValue);
SaleResult saleResult = SaleResult.toSaleResultFromJsonMsg(result);
addRepeatLog("Sale Result:" + saleResult.Status);
}
}
private void requestVoidThead()
{
jsonResultByThead = n5Core.requestVoid(ecrTxnIdTextBoxValue, qrValueTextBoxValue, timeout);
this.requestStrByThead = this.voidRequestMsg;
showResult();
}
private void requestSettlementThead()
{
jsonResultByThead = n5Core.sendSettlementtRequest(timeout);
this.requestStrByThead = this.settlementRequestMsg;
showResult();
}
private void requesGetInfoThead()
{
jsonResultByThead = n5Core.requestGetInfo(timeout);
this.requestStrByThead = this.getInfoRequestMsg;
showResult();
}
private void requesCheckUpdateThead()
{
jsonResultByThead = n5Core.checkUpdate(timeout);
this.requestStrByThead = this.checkUpdateRequestMsg;
showResult();
}
private void requesExecuteUpdateThead()
{
jsonResultByThead = n5Core.executeUpdate(timeout);
this.requestStrByThead = this.executeUpdateRequestMsg;
showResult();
}
private void requestLinkRequestThead()
{
jsonResultByThead = n5Core.sendLinkTestRequest(timeout);
this.requestStrByThead = this.linkTestRequestMsg;
showResult();
}
private void requestReprintThead()
{
jsonResultByThead = n5Core.sendReprintRequest(ecrTxnIdTextBoxValue, timeout);
this.requestStrByThead = this.reprintRequestMsg;
showResult();
}
private void requestTerminaionThead()
{
jsonResultByThead = n5Core.sendAbortRequest();
this.requestStrByThead = this.terminaionRequestMsg;
showResult();
}
private void requestBatchEnquiryThead()
{
jsonResultByThead = n5Core.sendBatchEnquiryRequest(settleDateTextBoxValue, timeout);
this.requestStrByThead = this.batchEnquiryRequestMsg;
showResult();
}
private void requestSettleEnquiryThead()
{
jsonResultByThead = n5Core.sendSettleEnquiryRequest(batchIdTextBoxValue, timeout);
this.requestStrByThead = this.settleEnquiryRequestMsg;
showResult();
}
private int repeatCount = 1;
public void sendRepeatSubmit()
{
if (n5Core == null || !n5CoreInitSuccess)
{
n5Core = n5coredll.N5Core.getInstance();
int initResult = n5Core.initN5Core(portName, baudRate, dataBits, stopBits, parity, timeOut);
if (initResult == 0)
{
n5CoreInitSuccess = true;
}
}
ecrTxnIdTextBoxValue = ecrTxnIdTextBox.Text;
Thread th = new Thread(requestRepeatRetrievalThead);
th.Start();
}
public void stopRepeatSubmit()
{
repeatCount = 1;
}
public void sendSubmit()
{
addLogFlag = true;
addLog("====>> sendSubmit start, thisEvent = " + this.thisEvent);
currEventName = this.thisEvent;
if (currEventName == null || "".Equals(currEventName.Trim())) {
MessageBox.Show("Please select test function.", "Message");
return;
}
portName = this.portNameComboBox.Text;
if (n5Core == null || !n5CoreInitSuccess)
{
n5Core = n5coredll.N5Core.getInstance();
int initResult = n5Core.initN5Core(portName, baudRate, dataBits, stopBits, parity, timeOut);
//if (initResult == 0)
//{
n5CoreInitSuccess = true;
//}
}
if (!n5CoreInitSuccess)
{
this.requestStrByThead = "n5coredll init fail.";
this.jsonResultByThead = string.Empty;
showResult();
return;
}
this.requestStrByThead = string.Empty;
this.jsonResultByThead = string.Empty;
int show = showResult();
if (show != 0)
{
return;
}
if ("Sale".Equals(this.thisEvent))
{
if (this.txnAmtTextBox.Text == null || "".Equals(this.txnAmtTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.txnAmtTextBox.Focus();
return;
}
else if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.paymentAppIdComboBox.Focus();
return;
}
else
{
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
paymentAppIdComboBoxValue = this.paymentAppIdComboBox.Text;
qrValueTextBoxValue = this.qrValueTextBox.Text;
panTextBoxValue = this.panTextBox.Text;
expDateTextBoxValue = this.expDateTextBox.Text;
txnIdForSale = this.getTxnId();
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForSale + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue + "\n qrValue = " + qrValueTextBoxValue;
showResult();
addLog("txnId = " + txnIdForSale + ", txnAmt = " + txnAmtTextBoxValue + ", paymentAppId = " + paymentAppIdComboBoxValue + ",qrValue = " + qrValueTextBoxValue);
this.saleRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestSaleThead);
th.Start();
}
}
else if ("Refund".Equals(this.thisEvent))
{
if (this.txnAmtTextBox.Text == null || "".Equals(this.txnAmtTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.txnAmtTextBox.Focus();
}
else if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.paymentAppIdComboBox.Focus();
return;
}
else
{
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
paymentAppIdComboBoxValue = this.paymentAppIdComboBox.Text;
qrValueTextBoxValue = this.qrValueTextBox.Text;
oriTxnDateTextBoxValue = this.oriTxnDateTextBox.Text;
hostRefNoTextBoxValue = this.hostRefNoTextBox.Text;
txnIdForRefund = this.getTxnId();
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForRefund + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue + "\n qrValue = " + qrValueTextBoxValue;
showResult();
addLog("txnId = " + txnIdForRefund + ", txnAmt = " + txnAmtTextBoxValue + ", paymentAppId = " + paymentAppIdComboBoxValue + ",qrValue = " + qrValueTextBoxValue);
//jsonResultByThead = n5Core.requestRefund(txnId, txnAmtTextBoxValue, paymentAppIdComboBoxValue, qrValueTextBoxValue);
this.refundRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestRefundThead);
th.Start();
}
}
else if ("Retrieval".Equals(this.thisEvent))
{
if (this.ecrTxnIdTextBox.Text == null || "".Equals(this.ecrTxnIdTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.ecrTxnIdTextBox.Focus();
return;
}
else
{
ecrTxnIdTextBoxValue = this.ecrTxnIdTextBox.Text;
this.requestStrByThead = "Test Function : " + currEventName + "\n ecrTxnId = " + ecrTxnIdTextBoxValue;
showResult();
addLog("ecrTxnId = " + ecrTxnIdTextBoxValue);
//jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 180000);
this.retrievalRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestRetrievalThead);
th.Start();
}
}
else if ("SummaryEnquiry".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
enquiryPeriod = periodTextBox.Text;
//jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 180000);
this.summaryEnquiryRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestSummaryEnquiryThead);
th.Start();
}
else if ("Void".Equals(this.thisEvent))
{
if (this.ecrTxnIdTextBox.Text == null || "".Equals(this.ecrTxnIdTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.ecrTxnIdTextBox.Focus();
return;
}
else
{
qrValueTextBoxValue = this.qrValueTextBox.Text;
ecrTxnIdTextBoxValue = this.ecrTxnIdTextBox.Text;
this.requestStrByThead = "Test Function : " + currEventName + "\n ecrTxnId = " + ecrTxnIdTextBoxValue + "\n qrValue = " + qrValueTextBoxValue;
showResult();
addLog("ecrTxnId = " + ecrTxnIdTextBoxValue + ", qrValue = " + qrValueTextBoxValue);
// jsonResultByThead = n5Core.requestVoid(ecrTxnIdTextBoxValue, qrValueTextBoxValue);
this.voidRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestVoidThead);
th.Start();
}
}
else if ("Settlement".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.settlementRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestSettlementThead);
th.Start();
}
else if ("GetInfo".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.getInfoRequestMsg = this.requestStrByThead;
Thread th = new Thread(requesGetInfoThead);
th.Start();
}
else if ("CheckUpdate".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.checkUpdateRequestMsg = this.requestStrByThead;
Thread th = new Thread(requesCheckUpdateThead);
th.Start();
}
else if ("ExecuteUpdate".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.executeUpdateRequestMsg = this.requestStrByThead;
Thread th = new Thread(requesExecuteUpdateThead);
th.Start();
}
else if ("Link Request".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendLinkTestRequest();
this.linkTestRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestLinkRequestThead);
th.Start();
}
else if ("Reprint".Equals(this.thisEvent))
{
ecrTxnIdTextBoxValue = this.ecrTxnIdTextBox.Text;
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendReprintRequest();
this.reprintRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestReprintThead);
th.Start();
}
else if ("Terminaion".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendAbortRequest();
this.terminaionRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestTerminaionThead);
th.Start();
}
else if ("BatchEnquiry".Equals(this.thisEvent))
{
if (this.settleDateTextBox.Text == null || "".Equals(this.settleDateTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.settleDateTextBox.Focus();
return;
}
else
{
this.settleDateTextBoxValue = this.settleDateTextBox.Text;
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
this.batchEnquiryRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestBatchEnquiryThead);
th.Start();
}
}
else if ("SettleEnquiry".Equals(this.thisEvent))
{
if (this.batchIdTextBox.Text == null || "".Equals(this.batchIdTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.batchIdTextBox.Focus();
return;
}
else
{
this.batchIdTextBoxValue = this.batchIdTextBox.Text;
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
this.settleEnquiryRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestSettleEnquiryThead);
th.Start();
}
}
else
{
addLog("thisEvent is error");
MessageBox.Show("Please select test function.", "Message");
return;
}
addLog("jsonResultByThead = " + jsonResultByThead);
showResult();
return;
}
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
RadioButton thisButton = (RadioButton)sender;
this.thisEvent = thisButton.Content.ToString();
this.requestTextBox.Text = string.Empty;
this.result1TextBox.Text = string.Empty;
if (this.logPathTextBox.Text == null || "".Equals(this.logPathTextBox.Text.Trim()))
{
this.logPathTextBox.Text = "Log Path : " + System.IO.Path.GetTempPath() + "\\myN5TestWin.log";
}
if ("Sale".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.qrValueTextBox.IsEnabled = true;
this.panTextBox.IsEnabled = true;
this.expDateTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("CreateOrder".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
this.paymentTypeTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.qrValueTextBox.IsEnabled = true;
this.panTextBox.IsEnabled = true;
this.expDateTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if("PreAuth".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.panTextBox.IsEnabled = true;
this.expDateTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Offline".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.panTextBox.IsEnabled = true;
this.authCodeTextBox.IsEnabled = true;
this.expDateTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Adjust".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Refund".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.qrValueTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Retrieval".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = true;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Void".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = true;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Settlement".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Link Request".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Terminaion".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("Scan".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("ReadCard".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("AddPoint".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = true;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("BatchEnquiry".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.panTextBox.Text = "";
this.authCodeTextBox.Text = "";
this.expDateTextBox.Text = "";
this.batchIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.panTextBox.IsEnabled = false;
this.authCodeTextBox.IsEnabled = false;
this.expDateTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = true;
}
else if ("SettleEnquiry".Equals(this.thisEvent))
{
this.txnAmtTextBox.Text = "";
this.paymentAppIdComboBox.Text = "";
this.qrValueTextBox.Text = "";
this.ecrTxnIdTextBox.Text = "";
this.panTextBox.Text = "";
this.authCodeTextBox.Text = "";
this.expDateTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = false;
this.paymentAppIdComboBox.IsEnabled = false;
this.qrValueTextBox.IsEnabled = false;
this.ecrTxnIdTextBox.IsEnabled = false;
this.panTextBox.IsEnabled = false;
this.authCodeTextBox.IsEnabled = false;
this.expDateTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = true;
this.settleDateTextBox.IsEnabled = false;
}
}
private void Submit_1_Button_Click(object sender, RoutedEventArgs e)
{
this.requestTextBox.Text = string.Empty;
this.result1TextBox.Text = string.Empty;
this.submit_1_Button.IsEnabled = false;
addLog("==========Submit start========== ");
this.sendSubmit();
addLog("==========Submit end========== ");
this.submit_1_Button.IsEnabled = true;
}
private void Reset_Button_Click(object sender, RoutedEventArgs e)
{
this.requestTextBox.Text = string.Empty;
this.result1TextBox.Text = string.Empty;
}
public void addLog(string logInfo)
{
try
{
if (addLogFlag)
{
StreamWriter sw = File.AppendText(System.IO.Path.GetTempPath() + "\\myN5TestWin.log");
sw.WriteLine(DateTime.Now.ToString() + " [LOGGER] " + logInfo + Environment.NewLine);
sw.Flush();
sw.Close();
// Console.WriteLine(logInfo);
}
}
catch (Exception err)
{
Console.WriteLine("Exception = " + err);
addLogFlag = false;
}
}
public void addRepeatLog(string logInfo)
{
try
{
StreamWriter sw = File.AppendText(System.IO.Path.GetTempPath() + "\\myN5TestWin_repeat.log");
sw.WriteLine(DateTime.Now.ToString() + " [LOGGER] " + logInfo + Environment.NewLine);
sw.Flush();
sw.Close();
// Console.WriteLine(logInfo);
}
catch (Exception err)
{
Console.WriteLine("Exception = " + err);
}
}
private string getTxnId()
{
StringBuilder txnIdSb = new StringBuilder();
DateTime dt = DateTime.Now;
txnIdSb.Append(dt.ToString("yyyyMMddHHmmssfff"));
byte[] randomBytes = new byte[15];
RNGCryptoServiceProvider rngServiceProvider = new RNGCryptoServiceProvider();
rngServiceProvider.GetBytes(randomBytes);
Int32 resultInt32 = BitConverter.ToInt32(randomBytes, 0);
for (int i = 0; i < 15; i++)
{
txnIdSb.Append(randomBytes[i].ToString());
}
string txnIdResult = null;
if (txnIdSb.ToString().Length > 32)
{
txnIdResult = txnIdSb.ToString().Substring(0, 32);
}
else
{
txnIdResult = txnIdSb.ToString();
}
addLog("txnIdResult = " + txnIdResult);
return txnIdResult;
}
private int showResult()
{
//this.requestTextBox.Text = this.requestStrByThead;
requestTextBox.Dispatcher.Invoke(
DispatcherPriority.Normal, TimeSpan.FromSeconds(1), new Action(showRequestTxtBox));
showResultStr = this.jsonResultByThead.Replace("{", "").Replace("}", "").Replace(",", "\n");
//this.result1TextBox.Text = showResultStr;
result1TextBox.Dispatcher.Invoke(
DispatcherPriority.Normal, TimeSpan.FromSeconds(1), new Action(showResultTxtBox));
return 0;
}
private void showRequestTxtBox()
{
this.requestTextBox.Text = requestStrByThead;
}
private void showResultTxtBox()
{
this.result1TextBox.Text = showResultStr;
}
private void PortNameComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.n5CoreInitSuccess = false;
}
}
}

@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("ECR_N5_DLL_TestUI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ECR_N5_DLL_TestUI")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请设置
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
//例如,如果您在源文件中使用的是美国英语,
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(未在页面中找到资源时使用,
//或应用程序资源字典中找到时使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(未在页面中找到资源时使用,
//、应用程序或任何主题专用资源字典中找到时使用)
)]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ECR_N5_DLL_TestUI.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ECR_N5_DLL_TestUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性
/// 重写当前线程的 CurrentUICulture 属性。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ECR_N5_DLL_TestUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

Binary file not shown.

@ -14,24 +14,24 @@
<RowDefinition Height="2*"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="331" Margin="46,445,0,0" VerticalAlignment="Top" Width="702" Grid.RowSpan="2" />
<TextBox x:Name="result1TextBox" HorizontalAlignment="Left" Height="258" Margin="406,485,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330"/>
<Label Content="ECR N5 TEST" HorizontalAlignment="Left" Margin="248,-1,0,0" VerticalAlignment="Top" Width="304" Height="75" FontSize="48"/>
<RadioButton Content="Refund" HorizontalAlignment="Left" Margin="264,77,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Retrieval" HorizontalAlignment="Left" Margin="409,77,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Sale" HorizontalAlignment="Left" Margin="26,77,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Void" HorizontalAlignment="Left" Margin="145,77,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Please select test function:" HorizontalAlignment="Left" Margin="46,49,0,0" VerticalAlignment="Top" FontSize="16"/>
<Label Content="Please input test data:" HorizontalAlignment="Left" Margin="46,174,0,0" VerticalAlignment="Top" FontSize="16"/>
<Label Content="Payment Application : " HorizontalAlignment="Left" Margin="434,204,0,0" VerticalAlignment="Top"/>
<Label Content="Transaction Amount : " HorizontalAlignment="Left" Margin="61,208,0,0" VerticalAlignment="Top" Width="140"/>
<TextBox x:Name="txnAmtTextBox" HorizontalAlignment="Left" Height="23" Margin="201,208,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="205"/>
<Label Content="QR Code Value : " HorizontalAlignment="Left" Margin="61,234,0,0" VerticalAlignment="Top" Width="114"/>
<TextBox x:Name="qrValueTextBox" HorizontalAlignment="Left" Height="23" Margin="201,234,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<Button x:Name="submit_1_Button" Content="Submit" HorizontalAlignment="Left" Margin="494,405,0,0" VerticalAlignment="Top" Width="104" Click="Submit_1_Button_Click" Height="27"/>
<Label Content="response:" HorizontalAlignment="Left" Margin="402,455,0,0" VerticalAlignment="Top"/>
<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Left" Height="295" Margin="46,495,0,0" VerticalAlignment="Top" Width="702" Grid.RowSpan="2" />
<TextBox x:Name="result1TextBox" HorizontalAlignment="Left" Height="237" Margin="406,520,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330"/>
<Label Content="ECR N5 TEST" HorizontalAlignment="Left" Margin="248,-1,0,0" VerticalAlignment="Top" Width="304" Height="45" FontSize="36"/>
<RadioButton Content="Refund" HorizontalAlignment="Left" Margin="264,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Retrieval" HorizontalAlignment="Left" Margin="409,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Sale" HorizontalAlignment="Left" Margin="26,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Void" HorizontalAlignment="Left" Margin="145,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Please select test function:" HorizontalAlignment="Left" Margin="46,45,0,0" VerticalAlignment="Top" FontSize="16"/>
<Label Content="Please input test data:" HorizontalAlignment="Left" Margin="26,161,0,0" VerticalAlignment="Top" FontSize="16"/>
<Label Content="Payment Application : " HorizontalAlignment="Left" Margin="434,183,0,0" VerticalAlignment="Top"/>
<Label Content="Transaction Amount : " HorizontalAlignment="Left" Margin="61,187,0,0" VerticalAlignment="Top" Width="140"/>
<TextBox x:Name="txnAmtTextBox" HorizontalAlignment="Left" Height="23" Margin="201,187,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="205"/>
<Label Content="QR Code Value : " HorizontalAlignment="Left" Margin="61,213,0,0" VerticalAlignment="Top" Width="114"/>
<TextBox x:Name="qrValueTextBox" HorizontalAlignment="Left" Height="23" Margin="201,213,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<Button x:Name="submit_1_Button" Content="Submit" HorizontalAlignment="Left" Margin="467,472,0,0" VerticalAlignment="Top" Width="69" Click="Submit_1_Button_Click" Height="21"/>
<Label Content="response:" HorizontalAlignment="Left" Margin="408,495,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="paymentAppIdComboBox" SelectedIndex="0" HorizontalAlignment="Left" Margin="578,208,0,0" VerticalAlignment="Top" Width="164" >
<ComboBox x:Name="paymentAppIdComboBox" SelectedIndex="0" HorizontalAlignment="Left" Margin="578,187,0,0" VerticalAlignment="Top" Width="164" >
<ComboBoxItem Content="CC"/>
<ComboBoxItem Content="QRC"/>
<ComboBoxItem Content="CPN"/>
@ -43,13 +43,13 @@
<ComboBoxItem Content="EPS"/>
<ComboBoxItem Content="NONE"/>
</ComboBox>
<Label Content="Transaction Id : " HorizontalAlignment="Left" Margin="61,261,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="ecrTxnIdTextBox" HorizontalAlignment="Left" Height="23" Margin="201,261,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="Settlement" HorizontalAlignment="Left" Margin="26,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Reprint" HorizontalAlignment="Left" Margin="145,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Link Request" HorizontalAlignment="Left" Margin="264,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="portName : " HorizontalAlignment="Left" Margin="59,405,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="portNameComboBox" SelectedIndex="2" HorizontalAlignment="Left" Margin="145,409,0,0" VerticalAlignment="Top" Width="205" SelectionChanged="PortNameComboBox_SelectionChanged">
<Label Content="Transaction Id : " HorizontalAlignment="Left" Margin="61,240,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="ecrTxnIdTextBox" HorizontalAlignment="Left" Height="23" Margin="201,240,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="Settlement" HorizontalAlignment="Left" Margin="547,73,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Reprint" HorizontalAlignment="Left" Margin="694,74,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Link Request" HorizontalAlignment="Left" Margin="28,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="portName : " HorizontalAlignment="Left" Margin="59,468,0,0" VerticalAlignment="Top"/>
<ComboBox x:Name="portNameComboBox" SelectedIndex="2" HorizontalAlignment="Left" Margin="145,472,0,0" VerticalAlignment="Top" Width="205" SelectionChanged="PortNameComboBox_SelectionChanged">
<ComboBoxItem Content="COM1"/>
<ComboBoxItem Content="COM2"/>
<ComboBoxItem Content="COM3"/>
@ -71,30 +71,36 @@
<ComboBoxItem Content="COM19"/>
<ComboBoxItem Content="COM20"/>
</ComboBox>
<TextBox x:Name="requestTextBox" HorizontalAlignment="Left" Height="258" Margin="58,487,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330"/>
<Label Content="request:" HorizontalAlignment="Left" Margin="48,455,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="logPathTextBox" HorizontalAlignment="Left" Height="23" Margin="48,29.667,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="680" Grid.Row="1"/>
<Button x:Name="reset_Button" Content="Reset" HorizontalAlignment="Left" Margin="375,405,0,0" VerticalAlignment="Top" Width="101" Click="Reset_Button_Click" Height="27"/>
<RadioButton Content="Terminaion" HorizontalAlignment="Left" Margin="409,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Scan" HorizontalAlignment="Left" Margin="528,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="ReadCard" HorizontalAlignment="Left" Margin="528,77,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="AddPoint" HorizontalAlignment="Left" Margin="647,77,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Pan : " HorizontalAlignment="Left" Margin="61,290,0,0" VerticalAlignment="Top" Width="114"/>
<TextBox x:Name="panTextBox" HorizontalAlignment="Left" Height="23" Margin="201,290,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<Label Content="Exp Date : " HorizontalAlignment="Left" Margin="61,317,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="expDateTextBox" HorizontalAlignment="Left" Height="23" Margin="201,317,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="PreAuth" HorizontalAlignment="Left" Margin="647,105,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Offline" HorizontalAlignment="Left" Margin="26,137,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="Adjust" HorizontalAlignment="Left" Margin="145,137,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="BatchEnquiry" HorizontalAlignment="Left" Margin="264,137,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="SettleEnquiry" HorizontalAlignment="Left" Margin="408,137,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Authcode" HorizontalAlignment="Left" Margin="61,345,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="authCodeTextBox" Height="23" Margin="201,345,40.667,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="SettleDate" HorizontalAlignment="Left" Margin="489,375,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="settleDateTextBox" Height="23" Margin="578,375,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="BatchId" HorizontalAlignment="Left" Margin="63,375,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="batchIdTextBox" Height="23" Margin="201,375,341,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Button x:Name="submit_repeat_Button" Content="Start Repeat" Margin="616,405,65,0" VerticalAlignment="Top" Click="Submit_Repeat_Button_Click" Height="27"/>
<TextBox x:Name="requestTextBox" HorizontalAlignment="Left" Height="239" Margin="58,520,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="330"/>
<Label Content="request:" HorizontalAlignment="Left" Margin="59,495,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="logPathTextBox" HorizontalAlignment="Left" Height="23" Margin="48,44,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="680" Grid.Row="1"/>
<Button x:Name="reset_Button" Content="Reset" HorizontalAlignment="Left" Margin="382,472,0,0" VerticalAlignment="Top" Width="69" Click="Reset_Button_Click" Height="21"/>
<RadioButton Content="Terminaion" HorizontalAlignment="Left" Margin="145,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Pan : " HorizontalAlignment="Left" Margin="61,269,0,0" VerticalAlignment="Top" Width="114"/>
<TextBox x:Name="panTextBox" HorizontalAlignment="Left" Height="23" Margin="201,269,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<Label Content="Exp Date : " HorizontalAlignment="Left" Margin="61,296,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="expDateTextBox" HorizontalAlignment="Left" Height="23" Margin="201,296,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="BatchEnquiry" HorizontalAlignment="Left" Margin="264,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="SettleEnquiry" HorizontalAlignment="Left" Margin="409,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Authcode" HorizontalAlignment="Left" Margin="61,380,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="authCodeTextBox" Height="23" Margin="201,380,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="SettleDate" HorizontalAlignment="Left" Margin="489,410,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="settleDateTextBox" Height="23" Margin="578,410,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="BatchId" HorizontalAlignment="Left" Margin="63,410,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="batchIdTextBox" Height="23" Margin="201,410,341,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="HostRefNo" HorizontalAlignment="Left" Margin="489,437,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="hostRefNoTextBox" Height="23" Margin="578,437,41,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<Label Content="OriTxnDate" HorizontalAlignment="Left" Margin="63,437,0,0" VerticalAlignment="Top" Width="75"/>
<TextBox x:Name="oriTxnDateTextBox" Height="23" Margin="201,437,341,0" TextWrapping="Wrap" VerticalAlignment="Top"/>
<RadioButton Content="GetInfo" HorizontalAlignment="Left" Margin="694,110,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Payment Type:" HorizontalAlignment="Left" Margin="61,324,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="paymentTypeTextBox" HorizontalAlignment="Left" Height="23" Margin="201,324,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="CheckUpdate" HorizontalAlignment="Left" Margin="29,139,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<RadioButton Content="SummaryEnquiry" HorizontalAlignment="Left" Margin="547,106,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Label Content="Enquiry Period:" HorizontalAlignment="Left" Margin="61,352,0,0" VerticalAlignment="Top"/>
<TextBox x:Name="periodTextBox" HorizontalAlignment="Left" Height="23" Margin="201,352,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="543"/>
<RadioButton Content="ExecuteUpdate" HorizontalAlignment="Left" Margin="145,139,0,0" VerticalAlignment="Top" FontSize="14" Checked="RadioButton_Checked"/>
<Button x:Name="abort_Button" Content="Abort" HorizontalAlignment="Left" Margin="561,472,0,0" VerticalAlignment="Top" Width="69" Click="Abort_Button_Click" Height="21"/>
</Grid>
</ScrollViewer>

@ -27,7 +27,7 @@ namespace ECR_N5_DLL_TestUI
private string dataBits = "8";
private string stopBits = "One";
private string parity = "None";
private string timeOut = "180000";
private string timeOut = "12000";
private string thisEvent;
@ -46,6 +46,9 @@ namespace ECR_N5_DLL_TestUI
public string batchIdTextBoxValue = null;
public string settleDateTextBoxValue = null;
public string expDateTextBoxValue = null;
public string oriTxnDateTextBoxValue = null;
public string hostRefNoTextBoxValue = null;
public string paymentTypeTextBoxValue = null;
private n5coredll.N5Core n5Core = null;
private bool n5CoreInitSuccess = false;
@ -54,16 +57,21 @@ namespace ECR_N5_DLL_TestUI
private string txnIdForPreAuth = null;
private string txnIdForOffline = null;
private string txnIdForAdjust = null;
private string txnIdForCreateOrder = null;
private string enquiryPeriod = null;
private string saleRequestMsg = null;
private string preAuthRequestMsg = null;
private string offlineRequestMsg = null;
private string adjustRequestMsg = null;
private string createOrderRequestMsg = null;
private string refundRequestMsg = null;
private string retrievalRequestMsg = null;
private string voidRequestMsg = null;
private string settlementRequestMsg = null;
private string getInfoRequestMsg = null;
private string checkUpdateRequestMsg = null;
private string executeUpdateRequestMsg = null;
private string linkTestRequestMsg = null;
private string reprintRequestMsg = null;
private string terminaionRequestMsg = null;
@ -72,50 +80,43 @@ namespace ECR_N5_DLL_TestUI
private string addPointRequestMsg = null;
private string batchEnquiryRequestMsg = null;
private string settleEnquiryRequestMsg = null;
private string summaryEnquiryRequestMsg = null;
private string checkHealthRequestMsg = null;
private Boolean isRepeatSubmit = false;
private string timeout = "300000";
public MainWindow()
{
InitializeComponent();
}
private void requestSaleThead()
protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
{
if (panTextBoxValue!=null && panTextBoxValue!= "" && expDateTextBoxValue!=null && expDateTextBoxValue!="")
jsonResultByThead = n5Core.requestSale(txnIdForSale, txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue);
else
jsonResultByThead = n5Core.requestSale(txnIdForSale, txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue);
this.requestStrByThead = this.saleRequestMsg;
showResult();
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
private void requestPreauthThead()
private void requestSummaryEnquiryThead()
{
jsonResultByThead = n5Core.processPreauth(txnIdForPreAuth, txnAmtTextBoxValue, paymentAppIdComboBoxValue, panTextBoxValue, expDateTextBoxValue);
this.requestStrByThead = this.preAuthRequestMsg;
jsonResultByThead = n5Core.sendSummaryEnquiryRequest(enquiryPeriod, timeout);
this.requestStrByThead = this.summaryEnquiryRequestMsg;
showResult();
}
private void requestOfflineThead()
private void requestSaleThead()
{
jsonResultByThead = n5Core.processOffline(txnIdForOffline, txnAmtTextBoxValue, paymentAppIdComboBoxValue, authCodeTextBoxValue, panTextBoxValue, expDateTextBoxValue);
this.requestStrByThead = this.offlineRequestMsg;
jsonResultByThead = n5Core.requestSale(txnIdForSale, txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue, timeout);
this.requestStrByThead = this.saleRequestMsg;
showResult();
}
private void requestAdjustThead()
{
//jsonResultByThead = n5Core.processOffline(txnIdForOffline, txnAmtTextBoxValue, paymentAppIdComboBoxValue, "123456", panTextBoxValue, expDateTextBoxValue);
// this.requestStrByThead = this.offlineRequestMsg;
// showResult();
}
private void requestRefundThead()
{
jsonResultByThead = n5Core.requestRefund(txnIdForRefund, txnAmtTextBoxValue, paymentAppIdComboBoxValue, qrValueTextBoxValue);
jsonResultByThead = n5Core.requestRefund(txnIdForRefund, txnAmtTextBoxValue, paymentAppIdComboBoxValue, qrValueTextBoxValue, oriTxnDateTextBoxValue, hostRefNoTextBoxValue , timeout);
this.requestStrByThead = this.refundRequestMsg;
showResult();
}
private void requestRetrievalThead()
{
jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 180000);
jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, timeout);
this.requestStrByThead = this.retrievalRequestMsg;
showResult();
}
@ -123,17 +124,18 @@ namespace ECR_N5_DLL_TestUI
{
while (isRepeatSubmit)
{
/*
String result = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 10000);
addRepeatLog("=============================count" + repeatCount + "=============================");
addRepeatLog("ecrTxnId = " + ecrTxnIdTextBoxValue);
RetrievalResult retrievalResult = RetrievalResult.toRetrievalResultFromJsonMsg(result);
if (retrievalResult != null && retrievalResult.Status.Equals("00"))
{
addRepeatLog("Retrieval Success!");
}
else
addRepeatLog("Retrieval Failed!");
RetrievalResult retrievalResult = RetrievalResult.toRetrievalResultFromJsonMsg(result);*/
String result = n5Core.requestSale(getTxnId(), "10", "0", "CC", "", "30000");
addRepeatLog("=============================count" + repeatCount + "=============================");
addRepeatLog("ecrTxnId = " + ecrTxnIdTextBoxValue);
SaleResult saleResult = SaleResult.toSaleResultFromJsonMsg(result);
addRepeatLog("Sale Result:" + saleResult.Status);
}
@ -141,69 +143,70 @@ namespace ECR_N5_DLL_TestUI
}
private void requestVoidThead()
{
jsonResultByThead = n5Core.requestVoid(ecrTxnIdTextBoxValue, qrValueTextBoxValue);
jsonResultByThead = n5Core.requestVoid(ecrTxnIdTextBoxValue, qrValueTextBoxValue, timeout);
this.requestStrByThead = this.voidRequestMsg;
showResult();
}
private void requestSettlementThead()
{
jsonResultByThead = n5Core.sendSettlementtRequest();
jsonResultByThead = n5Core.sendSettlementtRequest(timeout);
this.requestStrByThead = this.settlementRequestMsg;
showResult();
}
private void requestLinkRequestThead()
private void requesGetInfoThead()
{
jsonResultByThead = n5Core.sendLinkTestRequest();
this.requestStrByThead = this.linkTestRequestMsg;
jsonResultByThead = n5Core.requestGetInfo(timeout);
this.requestStrByThead = this.getInfoRequestMsg;
showResult();
}
private void requestReprintThead()
private void requesCheckUpdateThead()
{
jsonResultByThead = n5Core.sendReprintRequest();
this.requestStrByThead = this.reprintRequestMsg;
jsonResultByThead = n5Core.checkUpdate(timeout);
this.requestStrByThead = this.checkUpdateRequestMsg;
showResult();
}
private void requestTerminaionThead()
private void requesExecuteUpdateThead()
{
jsonResultByThead = n5Core.sendAbortRequest();
this.requestStrByThead = this.terminaionRequestMsg;
jsonResultByThead = n5Core.executeUpdate(timeout);
this.requestStrByThead = this.executeUpdateRequestMsg;
showResult();
}
private void requestScanThread()
private void requestLinkRequestThead()
{
jsonResultByThead = n5Core.sendScanRequest();
this.requestStrByThead = this.scanRequestMsg;
jsonResultByThead = n5Core.sendLinkTestRequest(timeout);
this.requestStrByThead = this.linkTestRequestMsg;
showResult();
}
private void requestReadCardNFCThead()
private void requestReprintThead()
{
jsonResultByThead = n5Core.sendReadCardNFCRequest();
this.requestStrByThead = this.readCardRequestMsg;
jsonResultByThead = n5Core.sendReprintRequest(ecrTxnIdTextBoxValue, timeout);
this.requestStrByThead = this.reprintRequestMsg;
showResult();
}
private void requestAddPointThead()
private void requestTerminaionThead()
{
jsonResultByThead = n5Core.sendAddPointRequest(ecrTxnIdTextBoxValue, txnAmtTextBoxValue);
this.requestStrByThead = this.addPointRequestMsg;
jsonResultByThead = n5Core.sendAbortRequest();
this.requestStrByThead = this.terminaionRequestMsg;
showResult();
}
private void requestBatchEnquiryThead()
{
jsonResultByThead = n5Core.sendBatchEnquiryRequest(settleDateTextBoxValue);
jsonResultByThead = n5Core.sendBatchEnquiryRequest(settleDateTextBoxValue, timeout);
this.requestStrByThead = this.batchEnquiryRequestMsg;
showResult();
}
private void requestSettleEnquiryThead()
{
jsonResultByThead = n5Core.sendSettleEnquiryRequest(batchIdTextBoxValue);
jsonResultByThead = n5Core.sendSettleEnquiryRequest(batchIdTextBoxValue, timeout);
this.requestStrByThead = this.settleEnquiryRequestMsg;
showResult();
}
@ -220,28 +223,9 @@ namespace ECR_N5_DLL_TestUI
n5CoreInitSuccess = true;
}
}
/*
if (!n5CoreInitSuccess)
{
this.requestStrByThead = "n5coredll init fail.";
this.jsonResultByThead = string.Empty;
showResult();
return;
}*/
if (this.ecrTxnIdTextBox.Text == null || "".Equals(this.ecrTxnIdTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.ecrTxnIdTextBox.Focus();
return;
}
else
{
ecrTxnIdTextBoxValue = ecrTxnIdTextBox.Text;
Thread th = new Thread(requestRepeatRetrievalThead);
th.Start();
}
}
@ -264,10 +248,10 @@ namespace ECR_N5_DLL_TestUI
{
n5Core = n5coredll.N5Core.getInstance();
int initResult = n5Core.initN5Core(portName, baudRate, dataBits, stopBits, parity, timeOut);
if (initResult == 0)
{
//if (initResult == 0)
//{
n5CoreInitSuccess = true;
}
//}
}
if (!n5CoreInitSuccess)
{
@ -314,127 +298,11 @@ namespace ECR_N5_DLL_TestUI
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForSale + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue + "\n qrValue = " + qrValueTextBoxValue;
showResult();
addLog("txnId = " + txnIdForSale + ", txnAmt = " + txnAmtTextBoxValue + ", paymentAppId = " + paymentAppIdComboBoxValue + ",qrValue = " + qrValueTextBoxValue);
//jsonResultByThead = n5Core.requestSale(this.getTxnId(), txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue);
this.saleRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestSaleThead);
th.Start();
}
}
else if("Adjust".Equals(this.thisEvent))
{
if (this.txnAmtTextBox.Text == null || "".Equals(this.txnAmtTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.txnAmtTextBox.Focus();
return;
}
else if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.paymentAppIdComboBox.Focus();
return;
}
else
{
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
paymentAppIdComboBoxValue = this.paymentAppIdComboBox.Text;
qrValueTextBoxValue = this.qrValueTextBox.Text;
panTextBoxValue = this.panTextBox.Text;
expDateTextBoxValue = this.expDateTextBox.Text;
txnIdForSale = this.getTxnId();
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForPreAuth + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue + "\n qrValue = " + qrValueTextBoxValue;
showResult();
addLog("txnId = " + txnIdForPreAuth + ", txnAmt = " + txnAmtTextBoxValue + ", paymentAppId = " + paymentAppIdComboBoxValue + ",qrValue = " + qrValueTextBoxValue);
//jsonResultByThead = n5Core.requestSale(this.getTxnId(), txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue);
this.preAuthRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestPreauthThead);
th.Start();
}
}
else if ("PreAuth".Equals(this.thisEvent))
{
if (this.txnAmtTextBox.Text == null || "".Equals(this.txnAmtTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.txnAmtTextBox.Focus();
return;
}
else if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.paymentAppIdComboBox.Focus();
return;
}
else
{
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
paymentAppIdComboBoxValue = this.paymentAppIdComboBox.Text;
panTextBoxValue = this.panTextBox.Text;
expDateTextBoxValue = this.expDateTextBox.Text;
txnIdForPreAuth = this.getTxnId();
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForPreAuth + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue;
showResult();
addLog("txnId = " + txnIdForPreAuth + ", txnAmt = " + txnAmtTextBoxValue + ", paymentAppId = " + paymentAppIdComboBoxValue);
//jsonResultByThead = n5Core.requestSale(this.getTxnId(), txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue);
this.preAuthRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestPreauthThead);
th.Start();
}
}
else if ("Offline".Equals(this.thisEvent))
{
if (this.txnAmtTextBox.Text == null || "".Equals(this.txnAmtTextBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.txnAmtTextBox.Focus();
return;
}
else if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text.Trim()))
{
this.requestStrByThead = "Please input parameter.";
this.jsonResultByThead = "Please input parameter.";
showResult();
this.paymentAppIdComboBox.Focus();
return;
}
else
{
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
paymentAppIdComboBoxValue = this.paymentAppIdComboBox.Text;
qrValueTextBoxValue = this.qrValueTextBox.Text;
panTextBoxValue = this.panTextBox.Text;
authCodeTextBoxValue = this.authCodeTextBox.Text;
expDateTextBoxValue = this.expDateTextBox.Text;
txnIdForOffline = this.getTxnId();
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForOffline + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue;
showResult();
addLog("txnId = " + txnIdForOffline + ", txnAmt = " + txnAmtTextBoxValue + ", paymentAppId = " + paymentAppIdComboBoxValue );
//jsonResultByThead = n5Core.requestSale(this.getTxnId(), txnAmtTextBoxValue, "0", paymentAppIdComboBoxValue, qrValueTextBoxValue);
this.offlineRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestOfflineThead);
th.Start();
}
}
else if ("Refund".Equals(this.thisEvent))
{
@ -458,6 +326,8 @@ namespace ECR_N5_DLL_TestUI
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
paymentAppIdComboBoxValue = this.paymentAppIdComboBox.Text;
qrValueTextBoxValue = this.qrValueTextBox.Text;
oriTxnDateTextBoxValue = this.oriTxnDateTextBox.Text;
hostRefNoTextBoxValue = this.hostRefNoTextBox.Text;
txnIdForRefund = this.getTxnId();
this.requestStrByThead = "Test Function : " + currEventName + "\n txnId = " + txnIdForRefund + "\n txnAmt = " + txnAmtTextBoxValue + "\n paymentAppId = " + paymentAppIdComboBoxValue + "\n qrValue = " + qrValueTextBoxValue;
@ -493,6 +363,16 @@ namespace ECR_N5_DLL_TestUI
th.Start();
}
}
else if ("SummaryEnquiry".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
enquiryPeriod = periodTextBox.Text;
//jsonResultByThead = n5Core.requestRetrieval(ecrTxnIdTextBoxValue, 180000);
this.summaryEnquiryRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestSummaryEnquiryThead);
th.Start();
}
else if ("Void".Equals(this.thisEvent))
{
if (this.ecrTxnIdTextBox.Text == null || "".Equals(this.ecrTxnIdTextBox.Text.Trim()))
@ -527,60 +407,62 @@ namespace ECR_N5_DLL_TestUI
Thread th = new Thread(requestSettlementThead);
th.Start();
}
else if ("Link Request".Equals(this.thisEvent))
else if ("GetInfo".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendLinkTestRequest();
this.linkTestRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestLinkRequestThead);
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.getInfoRequestMsg = this.requestStrByThead;
Thread th = new Thread(requesGetInfoThead);
th.Start();
}
else if ("Reprint".Equals(this.thisEvent))
else if ("CheckUpdate".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendReprintRequest();
this.reprintRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestReprintThead);
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.checkUpdateRequestMsg = this.requestStrByThead;
Thread th = new Thread(requesCheckUpdateThead);
th.Start();
}
else if ("Terminaion".Equals(this.thisEvent))
else if ("ExecuteUpdate".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendAbortRequest();
this.terminaionRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestTerminaionThead);
//jsonResultByThead = n5Core.sendSettlementtRequest();
this.executeUpdateRequestMsg = this.requestStrByThead;
Thread th = new Thread(requesExecuteUpdateThead);
th.Start();
}
else if ("Scan".Equals(this.thisEvent))
else if ("Link Request".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendAbortRequest();
this.scanRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestScanThread);
//jsonResultByThead = n5Core.sendLinkTestRequest();
this.linkTestRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestLinkRequestThead);
th.Start();
}
else if ("ReadCard".Equals(this.thisEvent))
else if ("Reprint".Equals(this.thisEvent))
{
ecrTxnIdTextBoxValue = this.ecrTxnIdTextBox.Text;
this.requestStrByThead = "Test Function : " + currEventName;
showResult();
//jsonResultByThead = n5Core.sendAbortRequest();
this.readCardRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestReadCardNFCThead);
//jsonResultByThead = n5Core.sendReprintRequest();
this.reprintRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestReprintThead);
th.Start();
}
else if ("AddPoint".Equals(this.thisEvent))
else if ("Terminaion".Equals(this.thisEvent))
{
this.requestStrByThead = "Test Function : " + currEventName;
ecrTxnIdTextBoxValue = this.ecrTxnIdTextBox.Text;
txnAmtTextBoxValue = this.txnAmtTextBox.Text;
showResult();
//jsonResultByThead = n5Core.sendAbortRequest();
this.addPointRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestAddPointThead);
this.terminaionRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestTerminaionThead);
th.Start();
}
else if ("BatchEnquiry".Equals(this.thisEvent))
@ -667,6 +549,25 @@ namespace ECR_N5_DLL_TestUI
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if ("CreateOrder".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
this.txnAmtTextBox.IsEnabled = true;
this.paymentTypeTextBox.IsEnabled = true;
if (this.paymentAppIdComboBox.Text == null || "".Equals(this.paymentAppIdComboBox.Text))
{
this.paymentAppIdComboBox.Text = "CC";
}
this.batchIdTextBox.Text = "";
this.settleDateTextBox.Text = "";
this.paymentAppIdComboBox.IsEnabled = true;
this.qrValueTextBox.IsEnabled = true;
this.panTextBox.IsEnabled = true;
this.expDateTextBox.IsEnabled = true;
this.ecrTxnIdTextBox.IsEnabled = false;
this.batchIdTextBox.IsEnabled = false;
this.settleDateTextBox.IsEnabled = false;
}
else if("PreAuth".Equals(this.thisEvent))
{
this.ecrTxnIdTextBox.Text = "";
@ -892,26 +793,6 @@ namespace ECR_N5_DLL_TestUI
}
}
private void Submit_Repeat_Button_Click(object sender, RoutedEventArgs e)
{
this.requestTextBox.Text = string.Empty;
this.result1TextBox.Text = string.Empty;
if (!isRepeatSubmit)
{
this.submit_repeat_Button.Content = "Stop Repeat";
isRepeatSubmit = true;
addRepeatLog("==========Repeat start========== ");
this.sendRepeatSubmit();
}
else
{
this.submit_repeat_Button.Content = "Start Repeat";
isRepeatSubmit = false;
this.stopRepeatSubmit();
addRepeatLog("==========Repeat end========== ");
}
}
private void Submit_1_Button_Click(object sender, RoutedEventArgs e)
{
this.requestTextBox.Text = string.Empty;
@ -923,6 +804,16 @@ namespace ECR_N5_DLL_TestUI
this.submit_1_Button.IsEnabled = true;
}
private void Abort_Button_Click(object sender, RoutedEventArgs e)
{
this.requestStrByThead = "Test Function : " + currEventName;
//showResult();
//jsonResultByThead = n5Core.sendAbortRequest();
this.terminaionRequestMsg = this.requestStrByThead;
Thread th = new Thread(requestTerminaionThead);
th.Start();
}
private void Reset_Button_Click(object sender, RoutedEventArgs e)
{
this.requestTextBox.Text = string.Empty;
@ -966,7 +857,7 @@ namespace ECR_N5_DLL_TestUI
}
}
public string getTxnId()
private string getTxnId()
{
StringBuilder txnIdSb = new StringBuilder();
DateTime dt = DateTime.Now;
@ -993,31 +884,6 @@ namespace ECR_N5_DLL_TestUI
return txnIdResult;
}
// public delegate void UpdateTextCallback(string message);
// private void UpdateTextThread()
// {
// this.requestTextBox.Dispatcher.Invoke(
// new UpdateTextCallback(this.UpdateRequestText),
// new object[] { "" });
//
// this.result1TextBox.Dispatcher.Invoke(
// new UpdateTextCallback(this.UpdateRequestText),
// new object[] { "" });
//
// }
// private int UpdateRequestText()
// {
// this.requestTextBox.Text = this.requestStrByThead;
// this.result1TextBox.Text = this.jsonResultByThead;
// if (this.logPathTextBox.Text == null || "".Equals(this.logPathTextBox.Text.Trim()))
// {
// this.logPathTextBox.Text = "Log Path : " + System.IO.Path.GetTempPath() + "\\myN5TestWin.log";
// }
// return 0;
// }
private int showResult()
{
//this.requestTextBox.Text = this.requestStrByThead;

Binary file not shown.

@ -0,0 +1,321 @@
using System;
using System.Text;
namespace n5coredll
{
public class InstllResult {
private static string TXN_ID = "TXN_ID";
private static string STATUS = "STATUS";
private static string TXN_AMT = "TXN_AMT";
private static string PAYMENT_TYPE = "PAYMENT_TYPE";
private static string RESP_CODE = "RESP_CODE";
private static string TRACE_NO = "TRACE_NO";
private static string TXN_DATE = "TXN_DATE";
private static string TXN_TIME = "TXN_TIME";
private static string HOST_REF = "HOST_REF";
private static string AUTH_CODE = "AUTH_CODE";
private static string MID = "MID";
private static string TID = "TID";
private static string PAN = "PAN";
private static string EXPIRY_DATE = "EXPIRY_DATE";
private static string AID = "AID";
private static string ENTRY_MODE = "ENTRY_MODE";
private static string BATCH_NO = "BATCH_NO";
private static string TC = "TC";
private static string APP = "APP";
private static string ACQUIRER = "ACQUIRER";
private string ecrRefTxnId;
private string status;
private decimal txnAmt;
private PaymentType paymentType;
private string respCode;
private string traceNo;
private string txnDate;
private string txnTime;
private string hostRef;
private string couponId;
private string authCode;
private string mid;
private string tid;
private string pan;
private string expiryDate;
private string aid;
private string entryMode;
private string batchNo;
private string tc;
private string app;
private string acquirer;
private void setEcrRefTxnId(string pEcrRefTxnId) {
ecrRefTxnId = pEcrRefTxnId;
}
public string EcrRefTxnId {
get { return ecrRefTxnId; }
}
public string Status {
get { return status; }
}
private void setStatus(string pStatus) {
this.status = pStatus;
}
public decimal TxnAmt {
get { return txnAmt; }
}
private void setTxnAmt(decimal pTxnAmt) {
this.txnAmt = pTxnAmt;
}
public PaymentType PaymentType {
get { return paymentType; }
}
private void setPaymentType(PaymentType pPaymentType) {
this.paymentType = pPaymentType;
}
public string RespCode {
get { return respCode; }
}
private void setRespCode(string pRespCode) {
this.respCode = pRespCode;
}
public string TraceNo {
get { return traceNo; }
}
private void setTraceNo(string pTraceNo) {
this.traceNo = pTraceNo;
}
public string TxnDate {
get { return txnDate; }
}
private void setTxnDate(string pTxnDate) {
this.txnDate = pTxnDate;
}
public string TxnTime {
get { return txnTime; }
}
private void setTxnTime(string pTxnTime) {
this.txnTime = pTxnTime;
}
public string HostRef {
get { return hostRef; }
}
private void setHostRef(string pHostRef) {
this.hostRef = pHostRef;
}
public string CouponId {
get { return couponId; }
}
private void setCouponId(string pCouponId) {
this.couponId = pCouponId;
}
public string AuthCode {
get { return authCode; }
}
private void setAuthCode(string pAuthCode) {
this.authCode = pAuthCode;
}
public string Mid {
get { return mid; }
}
private void setMid(string pMid) {
this.mid = pMid;
}
public string Tid {
get { return tid; }
}
private void setTid(string pTid) {
this.tid = pTid;
}
public string Pan {
get { return pan; }
}
private void setPan(string pPan) {
this.pan = pPan;
}
public string ExpiryDate {
get { return expiryDate; }
}
private void setExpiryDate(string pExpiryDate) {
this.expiryDate = pExpiryDate;
}
public string Aid {
get { return aid; }
}
private void setAid(string pAid) {
this.aid = pAid;
}
public string EntryMode {
get { return entryMode; }
}
private void setEntryMode(string pEntryMode) {
this.entryMode = pEntryMode;
}
public string BatchNo {
get { return batchNo; }
}
private void setBatchNo(string pBatchNo) {
this.batchNo = pBatchNo;
}
public string Tc {
get { return tc; }
}
private void setTc(string pTc) {
this.tc = pTc;
}
public string App {
get { return app; }
}
private void setApp(string pApp) {
this.app = pApp;
}
public string Acquirer {
get { return acquirer; }
}
private void setAcquirer(string pAcquirer) {
this.acquirer = pAcquirer;
}
private static string curTxnId;
public static string getCurTxnId()
{
return curTxnId;
}
public static string toJsonForInstl(string thisTxnId, decimal txnAmt, string tender, PaymentApp appId, string qrcValue) {
if (thisTxnId == null || "".Equals(thisTxnId)) {
Console.WriteLine("getTxnId is null ");
return null;
}
string instlMsg;
if (tender == null || tender.Equals(string.Empty))
instlMsg = "{\"EVENT_NAME\":\"INSTL\",\"PAYMENT_APP_ID\":\"" + ObjectUtil.getPaymentAppValue(appId) + "\",\"TXN_ID\":\"" + thisTxnId + "\",\"QRC_VALUE\":\"" + qrcValue + "\",\"TXN_AMT\":" + txnAmt.ToString() + "}";
else
instlMsg = "{\"EVENT_NAME\":\"INSTL\",\"PAYMENT_APP_ID\":\"" + ObjectUtil.getPaymentAppValue(appId) + "\",\"TENDER\":\"" + tender + "\",\"TXN_ID\":\"" + thisTxnId + "\",\"QRC_VALUE\":\"" + qrcValue + "\",\"TXN_AMT\":" + txnAmt.ToString() + "}";
return instlMsg;
}
private static string getTxnId() {
StringBuilder txnIdSb = new StringBuilder();
DateTime dt = DateTime.Now;
txnIdSb.Append(dt.ToString("yyyyMMddHHmmssfff"));
Console.WriteLine("txnIdSb = " + txnIdSb.ToString());
int randomTime = 0;
if (dt.Ticks.ToString().Length > 8) {
Console.WriteLine("Ticks.Length > 8 = " + dt.Ticks.ToString());
randomTime = int.Parse(dt.Ticks.ToString().Substring(0, 8));
}
else {
randomTime = int.Parse(dt.Ticks.ToString());
}
if (randomTime > 0) {
Random random = new Random(randomTime);
for (int i = 0; i < 15; i++) {
int thidRandom = random.Next(10);
txnIdSb.Append(thidRandom);
}
Console.WriteLine("txnIdSb.ToString = " + txnIdSb.ToString());
return txnIdSb.ToString();
}
else {
Console.WriteLine("randomTime is error = " + randomTime);
}
return "";
}
public static InstllResult toInstllResultFromJsonMsg(string jsonMsg) {
if (jsonMsg == null || !jsonMsg.StartsWith("{") || !jsonMsg.EndsWith("}")) {
return null;
}
int jsonLength = jsonMsg.Length;
jsonMsg = jsonMsg.Substring(0, jsonLength - 1);
jsonMsg = jsonMsg.Substring(1, jsonLength - 2);
string[] column = jsonMsg.Split(',');
string[] valueColumn = null;
string valueColumn0 = null;
string valueColumn1 = null;
InstllResult result = new InstllResult();
for (int i = 0; i < column.Length; i++) {
valueColumn = column[i].Split(':');
valueColumn0 = valueColumn[0].Replace('"', ' ').Trim();
valueColumn1 = valueColumn[1].Replace('"', ' ').Trim();
if (InstllResult.TXN_ID.Equals(valueColumn0)) {
result.setEcrRefTxnId(valueColumn1);
}
if (InstllResult.STATUS.Equals(valueColumn0)) {
result.setStatus(valueColumn1);
}
if (InstllResult.TXN_AMT.Equals(valueColumn0)) {
if (valueColumn1 == null || "".Equals(valueColumn1)) {
result.setTxnAmt(decimal.Parse("0.00", System.Globalization.NumberStyles.AllowDecimalPoint));
}
else {
result.setTxnAmt(decimal.Parse(valueColumn1));
}
}
if (InstllResult.PAYMENT_TYPE.Equals(valueColumn0)) {
result.setPaymentType(ObjectUtil.getPaymentType(valueColumn1));
}
if (InstllResult.RESP_CODE.Equals(valueColumn0)) {
result.setRespCode(valueColumn1);
}
if (InstllResult.TRACE_NO.Equals(valueColumn0)) {
result.setTraceNo(valueColumn1);
}
if (InstllResult.TXN_DATE.Equals(valueColumn0)) {
result.setTxnDate(valueColumn1);
}
if (InstllResult.TXN_TIME.Equals(valueColumn0)) {
result.setTxnTime(valueColumn1);
}
if (InstllResult.HOST_REF.Equals(valueColumn0)) {
result.setHostRef(valueColumn1);
}
if (InstllResult.AUTH_CODE.Equals(valueColumn0)) {
result.setAuthCode(valueColumn1);
}
if (InstllResult.MID.Equals(valueColumn0)) {
result.setMid(valueColumn1);
}
if (InstllResult.TID.Equals(valueColumn0)) {
result.setTid(valueColumn1);
}
if (InstllResult.PAN.Equals(valueColumn0)) {
result.setPan(valueColumn1);
}
if (InstllResult.EXPIRY_DATE.Equals(valueColumn0)) {
result.setExpiryDate(valueColumn1);
}
if (InstllResult.AID.Equals(valueColumn0)) {
result.setAid(valueColumn1);
}
if (InstllResult.ENTRY_MODE.Equals(valueColumn0)) {
result.setEntryMode(valueColumn1);
}
if (InstllResult.BATCH_NO.Equals(valueColumn0)) {
result.setBatchNo(valueColumn1);
}
if (InstllResult.APP.Equals(valueColumn0)) {
result.setApp(valueColumn1);
}
if (InstllResult.TC.Equals(valueColumn0)) {
result.setTc(valueColumn1);
}
if (InstllResult.ACQUIRER.Equals(valueColumn0)) {
result.setAcquirer(valueColumn1);
}
}
return result;
}
}
}

@ -1,72 +0,0 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace n5coredll
{
public class LogUtil
{
private static String mLogPath;
private static LogUtil mInstance;
public static LogUtil getInstance()
{
if (mInstance == null)
mInstance = new LogUtil();
return mInstance;
}
public void setLogPath(String logPath)
{
if (logPath.EndsWith(@"\"))
mLogPath = logPath;
else
mLogPath = logPath + @"\";
}
private String getCurLogFile()
{
StringBuilder txnIdSb = new StringBuilder();
DateTime dt = DateTime.Now;
return ("n5dll" + "_" + dt.ToString("yyyyMMdd") +".log");
}
public void addRepeatLog(string logInfo)
{
try
{
String path = mLogPath + getCurLogFile();
//path = @"C:\Users\rexli\AppData\Local\Temp\test.log";
if (!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ffff") + " [LOGGER] " + logInfo);
sw.Flush();
sw.Close();
}
}
else
{
using (StreamWriter sw = File.AppendText(path))
{
sw.WriteLine(DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss:ffff") + " [LOGGER] " + logInfo);
sw.Flush();
sw.Close();
}
}
// Console.WriteLine(logInfo);
}
catch (Exception err)
{
Console.WriteLine("Exception = " + err);
}
}
}
}

File diff suppressed because it is too large Load Diff

@ -237,6 +237,12 @@ namespace n5coredll
return cardRefundMsg;
}
public static string toJsonForRefund(string txnIId, decimal txnAmt, PaymentApp appId, string qrcValue, string txnDate, string hostRefNo)
{
string cardRefundMsg = "{\"EVENT_NAME\":\"REFUND\",\"PAYMENT_APP_ID\":\"" + ObjectUtil.getPaymentAppValue(appId) + "\",\"TXN_ID\":\"" + txnIId + "\",\"QRC_VALUE\":\"" + qrcValue + "\",\"TXN_AMT\":" + txnAmt.ToString() + ",\"TXN_DATE\":\"" + txnDate + "\",\"HOST_REF\":\"" + hostRefNo + "\"}";
return cardRefundMsg;
}
private static string getTxnId() {
StringBuilder txnIdSb = new StringBuilder();
DateTime dt = DateTime.Now;

@ -30,14 +30,33 @@ namespace n5coredll
return "{\"EVENT_NAME\":\"SETTLE\"}";
}
public static string toJsonGetInfo()
{
// return "{\"EVENT_NAME\":\"GET_INFO\"}";
return "{\"EVENT_NAME\":\"GETDEVICEINFO\",\"PAYMENT_APP_ID\":\"CC\"}";
}
public static string toCheckUpdate()
{
// return "{\"EVENT_NAME\":\"GET_INFO\"}";
return "{\"EVENT_NAME\":\"CHECKUPDATE\"}";
}
public static string toExecuteUpdate()
{
// return "{\"EVENT_NAME\":\"GET_INFO\"}";
return "{\"EVENT_NAME\":\"EXECUTEUPDATE\"}";
}
public static string toJsonParam()
{
return "{\"EVENT_NAME\":\"PARAM\",\"PAYMENT_APP_ID\":\"CC\"}";
}
public static string toJsonForReprint()
public static string toJsonForReprint(String txnId)
{
return "{\"EVENT_NAME\":\"PRINT\",\"IS_REPRINT\":true}";
return "{\"EVENT_NAME\":\"PRINT\",\"TXN_ID\":\"" + txnId + "\",\"IS_REPRINT\":true}";
}
public static string toJsonForAbort()
@ -61,6 +80,13 @@ namespace n5coredll
return cardSaleMsg;
}
public static string toJsonForCreateOrder(string inputTxnId, decimal txnAmt, string paymentType)
{
string cardSaleMsg = "{\"EVENT_NAME\":\"CREATE_ORDER\",\"TXN_ID\":\"" + inputTxnId + "\",\"TXN_AMT\":" + txnAmt + ",\"PAYMENT_TYPE\":\"" +paymentType + "\",\"PAYMENT_APP_ID\":\"QRC\"}";
return cardSaleMsg;
}
public static string toJsonForBatchEnquiry(string settleDate)
{
return "{\"EVENT_NAME\":\"BATCH_ENQUIRY\",\"SETTLE_DATE\":\"" + settleDate + "\"}";
@ -75,6 +101,12 @@ namespace n5coredll
{
return "{\"EVENT_NAME\":\"SUMMARY_ENQUIRY\",\"TXN_DATE_START_TO_END\":\"" + period + "\"}";
}
public static string toJsonHealthCheck()
{
return "{\"EVENT_NAME\":\"HEALTH_CHECK\"}";
}
public static RequestResult toReqResultFromJsonMsg(string jsonMsg) {
if (jsonMsg == null || !jsonMsg.StartsWith("{") || !jsonMsg.EndsWith("}")) {
return null;

@ -354,19 +354,19 @@ namespace n5coredll
if (RetrievalResult.TXN_AMT.Equals(valueColumn0)) {
if (valueColumn1 == null || "".Equals(valueColumn1)) {
retrievalResult.setTxnAmt(decimal.Parse("0.00", System.Globalization.NumberStyles.AllowDecimalPoint));
retrievalResult.setTxnAmt(int.Parse("0", System.Globalization.NumberStyles.AllowDecimalPoint));
}
else {
retrievalResult.setTxnAmt(decimal.Parse(valueColumn1, System.Globalization.NumberStyles.AllowDecimalPoint));
retrievalResult.setTxnAmt(int.Parse(valueColumn1, System.Globalization.NumberStyles.AllowDecimalPoint));
}
}
if (RetrievalResult.TIPS.Equals(valueColumn0)) {
if (valueColumn1 == null || "".Equals(valueColumn1)) {
retrievalResult.setTipAmt(decimal.Parse("0.00", System.Globalization.NumberStyles.AllowDecimalPoint));
retrievalResult.setTipAmt(int.Parse("0", System.Globalization.NumberStyles.AllowDecimalPoint));
}
else {
retrievalResult.setTipAmt(decimal.Parse(valueColumn1, System.Globalization.NumberStyles.AllowDecimalPoint));
retrievalResult.setTipAmt(int.Parse(valueColumn1, System.Globalization.NumberStyles.AllowDecimalPoint));
}
}

Binary file not shown.

Binary file not shown.

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>n5coredll</RootNamespace>
<AssemblyName>n5coredll</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@ -23,6 +23,7 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
<RegisterForComInterop>true</RegisterForComInterop>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -49,7 +50,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="LogUtil.cs" />
<Compile Include="LoyaltyType.cs" />
<Compile Include="N5Core.cs" />
<Compile Include="N5PropertyOper.cs" />
@ -62,6 +62,7 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="InstllResult.cs" />
<Compile Include="RefundResult.cs" />
<Compile Include="RequestResult.cs" />
<Compile Include="RetrievalResult.cs" />

Loading…
Cancel
Save