diff --git a/CashCode.Net/CashCode.Test/CashCode.Test.csproj b/CashCode.Net/CashCode.Test/CashCode.Test.csproj new file mode 100644 index 0000000..84bd014 --- /dev/null +++ b/CashCode.Net/CashCode.Test/CashCode.Test.csproj @@ -0,0 +1,75 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {0E1BE289-6D28-41C6-AAD6-271B19DCA9C6} + Exe + Properties + CashCode.Test + CashCode.Test + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + True + True + Settings.settings + + + + + {71B8BA4F-9AE3-4EC9-8196-79E0A2A4834B} + CashCode.Net + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + \ No newline at end of file diff --git a/CashCode.Net/CashCode.Test/Program.cs b/CashCode.Net/CashCode.Test/Program.cs new file mode 100644 index 0000000..0cc50b4 --- /dev/null +++ b/CashCode.Net/CashCode.Test/Program.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using CashCode.Net; + +namespace CashCodeTest +{ + class Program + { + static int Sum = 0; + + static void Main(string[] args) + { + try + { + using (CashCodeBillValidator c = new CashCodeBillValidator(CashCode.Test.Properties.Settings.Default.Port, 9600)) + { + c.BillReceived += new BillReceivedHandler(c_BillReceived); + c.BillStacking += new BillStackingHandler(c_BillStacking); + c.BillCassetteStatusEvent += new BillCassetteHandler(c_BillCassetteStatusEvent); + c.ConnectBillValidator(); + + if (c.IsConnected) + { + c.PowerUpBillValidator(); + c.StartListening(); + + + c.EnableBillValidator(); + Console.ReadKey(); + c.DisableBillValidator(); + Console.ReadKey(); + c.EnableBillValidator(); + Console.ReadKey(); + c.StopListening(); + } + + c.Dispose(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.Message); + } + } + + static void c_BillCassetteStatusEvent(object Sender, BillCassetteEventArgs e) + { + Console.WriteLine(e.Status.ToString()); + } + + static void c_BillStacking(object Sender, System.ComponentModel.CancelEventArgs e) + { + Console.WriteLine("Купюра в стеке"); + if (Sum > 100) + { + //e.Cancel = true; + Console.WriteLine("Превышен лимит единовременной оплаты"); + } + } + + static void c_BillReceived(object Sender, BillReceivedEventArgs e) + { + if (e.Status == BillRecievedStatus.Rejected) + { + Console.WriteLine(e.RejectedReason); + } + else if (e.Status == BillRecievedStatus.Accepted) + { + Sum += e.Value; + Console.WriteLine("Bill accepted! " + e.Value + " руб. Общая сумму: " + Sum.ToString()); + } + } + + + } +} diff --git a/CashCode.Net/CashCode.Test/Properties/AssemblyInfo.cs b/CashCode.Net/CashCode.Test/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7f0d74d --- /dev/null +++ b/CashCode.Net/CashCode.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CashCode.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CashCode.Test")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("75c553a2-e8e9-43fe-a44c-2d86e555b988")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CashCode.Net/CashCode.Test/Properties/Settings.Designer.cs b/CashCode.Net/CashCode.Test/Properties/Settings.Designer.cs new file mode 100644 index 0000000..c21f01b --- /dev/null +++ b/CashCode.Net/CashCode.Test/Properties/Settings.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18052 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CashCode.Test.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.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; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("COM1")] + public string Port { + get { + return ((string)(this["Port"])); + } + set { + this["Port"] = value; + } + } + } +} diff --git a/CashCode.Net/CashCode.Test/Properties/Settings.settings b/CashCode.Net/CashCode.Test/Properties/Settings.settings new file mode 100644 index 0000000..e3798de --- /dev/null +++ b/CashCode.Net/CashCode.Test/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + COM1 + + + \ No newline at end of file diff --git a/CashCode.Net/CashCode.Test/app.config b/CashCode.Net/CashCode.Test/app.config new file mode 100644 index 0000000..cf24785 --- /dev/null +++ b/CashCode.Net/CashCode.Test/app.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + COM1 + + + + \ No newline at end of file diff --git a/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Net.dll b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Net.dll new file mode 100644 index 0000000..4b7761f Binary files /dev/null and b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Net.dll differ diff --git a/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Net.pdb b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Net.pdb new file mode 100644 index 0000000..bb2a30a Binary files /dev/null and b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Net.pdb differ diff --git a/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.exe b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.exe new file mode 100644 index 0000000..1c8fb8b Binary files /dev/null and b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.exe differ diff --git a/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.exe.config b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.exe.config new file mode 100644 index 0000000..cf24785 --- /dev/null +++ b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.exe.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + COM1 + + + + \ No newline at end of file diff --git a/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.pdb b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.pdb new file mode 100644 index 0000000..5d07e24 Binary files /dev/null and b/CashCode.Net/CashCode.Test/bin/Debug/CashCode.Test.pdb differ diff --git a/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.csproj.FileListAbsolute.txt b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..51eff2c --- /dev/null +++ b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.csproj.FileListAbsolute.txt @@ -0,0 +1,8 @@ +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\obj\x86\Debug\CashCode.Test.csprojResolveAssemblyReference.cache +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\bin\Debug\CashCode.Test.exe.config +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\bin\Debug\CashCode.Test.exe +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\bin\Debug\CashCode.Test.pdb +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\bin\Debug\CashCode.Net.dll +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\bin\Debug\CashCode.Net.pdb +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\obj\x86\Debug\CashCode.Test.exe +D:\GitHub\CashCode\CashCode.Net\CashCode.Test\obj\x86\Debug\CashCode.Test.pdb diff --git a/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.csprojResolveAssemblyReference.cache b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000..343ad58 Binary files /dev/null and b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.csprojResolveAssemblyReference.cache differ diff --git a/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.exe b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.exe new file mode 100644 index 0000000..1c8fb8b Binary files /dev/null and b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.exe differ diff --git a/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.pdb b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.pdb new file mode 100644 index 0000000..5d07e24 Binary files /dev/null and b/CashCode.Net/CashCode.Test/obj/x86/Debug/CashCode.Test.pdb differ diff --git a/CashCode.Net/CashCode.Test/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/CashCode.Net/CashCode.Test/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..e63393e Binary files /dev/null and b/CashCode.Net/CashCode.Test/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ