Commit 060534d6 by Liv Haapala

korttien tagaus

1 parent e442e589
Showing with 620 additions and 39 deletions
......@@ -3,7 +3,7 @@ using System.IO;
using System.Net;
using System.Text;
public enum HttpVerb
public enum BarcodeHttpVerb
{
GET,
POST,
......@@ -13,28 +13,28 @@ public enum HttpVerb
namespace HttpUtils
{
public class RestClient
public class BarcodeRestClient
{
public string EndPoint { get; set; }
public HttpVerb Method { get; set; }
public BarcodeHttpVerb Method { get; set; }
public string ContentType { get; set; }
public string PostData { get; set; }
public RestClient()
public BarcodeRestClient()
{
EndPoint = "";
Method = HttpVerb.GET;
Method = BarcodeHttpVerb.GET;
ContentType = "text/xml";
PostData = "";
}
public RestClient(string endpoint)
public BarcodeRestClient(string endpoint)
{
EndPoint = endpoint;
Method = HttpVerb.GET;
Method = BarcodeHttpVerb.GET;
ContentType = "text/xml";
PostData = "";
}
public RestClient(string endpoint, HttpVerb method)
public BarcodeRestClient(string endpoint, BarcodeHttpVerb method)
{
EndPoint = endpoint;
Method = method;
......@@ -42,7 +42,7 @@ namespace HttpUtils
PostData = "";
}
public RestClient(string endpoint, HttpVerb method, string postData)
public BarcodeRestClient(string endpoint, BarcodeHttpVerb method, string postData)
{
EndPoint = endpoint;
Method = method;
......@@ -64,7 +64,7 @@ namespace HttpUtils
request.ContentLength = 0;
request.ContentType = ContentType;
if (!string.IsNullOrEmpty(PostData) && Method == HttpVerb.POST)
if (!string.IsNullOrEmpty(PostData) && Method == BarcodeHttpVerb.POST)
{
var encoding = new UTF8Encoding();
var bytes = Encoding.GetEncoding("iso-8859-1").GetBytes(PostData);
......
......@@ -54,7 +54,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RestClient.cs" />
<Compile Include="BarcodeRestClient.cs" />
<Compile Include="Scanner.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
......
......@@ -36,7 +36,7 @@ namespace BarcodeScannerClient
void scanner_BarcodeReceived(string data)
{
string url = apiUrlTextBox.Text.Replace("%", data);
RestClient client = new RestClient(url);
BarcodeRestClient client = new BarcodeRestClient(url);
try
{
......
......@@ -10,3 +10,9 @@ C:\devel\proj\moya\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClien
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.exe.config
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\obj\x86\Debug\BarcodeScannerClient.exe
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\obj\x86\Debug\BarcodeScannerClient.pdb
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.exe
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.pdb
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\obj\x86\Debug\BarcodeScannerClient.csprojResolveAssemblyReference.cache
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\obj\x86\Debug\BarcodeScannerClient.Form1.resources
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\obj\x86\Debug\BarcodeScannerClient.Properties.Resources.resources
C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\obj\x86\Debug\BarcodeScannerClient.csproj.GenerateResource.Cache

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CardDisplay", "CardDisplay\CardDisplay.csproj", "{9CE1A44D-28CF-4277-BAC7-D73A8C2D8059}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BarcodeScannerClient", "..\..\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient.csproj", "{967BFEFE-7B3C-4EE9-80F1-EC6903E1ACB5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
......@@ -13,6 +15,10 @@ Global
{9CE1A44D-28CF-4277-BAC7-D73A8C2D8059}.Debug|x86.Build.0 = Debug|x86
{9CE1A44D-28CF-4277-BAC7-D73A8C2D8059}.Release|x86.ActiveCfg = Release|x86
{9CE1A44D-28CF-4277-BAC7-D73A8C2D8059}.Release|x86.Build.0 = Release|x86
{967BFEFE-7B3C-4EE9-80F1-EC6903E1ACB5}.Debug|x86.ActiveCfg = Debug|x86
{967BFEFE-7B3C-4EE9-80F1-EC6903E1ACB5}.Debug|x86.Build.0 = Debug|x86
{967BFEFE-7B3C-4EE9-80F1-EC6903E1ACB5}.Release|x86.ActiveCfg = Release|x86
{967BFEFE-7B3C-4EE9-80F1-EC6903E1ACB5}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
namespace CardDisplay
{
partial class AddCardMetaData
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.label1 = new System.Windows.Forms.Label();
this.NumberOfCardSlotsnumericUpDown = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
this.prefixTextBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.PageNumberNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.label4 = new System.Windows.Forms.Label();
this.SlotsNumberNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.startButton = new System.Windows.Forms.Button();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.BooksNumberNumericUpDown = new System.Windows.Forms.NumericUpDown();
this.label5 = new System.Windows.Forms.Label();
this.lastAddedTextBox = new System.Windows.Forms.TextBox();
this.readersComboBox1 = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.NumberOfCardSlotsnumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.PageNumberNumericUpDown)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.SlotsNumberNumericUpDown)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.BooksNumberNumericUpDown)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(9, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Korttislottien määrä sivulla";
//
// NumberOfCardSlotsnumericUpDown
//
this.NumberOfCardSlotsnumericUpDown.Location = new System.Drawing.Point(143, 7);
this.NumberOfCardSlotsnumericUpDown.Name = "NumberOfCardSlotsnumericUpDown";
this.NumberOfCardSlotsnumericUpDown.Size = new System.Drawing.Size(39, 20);
this.NumberOfCardSlotsnumericUpDown.TabIndex = 1;
this.NumberOfCardSlotsnumericUpDown.Value = new decimal(new int[] {
4,
0,
0,
0});
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(104, 119);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(33, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Prefix";
//
// prefixTextBox
//
this.prefixTextBox.Location = new System.Drawing.Point(143, 116);
this.prefixTextBox.Name = "prefixTextBox";
this.prefixTextBox.Size = new System.Drawing.Size(100, 20);
this.prefixTextBox.TabIndex = 3;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(65, 64);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 13);
this.label3.TabIndex = 4;
this.label3.Text = "Sivun numero";
//
// PageNumberNumericUpDown
//
this.PageNumberNumericUpDown.Location = new System.Drawing.Point(143, 62);
this.PageNumberNumericUpDown.Name = "PageNumberNumericUpDown";
this.PageNumberNumericUpDown.Size = new System.Drawing.Size(39, 20);
this.PageNumberNumericUpDown.TabIndex = 5;
this.PageNumberNumericUpDown.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(66, 93);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(71, 13);
this.label4.TabIndex = 6;
this.label4.Text = "Slotin numero";
//
// SlotsNumberNumericUpDown
//
this.SlotsNumberNumericUpDown.Location = new System.Drawing.Point(143, 91);
this.SlotsNumberNumericUpDown.Name = "SlotsNumberNumericUpDown";
this.SlotsNumberNumericUpDown.Size = new System.Drawing.Size(39, 20);
this.SlotsNumberNumericUpDown.TabIndex = 7;
this.SlotsNumberNumericUpDown.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// startButton
//
this.startButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.startButton.Location = new System.Drawing.Point(179, 291);
this.startButton.Name = "startButton";
this.startButton.Size = new System.Drawing.Size(75, 23);
this.startButton.TabIndex = 8;
this.startButton.Text = "Aloita";
this.startButton.UseVisualStyleBackColor = true;
this.startButton.Click += new System.EventHandler(this.button1_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.lastAddedTextBox);
this.groupBox1.Location = new System.Drawing.Point(12, 189);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(232, 66);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Viimeksi lisätty";
//
// BooksNumberNumericUpDown
//
this.BooksNumberNumericUpDown.Location = new System.Drawing.Point(143, 36);
this.BooksNumberNumericUpDown.Name = "BooksNumberNumericUpDown";
this.BooksNumberNumericUpDown.Size = new System.Drawing.Size(39, 20);
this.BooksNumberNumericUpDown.TabIndex = 11;
this.BooksNumberNumericUpDown.Value = new decimal(new int[] {
1,
0,
0,
0});
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(65, 38);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(71, 13);
this.label5.TabIndex = 10;
this.label5.Text = "Kirjan numero";
//
// lastAddedTextBox
//
this.lastAddedTextBox.Location = new System.Drawing.Point(18, 31);
this.lastAddedTextBox.Name = "lastAddedTextBox";
this.lastAddedTextBox.Size = new System.Drawing.Size(198, 20);
this.lastAddedTextBox.TabIndex = 0;
//
// readersComboBox1
//
this.readersComboBox1.FormattingEnabled = true;
this.readersComboBox1.Location = new System.Drawing.Point(12, 162);
this.readersComboBox1.Name = "readersComboBox1";
this.readersComboBox1.Size = new System.Drawing.Size(231, 21);
this.readersComboBox1.TabIndex = 12;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(9, 146);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(35, 13);
this.label6.TabIndex = 13;
this.label6.Text = "Lukija";
//
// timer1
//
this.timer1.Interval = 4000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// AddCardMetaData
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(266, 326);
this.Controls.Add(this.label6);
this.Controls.Add(this.readersComboBox1);
this.Controls.Add(this.BooksNumberNumericUpDown);
this.Controls.Add(this.label5);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.startButton);
this.Controls.Add(this.SlotsNumberNumericUpDown);
this.Controls.Add(this.label4);
this.Controls.Add(this.PageNumberNumericUpDown);
this.Controls.Add(this.label3);
this.Controls.Add(this.prefixTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.NumberOfCardSlotsnumericUpDown);
this.Controls.Add(this.label1);
this.Name = "AddCardMetaData";
this.Text = "AddCardMetaData";
this.Load += new System.EventHandler(this.AddCardMetaData_Load);
((System.ComponentModel.ISupportInitialize)(this.NumberOfCardSlotsnumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.PageNumberNumericUpDown)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.SlotsNumberNumericUpDown)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.BooksNumberNumericUpDown)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown NumberOfCardSlotsnumericUpDown;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox prefixTextBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown PageNumberNumericUpDown;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.NumericUpDown SlotsNumberNumericUpDown;
private System.Windows.Forms.Button startButton;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox lastAddedTextBox;
private System.Windows.Forms.NumericUpDown BooksNumberNumericUpDown;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox readersComboBox1;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Timer timer1;
}
}
\ No newline at end of file
using BarcodeScannerClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Web.Script.Serialization;
using System.Windows.Forms;
namespace CardDisplay
{
public partial class AddCardMetaData : Form
{
public AddCardMetaData()
{
InitializeComponent();
}
string statePrinted = "PRINTED";
string apiUrl = "";
string readerApiUrl = "http://vectorama.moya.fi/MoyaWeb/rest/reader/List";
bool active = false;
int slot1ReaderEventId = 0;
int bookNumber = 0;
int slotNumber = 0;
int pageNumber = 0;
private void button1_Click(object sender, EventArgs e)
{
active = !active;
BooksNumberNumericUpDown.Enabled = !active;
NumberOfCardSlotsnumericUpDown.Enabled = !active;
SlotsNumberNumericUpDown.Enabled = !active;
PageNumberNumericUpDown.Enabled = !active;
prefixTextBox.Enabled = !active;
bookNumber = (int) BooksNumberNumericUpDown.Value;
slotNumber = (int) SlotsNumberNumericUpDown.Value;
pageNumber = (int) PageNumberNumericUpDown.Value;
if (active)
startButton.Text = "Keskeytä";
else
startButton.Text = "Aloita";
}
private void AddCardMetaData_Load(object sender, EventArgs e)
{
}
string ret = "";
private void timer1_Tick(object sender, EventArgs e)
{
if (readersComboBox1.SelectedItem != null)
{
Reader reader = (Reader)readersComboBox1.SelectedItem;
HttpUtils.RestClient client = new HttpUtils.RestClient(apiUrl + "/reader/readerevents/" + reader.readerId + "/" + slot1ReaderEventId);
try
{
ret = client.MakeRequest();
var ser = new JavaScriptSerializer();
ReaderEventList events = ser.Deserialize<ReaderEventList>(ret);
foreach (ReaderEvent re in events.readerEvents)
{
client = new HttpUtils.RestClient(apiUrl + "/card/ListAll");
ret = client.MakeRequest();
CardList cards = ser.Deserialize<CardList>(ret);
cards.cards = cards.cards.OrderBy(c => c.printTime).ToList();
foreach (Card card in cards.cards)
{
if (card.state == statePrinted)
{
slot1ReaderEventId = re.readerEventId;
string key = "cardplace";
string value = "";
if(prefixTextBox.Text != "")
value = prefixTextBox.Text + ".";
value += bookNumber.ToString() + "." + pageNumber.ToString() + "." + slotNumber.ToString();
if ((slotNumber + 1) >= SlotsNumberNumericUpDown.Value)
{
slotNumber = 1;
pageNumber++;
}
else
slotNumber++;
lastAddedTextBox.Text = key + ":" + value;
break;
}
}
}
}
catch (Exception ex)
{
}
}
}
}
}
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -49,6 +49,12 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AddCardMetaData.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AddCardMetaData.Designer.cs">
<DependentUpon>AddCardMetaData.cs</DependentUpon>
</Compile>
<Compile Include="Card.cs" />
<Compile Include="CardList.cs" />
<Compile Include="Eventuser.cs" />
......@@ -65,6 +71,9 @@
<Compile Include="ReaderEventList.cs" />
<Compile Include="ReaderList.cs" />
<Compile Include="RestClient.cs" />
<EmbeddedResource Include="AddCardMetaData.resx">
<DependentUpon>AddCardMetaData.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
......@@ -89,6 +98,12 @@
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient.csproj">
<Project>{967bfefe-7b3c-4ee9-80f1-ec6903e1acb5}</Project>
<Name>BarcodeScannerClient</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
......
......@@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
......@@ -49,15 +50,18 @@
this.forwardSlot1Button = new System.Windows.Forms.Button();
this.forwardSlot2Button = new System.Windows.Forms.Button();
this.forwardSlot3Button = new System.Windows.Forms.Button();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Location = new System.Drawing.Point(12, 59);
this.pictureBox1.Location = new System.Drawing.Point(12, 96);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(159, 252);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -68,7 +72,7 @@
//
this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox2.Location = new System.Drawing.Point(177, 59);
this.pictureBox2.Location = new System.Drawing.Point(195, 96);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(159, 252);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -79,7 +83,7 @@
//
this.pictureBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox3.Location = new System.Drawing.Point(342, 59);
this.pictureBox3.Location = new System.Drawing.Point(373, 95);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(159, 252);
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
......@@ -89,7 +93,7 @@
// readersComboBox1
//
this.readersComboBox1.FormattingEnabled = true;
this.readersComboBox1.Location = new System.Drawing.Point(12, 32);
this.readersComboBox1.Location = new System.Drawing.Point(12, 68);
this.readersComboBox1.Name = "readersComboBox1";
this.readersComboBox1.Size = new System.Drawing.Size(159, 21);
this.readersComboBox1.TabIndex = 3;
......@@ -98,7 +102,7 @@
// readersComboBox2
//
this.readersComboBox2.FormattingEnabled = true;
this.readersComboBox2.Location = new System.Drawing.Point(177, 32);
this.readersComboBox2.Location = new System.Drawing.Point(194, 68);
this.readersComboBox2.Name = "readersComboBox2";
this.readersComboBox2.Size = new System.Drawing.Size(159, 21);
this.readersComboBox2.TabIndex = 4;
......@@ -107,7 +111,7 @@
// readersComboBox3
//
this.readersComboBox3.FormattingEnabled = true;
this.readersComboBox3.Location = new System.Drawing.Point(342, 32);
this.readersComboBox3.Location = new System.Drawing.Point(371, 68);
this.readersComboBox3.Name = "readersComboBox3";
this.readersComboBox3.Size = new System.Drawing.Size(159, 21);
this.readersComboBox3.TabIndex = 5;
......@@ -115,7 +119,7 @@
//
// apiUrlTextBox
//
this.apiUrlTextBox.Location = new System.Drawing.Point(59, 6);
this.apiUrlTextBox.Location = new System.Drawing.Point(56, 28);
this.apiUrlTextBox.Name = "apiUrlTextBox";
this.apiUrlTextBox.Size = new System.Drawing.Size(159, 20);
this.apiUrlTextBox.TabIndex = 6;
......@@ -124,7 +128,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Location = new System.Drawing.Point(9, 31);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 13);
this.label1.TabIndex = 7;
......@@ -133,7 +137,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(224, 9);
this.label2.Location = new System.Drawing.Point(225, 31);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(45, 13);
this.label2.TabIndex = 9;
......@@ -141,7 +145,7 @@
//
// apiKeyTextBox
//
this.apiKeyTextBox.Location = new System.Drawing.Point(275, 6);
this.apiKeyTextBox.Location = new System.Drawing.Point(276, 28);
this.apiKeyTextBox.Name = "apiKeyTextBox";
this.apiKeyTextBox.Size = new System.Drawing.Size(124, 20);
this.apiKeyTextBox.TabIndex = 8;
......@@ -169,7 +173,7 @@
// prevSlot1Button
//
this.prevSlot1Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.prevSlot1Button.Location = new System.Drawing.Point(12, 317);
this.prevSlot1Button.Location = new System.Drawing.Point(12, 360);
this.prevSlot1Button.Name = "prevSlot1Button";
this.prevSlot1Button.Size = new System.Drawing.Size(28, 23);
this.prevSlot1Button.TabIndex = 10;
......@@ -180,7 +184,7 @@
// prevSlot2Button
//
this.prevSlot2Button.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.prevSlot2Button.Location = new System.Drawing.Point(177, 317);
this.prevSlot2Button.Location = new System.Drawing.Point(195, 360);
this.prevSlot2Button.Name = "prevSlot2Button";
this.prevSlot2Button.Size = new System.Drawing.Size(28, 23);
this.prevSlot2Button.TabIndex = 11;
......@@ -191,7 +195,7 @@
// prevSlot3Button
//
this.prevSlot3Button.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.prevSlot3Button.Location = new System.Drawing.Point(342, 318);
this.prevSlot3Button.Location = new System.Drawing.Point(360, 361);
this.prevSlot3Button.Name = "prevSlot3Button";
this.prevSlot3Button.Size = new System.Drawing.Size(28, 23);
this.prevSlot3Button.TabIndex = 12;
......@@ -202,7 +206,7 @@
// forwardSlot1Button
//
this.forwardSlot1Button.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.forwardSlot1Button.Location = new System.Drawing.Point(143, 317);
this.forwardSlot1Button.Location = new System.Drawing.Point(161, 360);
this.forwardSlot1Button.Name = "forwardSlot1Button";
this.forwardSlot1Button.Size = new System.Drawing.Size(28, 23);
this.forwardSlot1Button.TabIndex = 13;
......@@ -213,7 +217,7 @@
// forwardSlot2Button
//
this.forwardSlot2Button.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
this.forwardSlot2Button.Location = new System.Drawing.Point(308, 318);
this.forwardSlot2Button.Location = new System.Drawing.Point(326, 361);
this.forwardSlot2Button.Name = "forwardSlot2Button";
this.forwardSlot2Button.Size = new System.Drawing.Size(28, 23);
this.forwardSlot2Button.TabIndex = 14;
......@@ -224,7 +228,7 @@
// forwardSlot3Button
//
this.forwardSlot3Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.forwardSlot3Button.Location = new System.Drawing.Point(473, 317);
this.forwardSlot3Button.Location = new System.Drawing.Point(509, 360);
this.forwardSlot3Button.Name = "forwardSlot3Button";
this.forwardSlot3Button.Size = new System.Drawing.Size(28, 23);
this.forwardSlot3Button.TabIndex = 15;
......@@ -232,11 +236,32 @@
this.forwardSlot3Button.UseVisualStyleBackColor = true;
this.forwardSlot3Button.Click += new System.EventHandler(this.forwardSlot3Button_Click);
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(544, 25);
this.toolStrip1.TabIndex = 16;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
this.toolStripButton1.Text = "Syötä korttidataa";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(508, 345);
this.ClientSize = new System.Drawing.Size(544, 388);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.forwardSlot3Button);
this.Controls.Add(this.forwardSlot2Button);
this.Controls.Add(this.forwardSlot1Button);
......@@ -261,6 +286,8 @@
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -288,6 +315,8 @@
private System.Windows.Forms.Button forwardSlot1Button;
private System.Windows.Forms.Button forwardSlot2Button;
private System.Windows.Forms.Button forwardSlot3Button;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
}
}
......@@ -91,13 +91,17 @@ namespace CardDisplay
int newWidth = Convert.ToInt32(Convert.ToDouble(this.Width - spaces) / Xfactor);
pictureBox1.Size = new System.Drawing.Size(newWidth, Convert.ToInt32(newWidth * ratio));
prevSlot1Button.Left = pictureBox1.Left;
prevSlot1Button.Top = pictureBox1.Top + pictureBox1.Size.Height + 5;
readersComboBox1.Size = new System.Drawing.Size(newWidth, 21);
forwardSlot1Button.Top = pictureBox1.Top + pictureBox1.Size.Height + 5;
forwardSlot1Button.Left = pictureBox1.Size.Width + pictureBox1.Left - forwardSlot1Button.Size.Width;
pictureBox2.Size = new System.Drawing.Size(newWidth, Convert.ToInt32(newWidth * ratio));
pictureBox2.Location = new Point(pictureBox1.Size.Width + 18, 59);
pictureBox2.Location = new Point(pictureBox1.Size.Width + 18, pictureBox1.Location.Y);
prevSlot2Button.Left = pictureBox2.Left;
prevSlot2Button.Top = pictureBox2.Top + pictureBox2.Size.Height + 5;
......@@ -108,7 +112,7 @@ namespace CardDisplay
readersComboBox2.Location = new Point(pictureBox2.Location.X, readersComboBox2.Location.Y);
pictureBox3.Size = new System.Drawing.Size(newWidth, Convert.ToInt32(newWidth * ratio));
pictureBox3.Location = new Point(pictureBox1.Size.Width * 2 + 25, 59);
pictureBox3.Location = new Point(pictureBox1.Size.Width * 2 + 25, pictureBox1.Location.Y);
prevSlot3Button.Left = pictureBox3.Left;
prevSlot3Button.Top = pictureBox3.Top + pictureBox3.Size.Height + 5;
......@@ -327,5 +331,10 @@ namespace CardDisplay
}
}
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
}
}
}
......@@ -129,4 +129,25 @@
<metadata name="slot3Timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>322, 17</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>431, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAKaSURBVDhPzdBrT9JhGAZwvkmv2+pFa5mzwyapNTVTV5PR
qDCmeWCimDNBm8ecOGAp2Fylg6ZiOcXN5UwlJgrTTHChTBJICwKZqKAph+fqL3/rK9S1Pbu3+8XvvvYw
/p+Ieuwx+dC3WJvGZa5XOS6erOORqGxMqWbdLh2wxsrln3CypvNYaZ6o6jJD3LuG4/hDhGiN20Q56vJL
1YYr0oHVyTnbL7LmAaaWDiBW6NHU0Qc2v5WGKuQmjcHihlCxFAc0+i281W/C6gqRyo7ZyKjBRYJhwL0D
WDdiKJHoAG4BxBeYNCCQGSeNX9zgS2fiwN4R4PoZQtubFXBqBuEORECoHMYI2fADApkJ44I6pCRnnQDS
2RnLmheFzeNxoH/aiy6tEyuufTwQ9WF5fQeK4Q0EKfi4RVHrFPTGRSSl5tIAX/LR/PV7APfFg4hQQIx6
Ds8BaroWkCd8Derj4NsLkzDVwhcEHj4dQUV1AxL/NChp+2Df9O6CXa1GNN4BsLujMK34kVMsh5GaTWoH
DDaCnUPg3hMVIoQBYW0qDRS1jLkDoTDYld0IUYKXurLsPMSQ7gfS81sgejGPhVUvHN59+IIErHIlut9V
ITkjmwbYwm7nNgXcKevEZ2cY05YQJuZ96BlZxg1uI2TqOWh1VvS/t0A2YEJucTtOudy4zK+mAVa5wuPd
PQJP/BK3eI1IuFkKJksEtlCFZFYNOBVKZBe0II1Ti4TMUiRl85HWO4yreTwSB/LKOo+iBPAEwpixbGHM
4ERn7wSqml/h3PVCsItqUdeuglo7h1GdBYs2D1RaE3J4ErrBbb40eFeojLAEz0k6t4FkcOtJYlYZzqc/
wtlrXJy+wsEZZj5JyOSTSzmVJIUlimZxn4X/Av84DMZvXl38icQDkbIAAAAASUVORK5CYII=
</value>
</data>
</root>
\ No newline at end of file
......@@ -16,25 +16,25 @@ namespace HttpUtils
public class RestClient
{
public string EndPoint { get; set; }
public HttpVerb Method { get; set; }
public BarcodeHttpVerb Method { get; set; }
public string ContentType { get; set; }
public string PostData { get; set; }
public RestClient()
{
EndPoint = "";
Method = HttpVerb.GET;
Method = BarcodeHttpVerb.GET;
ContentType = "application/json";
PostData = "";
}
public RestClient(string endpoint)
{
EndPoint = endpoint;
Method = HttpVerb.GET;
Method = BarcodeHttpVerb.GET;
ContentType = "application/json";
PostData = "";
}
public RestClient(string endpoint, HttpVerb method)
public RestClient(string endpoint, BarcodeHttpVerb method)
{
EndPoint = endpoint;
Method = method;
......@@ -42,7 +42,7 @@ namespace HttpUtils
PostData = "";
}
public RestClient(string endpoint, HttpVerb method, string postData)
public RestClient(string endpoint, BarcodeHttpVerb method, string postData)
{
EndPoint = endpoint;
Method = method;
......@@ -64,7 +64,7 @@ namespace HttpUtils
request.ContentLength = 0;
request.ContentType = ContentType;
if (!string.IsNullOrEmpty(PostData) && Method == HttpVerb.POST)
if (!string.IsNullOrEmpty(PostData) && Method == BarcodeHttpVerb.POST)
{
var encoding = new UTF8Encoding();
var bytes = Encoding.GetEncoding("iso-8859-1").GetBytes(PostData);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!