Commit 5bd9c821 by Liv Haapala

Updates to MoyaSignup and MoyaAdminUI. Added a new project QrScanner

1 parent 2947ab57
Showing with 3634 additions and 199 deletions
......@@ -10,8 +10,9 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>BarcodeScannerClient</RootNamespace>
<AssemblyName>BarcodeScannerClient</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
......@@ -23,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
......@@ -32,6 +34,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdateLib">
......@@ -79,6 +82,7 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
......
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 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.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
[assembly: AssemblyVersion("1.0.7.0")]
[assembly: AssemblyFileVersion("1.0.7.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace BarcodeScannerClient.Properties
{
namespace BarcodeScannerClient.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
......@@ -22,48 +22,40 @@ namespace BarcodeScannerClient.Properties
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
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()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BarcodeScannerClient.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}
......
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18449
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
......@@ -12,7 +12,7 @@ namespace BarcodeScannerClient.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
......
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="BarcodeScannerClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="BarcodeScannerClient.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<userSettings>
<BarcodeScannerClient.Properties.Settings>
<setting name="Port" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ApiKey" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ApiURL" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ApiUser" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ApiPass" serializeAs="String">
<value />
<value/>
</setting>
<setting name="ApplicationVersion" serializeAs="String">
<value />
<value/>
</setting>
</BarcodeScannerClient.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
......@@ -22,7 +22,7 @@
Name "BarcodeScannerClient moya v1_00_06"
Name "BarcodeScannerClient moya v1_00_07"
; DO NOT CHANGE OutFile "installer_temp.exe" !!! AutoPublish requires this.
......@@ -198,7 +198,7 @@ FunctionEnd
Section "!BarcodeScannerClient moya stable v1_00_06" SecMain
Section "!BarcodeScannerClient moya stable v1_00_07" SecMain
SetShellVarContext current
......@@ -212,9 +212,9 @@ Section "!BarcodeScannerClient moya stable v1_00_06" SecMain
SetOverwrite On
File /oname=autoupdate.xml "I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\autoupdate.moya.xml"
File /oname=autoupdate.xml "C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\autoupdate.moya.xml"
File /oname=BarcodeScannerClient.exe "I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.exe"
File /oname=BarcodeScannerClient.exe "C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.exe"
File autoupdate.crt
......@@ -224,10 +224,10 @@ Section "!BarcodeScannerClient moya stable v1_00_06" SecMain
; that is referenced to the main project.
File "I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.dll"
File "C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.dll"
File "I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.pdb"
File "I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.pdb"
File "C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.pdb"
File "C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.pdb"
......@@ -315,10 +315,10 @@ Section "Uninstall"
; that is referenced to the main project.
Delete "$INSTDIR\I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.dll"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.dll"
Delete "$INSTDIR\I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.pdb"
Delete "$INSTDIR\I:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.pdb"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\BarcodeScannerClient.pdb"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\BarcodeScannerClient\BarcodeScannerClient\BarcodeScannerClient\bin\Debug\AutoUpdateLib.pdb"
......
......@@ -28,6 +28,7 @@ namespace ImageResizer
private Image _editedImage = null;
private User selectedUser;
public User SelectedUser { set { selectedUser = value; } }
private string defaultApiUrl;
public string DefaultApiUrl
......@@ -825,15 +826,58 @@ namespace ImageResizer
RefreshForm();
}
}
private void ImageResizer_Load(object sender, EventArgs e)
{
if(selectedUser != null)
{
SelectUser(selectedUser);
}
}
private List<User> croppedUsers = new List<User>();
public void SelectUser(User user)
{
if (selectedUser != user)
{
croppedUsers.Add(selectedUser);
selectedUser = user;
}
if (defaultApiUrl != null && defaultApiUrl != "")
{
try
{
RestClient client = new RestClient(DefaultApiUrl);
string json = client.MakeRequest("user/card/" + user.EventUserId);
var ser = new JavaScriptSerializer();
Card card = ser.Deserialize<Card>(json);
//string url = RestClient.GetRequestURL(defaultApiUrl, "card/GetImage/" + card.id);
if (card.state == "PENDING_VALIDATION" ||
card.state == "REJECTED")
{
selectedUser = user;
string url = RestClient.GetRequestURL(defaultApiUrl, "v2/user/" + user.UserId + "/image");
WebRequest request = WebRequest.Create(url);
using (WebResponse response = request.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
BaseImage = Image.FromStream(stream);
}
}
}
}
catch (Exception ex)
{
}
}
}
private void selectNextUser()
{
for (int i = 0; i < User.Cache.Count; i++)
......@@ -892,7 +936,7 @@ namespace ImageResizer
private void ImageResizer_Validated(object sender, EventArgs e)
{
selectNextUser();
//selectNextUser();
}
private void button1_Click(object sender, EventArgs e)
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MoyaAdminLib
{
public class ApiCredential
{
public string authname;
public DateTime created;
public bool enabled;
public string secret;
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace MoyaAdminLib
{
public class BacksideTemplate
{
public enum Types
{
Text,
Image
}
int width = 250;
int height = 398;
List<BacksideTemplateText> txtElements = new List<BacksideTemplateText>();
public List<BacksideTemplateText> TxtElements
{
get { return txtElements; }
set { value = txtElements; }
}
public Image GetImage()
{
Bitmap bitmap = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bitmap);
Rectangle rect = new Rectangle(0, 0, width, height);
g.FillRectangle(Brushes.White, rect);
foreach (BacksideTemplateText txtElement in txtElements)
{
Font font = new Font( txtElement.FontName, txtElement.FontSize);
g.DrawString(txtElement.Txt, font, Brushes.Black, txtElement.X, txtElement.Y);
}
return bitmap;
}
}
}
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
namespace MoyaAdminLib
{
public class BacksideTemplateText
{
private string name;
public string Name;
private string txt;
public string Txt
{
get { return txt; }
set { txt = value; }
}
private float x;
public float X
{
get { return x; }
set { x = value; }
}
private float y;
public float Y
{
get { return y; }
set { y = value; }
}
private string fontName;
public string FontName
{
get { return fontName; }
set { fontName = value; }
}
private float fontSize;
public float FontSize
{
get { return fontSize; }
set { fontSize = value; }
}
}
}
......@@ -21,7 +21,7 @@
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
......@@ -48,6 +48,9 @@
<ItemGroup>
<Compile Include="AlphaNumericComparer.cs" />
<Compile Include="AlphaNumericStringComparer.cs" />
<Compile Include="ApiCredential.cs" />
<Compile Include="BacksideTemplate.cs" />
<Compile Include="BacksideTemplateText.cs" />
<Compile Include="Card.cs" />
<Compile Include="CardList.cs" />
<Compile Include="ComputerPlace.cs" />
......
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 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.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
......@@ -6,6 +6,7 @@ using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Web.Script.Serialization;
namespace MoyaAdminLib
{
......@@ -203,6 +204,68 @@ namespace MoyaAdminLib
return responseString;
}
public static ApiCredential GetApiCredential(string username, string pw, string apiKey, string url)
{
var request = (HttpWebRequest)WebRequest.Create(url+"/rest/apiapp/v1/createInstance/"+apiKey);
/*
NetworkCredential credentials = new NetworkCredential();
credentials.UserName = username;
credentials.Password = pw;
CredentialCache credentialCache = new CredentialCache();
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;
credentialCache.Add(new System.Uri(url), "Basic", credentials);
request.Credentials = credentialCache;
request.PreAuthenticate = true;
*/
string encoded = System.Convert.ToBase64String(System.Text.Encoding.GetEncoding("ISO-8859-1").GetBytes(username + ":" + pw));
request.Headers.Add("Authorization", "Basic " + encoded);
request.Method = "POST";
try
{
using (var response = (HttpWebResponse)request.GetResponse())
{
var responseValue = string.Empty;
if ((int)response.StatusCode < 200 && (int)response.StatusCode >= 300)
{
var message = String.Format("Request failed. Received HTTP {0}", response.StatusCode);
throw new ApplicationException(message);
}
// grab the response
//if (response.ContentLength > 0)
//{
using (var responseStream = response.GetResponseStream())
{
if (responseStream != null)
using (var reader = new StreamReader(responseStream))
{
responseValue = reader.ReadToEnd();
}
}
//}
JavaScriptSerializer ser = new JavaScriptSerializer();
try
{
ApiCredential credential = ser.Deserialize<ApiCredential>(responseValue);
return credential;
} catch(Exception ex)
{
throw ex;
}
}
}
catch (WebException e)
{
throw e;
}
}
} // class
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminUI", "MoyaAdminUI\MoyaAdminUI.csproj", "{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}"
EndProject
......@@ -19,10 +19,9 @@ Global
{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}.Release|Any CPU.Build.0 = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.Build.0 = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.Build.0 = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.ActiveCfg = Debug|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.Build.0 = Debug|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.ActiveCfg = Release|x86
{E660FA4F-B216-46DE-B387-DDE59BBAAFE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E660FA4F-B216-46DE-B387-DDE59BBAAFE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E660FA4F-B216-46DE-B387-DDE59BBAAFE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
......
......@@ -34,22 +34,26 @@
this.ApiKeyTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.ApiUserTextBox = new System.Windows.Forms.TextBox();
this.usernameTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.ApiPassTextBox = new System.Windows.Forms.TextBox();
this.pwTextBox = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.resetApiTokenCheckBox = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// apiURLTextBox
//
this.apiURLTextBox.Location = new System.Drawing.Point(12, 25);
this.apiURLTextBox.Location = new System.Drawing.Point(6, 113);
this.apiURLTextBox.Name = "apiURLTextBox";
this.apiURLTextBox.ReadOnly = true;
this.apiURLTextBox.Size = new System.Drawing.Size(260, 20);
this.apiURLTextBox.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Location = new System.Drawing.Point(6, 97);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 13);
this.label1.TabIndex = 1;
......@@ -57,7 +61,7 @@
//
// SaveButton
//
this.SaveButton.Location = new System.Drawing.Point(197, 192);
this.SaveButton.Location = new System.Drawing.Point(226, 204);
this.SaveButton.Name = "SaveButton";
this.SaveButton.Size = new System.Drawing.Size(75, 23);
this.SaveButton.TabIndex = 2;
......@@ -67,15 +71,16 @@
//
// ApiKeyTextBox
//
this.ApiKeyTextBox.Location = new System.Drawing.Point(12, 68);
this.ApiKeyTextBox.Location = new System.Drawing.Point(6, 152);
this.ApiKeyTextBox.Name = "ApiKeyTextBox";
this.ApiKeyTextBox.ReadOnly = true;
this.ApiKeyTextBox.Size = new System.Drawing.Size(260, 20);
this.ApiKeyTextBox.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 52);
this.label2.Location = new System.Drawing.Point(6, 136);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(79, 13);
this.label2.TabIndex = 4;
......@@ -84,55 +89,79 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 91);
this.label3.Location = new System.Drawing.Point(6, 19);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 13);
this.label3.Size = new System.Drawing.Size(55, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Api User";
this.label3.Text = "Username";
//
// ApiUserTextBox
// usernameTextBox
//
this.ApiUserTextBox.Location = new System.Drawing.Point(12, 107);
this.ApiUserTextBox.Name = "ApiUserTextBox";
this.ApiUserTextBox.Size = new System.Drawing.Size(260, 20);
this.ApiUserTextBox.TabIndex = 5;
this.usernameTextBox.Location = new System.Drawing.Point(6, 35);
this.usernameTextBox.Name = "usernameTextBox";
this.usernameTextBox.ReadOnly = true;
this.usernameTextBox.Size = new System.Drawing.Size(260, 20);
this.usernameTextBox.TabIndex = 5;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 130);
this.label4.Location = new System.Drawing.Point(6, 58);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 13);
this.label4.Size = new System.Drawing.Size(53, 13);
this.label4.TabIndex = 8;
this.label4.Text = "Api Pass";
//
// ApiPassTextBox
//
this.ApiPassTextBox.Location = new System.Drawing.Point(12, 146);
this.ApiPassTextBox.Name = "ApiPassTextBox";
this.ApiPassTextBox.PasswordChar = 'ῷ';
this.ApiPassTextBox.Size = new System.Drawing.Size(260, 20);
this.ApiPassTextBox.TabIndex = 7;
this.label4.Text = "Password";
//
// pwTextBox
//
this.pwTextBox.Location = new System.Drawing.Point(6, 74);
this.pwTextBox.Name = "pwTextBox";
this.pwTextBox.PasswordChar = 'ῷ';
this.pwTextBox.ReadOnly = true;
this.pwTextBox.Size = new System.Drawing.Size(260, 20);
this.pwTextBox.TabIndex = 7;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.pwTextBox);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.usernameTextBox);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.ApiKeyTextBox);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.apiURLTextBox);
this.groupBox1.Controls.Add(this.resetApiTokenCheckBox);
this.groupBox1.Location = new System.Drawing.Point(13, 13);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(288, 185);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
//
// resetApiTokenCheckBox
//
this.resetApiTokenCheckBox.AutoSize = true;
this.resetApiTokenCheckBox.Location = new System.Drawing.Point(6, -1);
this.resetApiTokenCheckBox.Name = "resetApiTokenCheckBox";
this.resetApiTokenCheckBox.Size = new System.Drawing.Size(101, 17);
this.resetApiTokenCheckBox.TabIndex = 0;
this.resetApiTokenCheckBox.Text = "Reset api token";
this.resetApiTokenCheckBox.UseVisualStyleBackColor = true;
this.resetApiTokenCheckBox.CheckedChanged += new System.EventHandler(this.resetApiTokenCheckBox_CheckedChanged);
//
// ApiSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 227);
this.Controls.Add(this.label4);
this.Controls.Add(this.ApiPassTextBox);
this.Controls.Add(this.label3);
this.Controls.Add(this.ApiUserTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.ApiKeyTextBox);
this.ClientSize = new System.Drawing.Size(310, 235);
this.Controls.Add(this.SaveButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.apiURLTextBox);
this.Controls.Add(this.groupBox1);
this.Name = "ApiSettings";
this.Text = "ApiSettings";
this.Load += new System.EventHandler(this.ApiSettings_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
......@@ -144,8 +173,10 @@
private System.Windows.Forms.TextBox ApiKeyTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox ApiUserTextBox;
private System.Windows.Forms.TextBox usernameTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox ApiPassTextBox;
private System.Windows.Forms.TextBox pwTextBox;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.CheckBox resetApiTokenCheckBox;
}
}
\ No newline at end of file
......@@ -21,11 +21,32 @@ namespace MoyaAdminUI
private void SaveButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.ApiURL = apiURLTextBox.Text;
Properties.Settings.Default.ApiApplicationKey = ApiKeyTextBox.Text;
Properties.Settings.Default.ApiUser = ApiUserTextBox.Text;
Properties.Settings.Default.ApiPass = ApiPassTextBox.Text;
Properties.Settings.Default.Save();
ApiCredential apiCredential = null;
if (resetApiTokenCheckBox.Checked)
{
try
{
apiCredential = RestClient.GetApiCredential(usernameTextBox.Text, pwTextBox.Text, ApiKeyTextBox.Text, apiURLTextBox.Text);
}
catch (Exception ex)
{
MessageBox.Show("Failed to get api credentials: " + ex.Message);
}
if (apiCredential != null)
{
Properties.Settings.Default.ApiURL = apiURLTextBox.Text;
Properties.Settings.Default.ApiApplicationKey = ApiKeyTextBox.Text;
Properties.Settings.Default.ApiUser = apiCredential.authname;
Properties.Settings.Default.ApiPass = apiCredential.secret;
Properties.Settings.Default.ApiTokenSet = true;
Properties.Settings.Default.Save();
}
}
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
......@@ -36,10 +57,30 @@ namespace MoyaAdminUI
private void ApiSettings_Load(object sender, EventArgs e)
{
resetApiTokenCheckBox.Checked = !Properties.Settings.Default.ApiTokenSet;
apiURLTextBox.Text = Properties.Settings.Default.ApiURL;
ApiKeyTextBox.Text = Properties.Settings.Default.ApiApplicationKey;
ApiUserTextBox.Text = Properties.Settings.Default.ApiUser;
ApiPassTextBox.Text = Properties.Settings.Default.ApiPass;
//usernameTextBox.Text = Properties.Settings.Default.ApiUser;
//pwTextBox.Text = Properties.Settings.Default.ApiPass;
}
private void resetApiTokenCheckBox_CheckedChanged(object sender, EventArgs e)
{
if (!resetApiTokenCheckBox.Checked)
{
apiURLTextBox.ReadOnly = true;
usernameTextBox.ReadOnly = true;
pwTextBox.ReadOnly = true;
ApiKeyTextBox.ReadOnly = true;
}
else
{
apiURLTextBox.ReadOnly = false;
usernameTextBox.ReadOnly = false;
pwTextBox.ReadOnly = false;
ApiKeyTextBox.ReadOnly = false;
}
}
}
}
......@@ -14,19 +14,22 @@
<value>http://10.220.105.194:8080/MoyaWeb</value>
</setting>
<setting name="ApiApplicationKey" serializeAs="String">
<value/>
<value />
</setting>
<setting name="ApiUser" serializeAs="String">
<value/>
<value />
</setting>
<setting name="ApiPass" serializeAs="String">
<value/>
<value />
</setting>
<setting name="ApplicationVersion" serializeAs="String">
<value/>
<value />
</setting>
<setting name="Port" serializeAs="String">
<value/>
<value />
</setting>
<setting name="ApiTokenSet" serializeAs="String">
<value>False</value>
</setting>
</MoyaAdminUI.Properties.Settings>
</userSettings>
......
namespace MoyaAdminUI
{
partial class CSVGeneratorForItemCollectionForm
{
/// <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.moyaCsvOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
this.GoogleCsvOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
this.moyaCsvTextBox = new System.Windows.Forms.TextBox();
this.googleCsvTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.selectFileToSaveOpenFileDialog = new System.Windows.Forms.OpenFileDialog();
this.label3 = new System.Windows.Forms.Label();
this.resultTextBox = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// moyaCsvOpenFileDialog
//
this.moyaCsvOpenFileDialog.FileName = "openFileDialog1";
//
// GoogleCsvOpenFileDialog
//
this.GoogleCsvOpenFileDialog.FileName = "openFileDialog2";
//
// moyaCsvTextBox
//
this.moyaCsvTextBox.Location = new System.Drawing.Point(99, 13);
this.moyaCsvTextBox.Name = "moyaCsvTextBox";
this.moyaCsvTextBox.Size = new System.Drawing.Size(176, 20);
this.moyaCsvTextBox.TabIndex = 0;
//
// googleCsvTextBox
//
this.googleCsvTextBox.Location = new System.Drawing.Point(99, 40);
this.googleCsvTextBox.Name = "googleCsvTextBox";
this.googleCsvTextBox.Size = new System.Drawing.Size(176, 20);
this.googleCsvTextBox.TabIndex = 1;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(36, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(57, 13);
this.label1.TabIndex = 2;
this.label1.Text = "Moya CSV";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(1, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Järkkäkysely CSV";
//
// selectFileToSaveOpenFileDialog
//
this.selectFileToSaveOpenFileDialog.FileName = "openFileDialog2";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(56, 73);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(37, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Result";
//
// resultTextBox
//
this.resultTextBox.Location = new System.Drawing.Point(99, 70);
this.resultTextBox.Name = "resultTextBox";
this.resultTextBox.Size = new System.Drawing.Size(176, 20);
this.resultTextBox.TabIndex = 4;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(183, 110);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(105, 23);
this.button1.TabIndex = 6;
this.button1.Text = "Generate CSV";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// CSVGeneratorForItemCollectionForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(300, 145);
this.Controls.Add(this.button1);
this.Controls.Add(this.label3);
this.Controls.Add(this.resultTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.googleCsvTextBox);
this.Controls.Add(this.moyaCsvTextBox);
this.Name = "CSVGeneratorForItemCollectionForm";
this.Text = "CSVGeneratorForItemCollectionForm";
this.Load += new System.EventHandler(this.CSVGeneratorForItemCollectionForm_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.OpenFileDialog moyaCsvOpenFileDialog;
private System.Windows.Forms.OpenFileDialog GoogleCsvOpenFileDialog;
private System.Windows.Forms.TextBox moyaCsvTextBox;
private System.Windows.Forms.TextBox googleCsvTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.OpenFileDialog selectFileToSaveOpenFileDialog;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox resultTextBox;
private System.Windows.Forms.Button button1;
}
}
\ No newline at end of file
using Csv;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MoyaAdminUI
{
public partial class CSVGeneratorForItemCollectionForm : Form
{
public CSVGeneratorForItemCollectionForm()
{
InitializeComponent();
}
string moyaCSV;
string googleCSV;
string resultCSV;
StringWriter writer = new StringWriter();
string[] headers = new string[3];
private void CSVGeneratorForItemCollectionForm_Load(object sender, EventArgs e)
{
if(moyaCsvOpenFileDialog.ShowDialog() == DialogResult.OK)
{
moyaCSV = moyaCsvOpenFileDialog.FileName;
moyaCsvTextBox.Text = moyaCSV;
}
if (GoogleCsvOpenFileDialog.ShowDialog() == DialogResult.OK)
{
googleCSV = GoogleCsvOpenFileDialog.FileName;
googleCsvTextBox.Text = googleCSV;
}
if (selectFileToSaveOpenFileDialog.ShowDialog() == DialogResult.OK)
{
resultCSV = selectFileToSaveOpenFileDialog.FileName;
resultTextBox.Text = resultCSV;
headers[0] = "Nimi";
headers[1] = "Sähköposti";
headers[2] = "Tuotteet";
//CsvWriter.Write(writer, )
}
}
private void button1_Click(object sender, EventArgs e)
{
List<string[]> lines = new List<string[]>();
string strMoyaCsv = File.ReadAllText(moyaCSV);
string strGoogleCsv = File.ReadAllText(googleCSV);
string name = null;
string email = null;
string items = null;
string[] newLine = new string[3];
List<string> namesAddedToLines = new List<string>();
CultureInfo provider = new CultureInfo("en-US");
foreach (ICsvLine line in CsvReader.ReadFromText(strMoyaCsv))
{
string kpl = line["Kpl"];
decimal amount = decimal.Parse(kpl, NumberStyles.AllowDecimalPoint, provider);
if (name == null || name == line["Nimi"])
{
if (name == null)
{
name = line["Nimi"];
email = line["Sähköposti"];
}
if (items != null)
items += "; ";
items += amount.ToString("N0") +"x"+ line["Tuote"];
} else if(name != null && name != line["Nimi"])
{
bool found = false;
foreach (ICsvLine line2 in CsvReader.ReadFromText(strGoogleCsv))
{
if (line2["Nimi"].ToLower() == name.ToLower() ||
line2["Email Address"].ToLower() == email.ToLower())
{
found = true;
if (items != null)
items += "; ";
items += "1xOrg t-paita, ";
if (line2["Järkkäpaita naistenmallina"] == "Ladyfit")
items += "Naisten malli, ";
else
items += "Miesten malli, ";
items += line2["Järkkäpaidan koko"];
}
}
if(!found)
{
Debug.WriteLine("Didn't find person '" + name + "' in Järkkäkysely Csv.");
}
if (name != null)
newLine[0] = name;
else
{
Debug.WriteLine("Name is null!");
newLine[0] = "";
}
if (email != null)
newLine[1] = email;
else
{
newLine[1] = "";
Debug.WriteLine("Email is null!");
}
if (items != null)
newLine[2] = items;
else
{
newLine[2] = "";
Debug.WriteLine("Items is null!");
}
if(newLine != null)
lines.Add(newLine);
if(!namesAddedToLines.Contains(name))
namesAddedToLines.Add(name);
newLine = new string[3];
name = line["Nimi"];
email = line["Sähköposti"];
items = amount.ToString("N0") + "x" + line["Tuote"];
}
}
foreach (ICsvLine line2 in CsvReader.ReadFromText(strGoogleCsv))
{
if(!namesAddedToLines.Contains(line2["Nimi"]) )
{
newLine = new string[3];
if (line2["Nimi"] != null)
newLine[0] = line2["Nimi"];
else
{
newLine[0] = "";
Debug.WriteLine("Nimi is null!");
}
if (line2["Email Address"] != null)
newLine[1] = line2["Email Address"];
else
newLine[1] = "";
string item = "1xOrg t-paita, ";
if (line2["Järkkäpaita naistenmallina"] == "Ladyfit")
item += "Naisten malli, ";
else
item += "Miesten malli, ";
item += line2["Järkkäpaidan koko"];
if (item != null)
newLine[2] = item;
else
newLine[2] = "";
if(newLine != null)
lines.Add(newLine);
}
}
writer = new StringWriter();
CsvWriter.Write(writer, headers, lines.ToArray(), ':');
string result = writer.ToString();
File.WriteAllText(resultCSV, result);
}
}
}
<?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="moyaCsvOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="GoogleCsvOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>201, 17</value>
</metadata>
<metadata name="selectFileToSaveOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>395, 17</value>
</metadata>
</root>
\ No newline at end of file
namespace MoyaAdminUI
{
partial class CardTemplateUserControl
{
/// <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 Component 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.cardPictureBox = new System.Windows.Forms.PictureBox();
((System.ComponentModel.ISupportInitialize)(this.cardPictureBox)).BeginInit();
this.SuspendLayout();
//
// cardPictureBox
//
this.cardPictureBox.Location = new System.Drawing.Point(3, 3);
this.cardPictureBox.Name = "cardPictureBox";
this.cardPictureBox.Size = new System.Drawing.Size(250, 398);
this.cardPictureBox.TabIndex = 0;
this.cardPictureBox.TabStop = false;
//
// CardTemplateUserControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.cardPictureBox);
this.Name = "CardTemplateUserControl";
this.Size = new System.Drawing.Size(257, 406);
((System.ComponentModel.ISupportInitialize)(this.cardPictureBox)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox cardPictureBox;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MoyaAdminUI
{
public partial class CardTemplateUserControl : UserControl
{
public CardTemplateUserControl()
{
InitializeComponent();
}
}
}
<?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="cardPictureBox.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
\ No newline at end of file
namespace MoyaAdminUI
{
partial class ComputerPlaceNameReplaceForm
{
/// <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.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.findTextBox = new System.Windows.Forms.TextBox();
this.replaceTextBox = new System.Windows.Forms.TextBox();
this.replaceButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 35);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(27, 13);
this.label1.TabIndex = 0;
this.label1.Text = "Find";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 63);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(69, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Replace with";
//
// findTextBox
//
this.findTextBox.Location = new System.Drawing.Point(88, 32);
this.findTextBox.Name = "findTextBox";
this.findTextBox.Size = new System.Drawing.Size(223, 20);
this.findTextBox.TabIndex = 2;
//
// replaceTextBox
//
this.replaceTextBox.Location = new System.Drawing.Point(88, 60);
this.replaceTextBox.Name = "replaceTextBox";
this.replaceTextBox.Size = new System.Drawing.Size(223, 20);
this.replaceTextBox.TabIndex = 3;
//
// replaceButton
//
this.replaceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.replaceButton.Location = new System.Drawing.Point(236, 102);
this.replaceButton.Name = "replaceButton";
this.replaceButton.Size = new System.Drawing.Size(75, 23);
this.replaceButton.TabIndex = 4;
this.replaceButton.Text = "Replace all";
this.replaceButton.UseVisualStyleBackColor = true;
this.replaceButton.Click += new System.EventHandler(this.replaceButton_Click);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Location = new System.Drawing.Point(155, 102);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// ComputerPlaceNameReplaceForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(323, 137);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.replaceButton);
this.Controls.Add(this.replaceTextBox);
this.Controls.Add(this.findTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "ComputerPlaceNameReplaceForm";
this.Text = "ComputerPlaceNameReplaceForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox findTextBox;
private System.Windows.Forms.TextBox replaceTextBox;
private System.Windows.Forms.Button replaceButton;
private System.Windows.Forms.Button cancelButton;
}
}
\ No newline at end of file
using MoyaAdminLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MoyaAdminUI
{
public partial class ComputerPlaceNameReplaceForm : Form
{
public ComputerPlaceNameReplaceForm()
{
InitializeComponent();
//this.places = places;
}
/*
private List<ComputerPlace> places;
public List<ComputerPlace> Places
{
get { return places; }
set { places = value; }
}*/
private string oldText = "";
public string OldText
{
get { return oldText; }
set { oldText = value; }
}
private string newText = "";
public string NewText
{
get { return newText; }
set { newText = value; }
}
private void cancelButton_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void replaceButton_Click(object sender, EventArgs e)
{
oldText = findTextBox.Text;
newText = replaceTextBox.Text;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}
<?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>
</root>
\ No newline at end of file
using System;
using MoyaAdminLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
......@@ -26,6 +27,12 @@ namespace MoyaAdminUI
set { defaultApiUrl = value; }
}
private User selectedUser;
public User SelectedUser
{
set { selectedUser = value; }
}
public ImageCropForm()
{
InitializeComponent();
......@@ -37,6 +44,11 @@ namespace MoyaAdminUI
{
imageResizer1.CroppedImageRatio = croppedImageRatio;
imageResizer1.DefaultApiUrl = defaultApiUrl;
if (selectedUser != null)
{
imageResizer1.SelectedUser = selectedUser;
imageResizer1.SelectUser(selectedUser);
}
}
}
}
namespace MoyaAdminUI
{
partial class ListUsersForm
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ListUsersForm));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.usersListView = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// 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(852, 25);
this.toolStrip1.TabIndex = 1;
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 = "Export to CSV";
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
//
// usersListView
//
this.usersListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4,
this.columnHeader5});
this.usersListView.Dock = System.Windows.Forms.DockStyle.Fill;
this.usersListView.FullRowSelect = true;
this.usersListView.Location = new System.Drawing.Point(0, 25);
this.usersListView.Name = "usersListView";
this.usersListView.Size = new System.Drawing.Size(852, 473);
this.usersListView.TabIndex = 2;
this.usersListView.UseCompatibleStateImageBehavior = false;
this.usersListView.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "Nick";
this.columnHeader1.Width = 118;
//
// columnHeader2
//
this.columnHeader2.Text = "Firstname";
this.columnHeader2.Width = 112;
//
// columnHeader3
//
this.columnHeader3.Text = "Lastname";
this.columnHeader3.Width = 150;
//
// columnHeader4
//
this.columnHeader4.Text = "Login";
this.columnHeader4.Width = 93;
//
// columnHeader5
//
this.columnHeader5.Text = "Email";
this.columnHeader5.Width = 178;
//
// ListUsersForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(852, 498);
this.Controls.Add(this.usersListView);
this.Controls.Add(this.toolStrip1);
this.Name = "ListUsersForm";
this.Text = "ListUsersForm";
this.Load += new System.EventHandler(this.ListUsersForm_Load);
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1;
private System.Windows.Forms.ListView usersListView;
private System.Windows.Forms.ColumnHeader columnHeader1;
private System.Windows.Forms.ColumnHeader columnHeader2;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
}
}
\ No newline at end of file
using MoyaAdminLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MoyaAdminUI
{
public partial class ListUsersForm : Form
{
private List<User> users;
public List<User> Users
{
get { return users; }
set { users = value; }
}
public ListUsersForm()
{
InitializeComponent();
}
private void loadUsers()
{
foreach(User user in users)
{
ListViewItem item = new ListViewItem(user.Nick);
item.SubItems.Add(user.Firstname);
item.SubItems.Add(user.Lastname);
item.SubItems.Add(user.Login);
item.SubItems.Add(user.Email);
usersListView.Items.Add(item);
}
}
private void ListUsersForm_Load(object sender, EventArgs e)
{
loadUsers();
}
/// <summary>
/// Export to CSV. Asks for file path by dialog.
/// </summary>
/// <param name="onlySelected">Only export SELECTED rows</param>
/// <param name="onlyChecked">Only export CHECKED rows</param>
/// <returns></returns>
public List<object> ExportToCSV(bool onlySelected, bool onlyChecked, string filename)
{
OpenFileDialog ofd = new OpenFileDialog();
if (filename != null)
ofd.FileName = filename;
ofd.Filter = "CSV-taulukot|*.csv";
ofd.CheckFileExists = false;
ofd.Title = "Mihin taukkoon listalla näkyvät rivit viedään...";
DialogResult dr = ofd.ShowDialog(this);
if (dr == DialogResult.Cancel)
return null;
List<object> objects = new List<object>();
StreamWriter sw = null;
try
{
sw = new StreamWriter(ofd.FileName);
for (int k = 0; k < usersListView.Columns.Count; k++)
{
ColumnHeader ch = usersListView.Columns[k];
if (k > 0)
sw.Write(";");
sw.Write(ch.Text.Replace(";", ""));
}
sw.WriteLine("");
for (int row = 0; row < usersListView.Items.Count; row++)
{
ListViewItem lvi = usersListView.Items[row];
if (onlyChecked && (!lvi.Checked))
continue;
if (onlySelected && (!lvi.Selected))
continue;
objects.Add(lvi.Tag);
for (int col = 0; col < usersListView.Columns.Count; col++)
{
if (col == 0)
{
sw.Write(lvi.Text.Replace(";", "").Replace("\r", "\\r").Replace("\r\n", ","));
}
else
{
sw.Write(";" + lvi.SubItems[col].Text.Replace(";", "").Replace("\r\n", ","));
}
}
sw.WriteLine("");
}
sw.Close();
if (MessageBox.Show(this, "Tiedot viety CSV-tiedostoon onnistuneesti. Haluatko avata tiedoston?", "Tiedot viety", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
{
try
{
Process.Start(ofd.FileName);
}
catch (Exception ex)
{
MessageBox.Show(this, "Ei voitu käynnistää ohjelmaa " + ofd.FileName + " :\r\n" + ex.ToString(), "Tiedoston avaus ei onnistunut", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
catch (Exception ex)
{
MessageBox.Show(this, "Ei voitu viedä tietoja CSV-tiedostoon:\r\n" + ex.ToString(), "Virhe tietojen viennissä", MessageBoxButtons.OK, MessageBoxIcon.Error);
return null;
}
finally
{
if (sw != null)
{
try
{
sw.Close();
}
catch
{
}
}
}
return objects;
}
private void toolStripButton1_Click(object sender, EventArgs e)
{
ExportToCSV(false, false, "unmapped-users-export");
}
}
}
<?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="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 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
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
</root>
\ No newline at end of file
......@@ -32,6 +32,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.placesContextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.printPlaceStickersForSelectedPlacesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.doAReplaceForComputerPlaceNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.MapPictureBox = new System.Windows.Forms.PictureBox();
this.placeEditor = new System.Windows.Forms.PropertyGrid();
this.PlacesListView = new System.Windows.Forms.ListView();
......@@ -53,6 +54,8 @@
this.orgMealToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.cropImageToolStripButton = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.generateBacksidesToolStripButton = new System.Windows.Forms.ToolStripButton();
this.TopPanel = new System.Windows.Forms.Panel();
this.allPlacesCountTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
......@@ -68,6 +71,7 @@
this.ImageRefreshTimer = new System.Windows.Forms.Timer(this.components);
this.panel2 = new System.Windows.Forms.Panel();
this.placesCountTimer = new System.Windows.Forms.Timer(this.components);
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.placesContextMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.MapPictureBox)).BeginInit();
this.toolStrip1.SuspendLayout();
......@@ -79,18 +83,26 @@
// placesContextMenuStrip
//
this.placesContextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.printPlaceStickersForSelectedPlacesToolStripMenuItem});
this.printPlaceStickersForSelectedPlacesToolStripMenuItem,
this.doAReplaceForComputerPlaceNameToolStripMenuItem});
this.placesContextMenuStrip.Name = "placesContextMenuStrip";
this.placesContextMenuStrip.Size = new System.Drawing.Size(273, 26);
this.placesContextMenuStrip.Size = new System.Drawing.Size(277, 48);
this.placesContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.placesContextMenuStrip_Opening);
//
// printPlaceStickersForSelectedPlacesToolStripMenuItem
//
this.printPlaceStickersForSelectedPlacesToolStripMenuItem.Name = "printPlaceStickersForSelectedPlacesToolStripMenuItem";
this.printPlaceStickersForSelectedPlacesToolStripMenuItem.Size = new System.Drawing.Size(272, 22);
this.printPlaceStickersForSelectedPlacesToolStripMenuItem.Size = new System.Drawing.Size(276, 22);
this.printPlaceStickersForSelectedPlacesToolStripMenuItem.Text = "Print place stickers for selected places";
this.printPlaceStickersForSelectedPlacesToolStripMenuItem.Click += new System.EventHandler(this.printPlaceStickersForSelectedPlacesToolStripMenuItem_Click);
//
// doAReplaceForComputerPlaceNameToolStripMenuItem
//
this.doAReplaceForComputerPlaceNameToolStripMenuItem.Name = "doAReplaceForComputerPlaceNameToolStripMenuItem";
this.doAReplaceForComputerPlaceNameToolStripMenuItem.Size = new System.Drawing.Size(276, 22);
this.doAReplaceForComputerPlaceNameToolStripMenuItem.Text = "Do a replace for computer place name";
this.doAReplaceForComputerPlaceNameToolStripMenuItem.Click += new System.EventHandler(this.doAReplaceForComputerPlaceNameToolStripMenuItem_Click);
//
// MapPictureBox
//
this.MapPictureBox.Cursor = System.Windows.Forms.Cursors.Default;
......@@ -176,7 +188,10 @@
this.toolStripButton1,
this.orgMealToolStripButton,
this.toolStripButton2,
this.cropImageToolStripButton});
this.cropImageToolStripButton,
this.toolStripButton3,
this.generateBacksidesToolStripButton,
this.toolStripButton4});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(1078, 25);
......@@ -313,6 +328,28 @@
this.cropImageToolStripButton.Text = "Crop Image tool";
this.cropImageToolStripButton.Click += new System.EventHandler(this.cropImageToolStripButton_Click);
//
// toolStripButton3
//
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
this.toolStripButton3.Text = "Get list of computer places that are not linked to user";
this.toolStripButton3.Visible = false;
this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click_1);
//
// generateBacksidesToolStripButton
//
this.generateBacksidesToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.generateBacksidesToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("generateBacksidesToolStripButton.Image")));
this.generateBacksidesToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.generateBacksidesToolStripButton.Name = "generateBacksidesToolStripButton";
this.generateBacksidesToolStripButton.Size = new System.Drawing.Size(23, 22);
this.generateBacksidesToolStripButton.Text = "Generate backsides for cards";
this.generateBacksidesToolStripButton.Visible = false;
this.generateBacksidesToolStripButton.Click += new System.EventHandler(this.generateBacksidesToolStripButton_Click);
//
// TopPanel
//
this.TopPanel.Controls.Add(this.allPlacesCountTextBox);
......@@ -444,6 +481,16 @@
this.placesCountTimer.Interval = 600000000;
this.placesCountTimer.Tick += new System.EventHandler(this.placesCountTimer_Tick);
//
// toolStripButton4
//
this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton4.Name = "toolStripButton4";
this.toolStripButton4.Size = new System.Drawing.Size(23, 22);
this.toolStripButton4.Text = "Generate CSV for item collection";
this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
......@@ -514,6 +561,10 @@
private System.Windows.Forms.ToolStripButton toolStripButton2;
private System.Windows.Forms.ToolStripMenuItem printPlaceStickersForSelectedPlacesToolStripMenuItem;
private System.Windows.Forms.ToolStripButton cropImageToolStripButton;
private System.Windows.Forms.ToolStripButton toolStripButton3;
private System.Windows.Forms.ToolStripMenuItem doAReplaceForComputerPlaceNameToolStripMenuItem;
private System.Windows.Forms.ToolStripButton generateBacksidesToolStripButton;
private System.Windows.Forms.ToolStripButton toolStripButton4;
}
}
......@@ -28,7 +28,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
......@@ -46,12 +46,17 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdateLib, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\AutoUpdate\src\AutoUpdateLib\bin\Debug\AutoUpdateLib.dll</HintPath>
</Reference>
<Reference Include="Csv, Version=1.0.31.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Csv.1.0.31\lib\net40\Csv.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
......@@ -64,6 +69,14 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="zxing, Version=0.16.2.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<HintPath>..\packages\ZXing.Net.0.16.2\lib\net40\zxing.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="zxing.presentation, Version=0.16.2.0, Culture=neutral, PublicKeyToken=4e88037ac681fe60, processorArchitecture=MSIL">
<HintPath>..\packages\ZXing.Net.0.16.2\lib\net40\zxing.presentation.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ApiSettings.cs">
......@@ -78,12 +91,30 @@
<Compile Include="CardLocationInput.Designer.cs">
<DependentUpon>CardLocationInput.cs</DependentUpon>
</Compile>
<Compile Include="CardTemplateUserControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CardTemplateUserControl.Designer.cs">
<DependentUpon>CardTemplateUserControl.cs</DependentUpon>
</Compile>
<Compile Include="ComputerPlaceGridSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ComputerPlaceGridSettings.designer.cs">
<DependentUpon>ComputerPlaceGridSettings.cs</DependentUpon>
</Compile>
<Compile Include="ComputerPlaceNameReplaceForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ComputerPlaceNameReplaceForm.Designer.cs">
<DependentUpon>ComputerPlaceNameReplaceForm.cs</DependentUpon>
</Compile>
<Compile Include="CSVGeneratorForItemCollectionForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="CSVGeneratorForItemCollectionForm.Designer.cs">
<DependentUpon>CSVGeneratorForItemCollectionForm.cs</DependentUpon>
</Compile>
<Compile Include="ImageCropForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -96,6 +127,12 @@
<Compile Include="IncomingForm.Designer.cs">
<DependentUpon>IncomingForm.cs</DependentUpon>
</Compile>
<Compile Include="ListUsersForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ListUsersForm.Designer.cs">
<DependentUpon>ListUsersForm.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -115,6 +152,12 @@
<Compile Include="OrgMealCounter.Designer.cs">
<DependentUpon>OrgMealCounter.cs</DependentUpon>
</Compile>
<Compile Include="PrintCardBacksidesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PrintCardBacksidesForm.Designer.cs">
<DependentUpon>PrintCardBacksidesForm.cs</DependentUpon>
</Compile>
<Compile Include="PrintPlaceStickersForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -130,6 +173,12 @@
<Compile Include="ShowCardInformation.Designer.cs">
<DependentUpon>ShowCardInformation.cs</DependentUpon>
</Compile>
<Compile Include="TxtElementEditorUserControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="TxtElementEditorUserControl.Designer.cs">
<DependentUpon>TxtElementEditorUserControl.cs</DependentUpon>
</Compile>
<Compile Include="UserInfoForm.cs">
<SubType>Form</SubType>
</Compile>
......@@ -148,15 +197,27 @@
<EmbeddedResource Include="CardLocationInput.resx">
<DependentUpon>CardLocationInput.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CardTemplateUserControl.resx">
<DependentUpon>CardTemplateUserControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ComputerPlaceGridSettings.resx">
<DependentUpon>ComputerPlaceGridSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ComputerPlaceNameReplaceForm.resx">
<DependentUpon>ComputerPlaceNameReplaceForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CSVGeneratorForItemCollectionForm.resx">
<DependentUpon>CSVGeneratorForItemCollectionForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ImageCropForm.resx">
<DependentUpon>ImageCropForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="IncomingForm.resx">
<DependentUpon>IncomingForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="ListUsersForm.resx">
<DependentUpon>ListUsersForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
......@@ -166,6 +227,9 @@
<EmbeddedResource Include="OrgMealCounter.resx">
<DependentUpon>OrgMealCounter.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PrintCardBacksidesForm.resx">
<DependentUpon>PrintCardBacksidesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PrintPlaceStickersForm.resx">
<DependentUpon>PrintPlaceStickersForm.cs</DependentUpon>
</EmbeddedResource>
......@@ -182,12 +246,16 @@
<EmbeddedResource Include="ShowCardInformation.resx">
<DependentUpon>ShowCardInformation.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TxtElementEditorUserControl.resx">
<DependentUpon>TxtElementEditorUserControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserInfoForm.resx">
<DependentUpon>UserInfoForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UsersFinderForm.resx">
<DependentUpon>UsersFinderForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......
using MoyaAdminLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZXing;
namespace MoyaAdminUI
{
public partial class PrintCardBacksidesForm : Form
{
public PrintCardBacksidesForm()
{
InitializeComponent();
}
private BacksideTemplate template;
public BacksideTemplate Template
{
get { return template; }
set { template = value; }
}
private void generateQrButton_Click(object sender, EventArgs e)
{
BarcodeWriterPixelData writer = new BarcodeWriterPixelData();
writer.Format = BarcodeFormat.QR_CODE;
ZXing.Common.EncodingOptions options = new ZXing.Common.EncodingOptions();
options.Height = 300;
options.Width = 300;
options.Margin = 10;
writer.Options = options;
ZXing.Rendering.PixelData qrdata = writer.Write(qrContentTextBox.Text);
Bitmap bitmap = new System.Drawing.Bitmap(qrdata.Width, qrdata.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
using (MemoryStream ms = new MemoryStream())
{
BitmapData bitmapData = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, qrdata.Width, qrdata.Height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format32bppRgb);
try
{
// we assume that the row stride of the bitmap is aligned to 4 byte multiplied by the width of the image
System.Runtime.InteropServices.Marshal.Copy(qrdata.Pixels, 0, bitmapData.Scan0, qrdata.Pixels.Length);
}
finally
{
bitmap.UnlockBits(bitmapData);
}
// save to stream as PNG
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
}
pictureBox1.Image = bitmap;
}
private void addElementButton_Click(object sender, EventArgs e)
{
if (templateElementTypesComboBox.SelectedItem != null)
{
if(templateElementTypesComboBox.SelectedItem is BacksideTemplate.Types)
{
BacksideTemplate.Types type = (BacksideTemplate.Types)templateElementTypesComboBox.SelectedItem;
if(type == BacksideTemplate.Types.Text)
{
BacksideTemplateText txtElement = new BacksideTemplateText();
ListViewItem lvi = new ListViewItem("New element");
lvi.SubItems.Add("Text");
lvi.Tag = txtElement;
elementsListView.Items.Add(lvi);
template.TxtElements.Add(txtElement);
}
}
}
}
private void PrintCardBacksidesForm_Load(object sender, EventArgs e)
{
templateElementTypesComboBox.Items.Add(BacksideTemplate.Types.Text);
}
private void elementsListView_SelectedIndexChanged(object sender, EventArgs e)
{
if(elementsListView.SelectedItems != null && elementsListView.SelectedItems.Count == 1 &&elementsListView.SelectedItems[0].Tag != null)
{
if(elementsListView.SelectedItems[0].Tag is BacksideTemplateText)
{
BacksideTemplateText txtElement = (BacksideTemplateText)elementsListView.SelectedItems[0].Tag;
elementEditorPanel.Controls.Clear();
TxtElementEditorUserControl txtCtrl = new TxtElementEditorUserControl();
txtCtrl.TxtElement = txtElement;
elementEditorPanel.Controls.Add(txtCtrl);
}
}
}
}
}
<?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>
</root>
\ No newline at end of file
......@@ -26,7 +26,7 @@ namespace MoyaAdminUI
private void printButton_Click(object sender, EventArgs e)
{
MessageBox.Show("Current dir: " + Directory.GetCurrentDirectory());
if (!File.Exists(placeLabel))
{
MessageBox.Show("Cannot find print template");
......@@ -51,9 +51,21 @@ namespace MoyaAdminUI
//doc.Open(Path.Combine(Properties.Settings.Default.dd, cloakroomLabel));
doc.Open(placeLabel);
doc.GetObject("place").Text = place.Name;
if(showNickCheckBox.Checked && place.User != null)
doc.GetObject("group").Text = place.User.Nick;
if (showNickCheckBox.Checked && place.User != null)
{
//doc.GetObject("group").Text = place.APIReference.
foreach(User user in User.Cache)
{
if(user.EventUserId == place.APIReference.eventuserId)
{
doc.GetObject("group").Text = user.Nick;
break;
}
}
}
else
doc.GetObject("group").Text = "";
//if(showCodeCheckBox.Checked)
......
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 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.21")]
[assembly: AssemblyFileVersion("1.0.21")]
[assembly: AssemblyVersion("1.0.28")]
[assembly: AssemblyFileVersion("1.0.28")]
......@@ -94,5 +94,17 @@ namespace MoyaAdminUI.Properties {
this["Port"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool ApiTokenSet {
get {
return ((bool)(this["ApiTokenSet"]));
}
set {
this["ApiTokenSet"] = value;
}
}
}
}
......@@ -20,5 +20,8 @@
<Setting Name="Port" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="ApiTokenSet" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MoyaAdminLib;
namespace MoyaAdminUI
{
public partial class TxtElementEditorUserControl : UserControl
{
public TxtElementEditorUserControl()
{
InitializeComponent();
}
private BacksideTemplateText txt;
public BacksideTemplateText TxtElement
{
get
{
/*
if (txt.Name != nameTextBox.Text)
txt.Name = nameTextBox.Text;
if (txt.Txt != textTextBox.Text)
txt.Txt = textTextBox.Text;
if (txt.X != xNumericUpDown.Value)
txt.X = Convert.ToInt32(xNumericUpDown.Value);
if (txt.Y != yNumericUpDown.Value)
txt.Y = Convert.ToInt32(yNumericUpDown.Value);
if (txt.FontName != fontNameTextBox.Text)
txt.FontName = fontNameTextBox.Text;
if (txt.FontSize != fontSizeNumericUpDown.Value)
txt.FontSize = fontSizeNumericUpDown.Value;*/
return txt;
}
set { txt = value; }
}
private void selectFontButton_Click(object sender, EventArgs e)
{
if(fontDialog1.ShowDialog() == DialogResult.OK)
{
fontNameTextBox.Text = fontDialog1.Font.FontFamily.Name;
fontSizeNumericUpDown.Value = Convert.ToDecimal(fontDialog1.Font.Size);
}
}
private void TxtElementEditorUserControl_Load(object sender, EventArgs e)
{
if(txt != null)
{
nameTextBox.Text = txt.Name;
textTextBox.Text = txt.Txt;
xNumericUpDown.Value = Convert.ToDecimal(txt.X);
yNumericUpDown.Value = Convert.ToDecimal(txt.Y);
fontNameTextBox.Text = txt.FontName;
fontSizeNumericUpDown.Value = Convert.ToDecimal(txt.FontSize);
}
}
private void nameTextBox_TextChanged(object sender, EventArgs e)
{
timer1.Start();
//txt.Name = nameTextBox.Text;
}
private void textTextBox_TextChanged(object sender, EventArgs e)
{
timer1.Start();
//txt.Txt = textTextBox.Text;
}
private void xNumericUpDown_ValueChanged(object sender, EventArgs e)
{
txt.X = Convert.ToInt32(xNumericUpDown.Value);
}
private void yNumericUpDown_ValueChanged(object sender, EventArgs e)
{
txt.Y = Convert.ToInt32(yNumericUpDown.Value);
}
private void fontNameTextBox_TextChanged(object sender, EventArgs e)
{
timer1.Start();
//txt.FontName = fontNameTextBox.Text;
}
private void fontSizeNumericUpDown_ValueChanged(object sender, EventArgs e)
{
txt.FontSize = Convert.ToSingle(fontSizeNumericUpDown.Value);
}
private void timer1_Tick(object sender, EventArgs e)
{
if (txt.Name != nameTextBox.Text)
txt.Name = nameTextBox.Text;
if (txt.Txt != textTextBox.Text)
txt.Txt = textTextBox.Text;
if (txt.FontName != fontNameTextBox.Text)
txt.FontName = fontNameTextBox.Text;
}
}
}
<?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="fontDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>133, 17</value>
</metadata>
</root>
\ No newline at end of file
......@@ -22,9 +22,10 @@ namespace MoyaAdminUI
set
{
propertyGrid1.SelectedObject = value;
Card card = MoyaUtils.GetByEventUserId(value.EventUserId);
try
{
Card card = MoyaUtils.GetByEventUserId(value.EventUserId);
cardPictureBox.Load(Properties.Settings.Default.ApiURL + "/dydata/usercard/" + card.id + ".png?pfdrid_c=true");
}
catch (Exception e)
......
......@@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UsersFinderForm));
this.usersListView = new System.Windows.Forms.ListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
......@@ -39,7 +40,10 @@
this.searchTimer = new System.Windows.Forms.Timer(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.CardState = new System.Windows.Forms.TextBox();
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.cropToolToolStripButton = new System.Windows.Forms.ToolStripButton();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
// usersListView
......@@ -121,11 +125,32 @@
this.CardState.Size = new System.Drawing.Size(260, 20);
this.CardState.TabIndex = 5;
//
// toolStrip1
//
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.cropToolToolStripButton});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(807, 25);
this.toolStrip1.TabIndex = 6;
this.toolStrip1.Text = "toolStrip1";
//
// cropToolToolStripButton
//
this.cropToolToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.cropToolToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cropToolToolStripButton.Image")));
this.cropToolToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
this.cropToolToolStripButton.Name = "cropToolToolStripButton";
this.cropToolToolStripButton.Size = new System.Drawing.Size(23, 22);
this.cropToolToolStripButton.Text = "Open crop tool";
this.cropToolToolStripButton.Click += new System.EventHandler(this.cropToolToolStripButton_Click);
//
// UsersFinderForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(807, 447);
this.Controls.Add(this.toolStrip1);
this.Controls.Add(this.CardState);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label1);
......@@ -135,6 +160,8 @@
this.Text = "Users Finder";
this.Load += new System.EventHandler(this.UsersFinderForm_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -152,5 +179,7 @@
private System.Windows.Forms.Timer searchTimer;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox CardState;
private System.Windows.Forms.ToolStrip toolStrip1;
private System.Windows.Forms.ToolStripButton cropToolToolStripButton;
}
}
\ No newline at end of file
......@@ -146,5 +146,18 @@ namespace MoyaAdminUI
{
}
private void cropToolToolStripButton_Click(object sender, EventArgs e)
{
if(usersListView.SelectedItems != null && usersListView.SelectedItems.Count == 1)
{
User user = (User)usersListView.SelectedItems[0].Tag;
ImageCropForm frm = new ImageCropForm();
frm.SelectedUser = user;
frm.CroppedImageRatio = 1.3675M;
frm.DefaultApiUrl = Properties.Settings.Default.ApiURL;
frm.Show();
}
}
}
}
......@@ -120,4 +120,23 @@
<metadata name="searchTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>134, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="cropToolToolStripButton.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
</value>
</data>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Csv" version="1.0.31" targetFramework="net40" />
<package id="ZXing.Net" version="0.16.2" targetFramework="net40" />
</packages>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<AutoPublishSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<UploadUser>f-solu-06</UploadUser>
<UploadPath>/home/f-solu-06/software.f-solutions.fi</UploadPath>
<UploadHost>software.f-solutions.fi</UploadHost>
<UploadHost>www4.f-solutions.fi</UploadHost>
<ProjectName>MoyaAdminUI</ProjectName>
<Customers>
<Customer>
......
......@@ -22,7 +22,7 @@
Name "MoyaAdminUI moya v1_00_21"
Name "MoyaAdminUI moya v1_00_28"
; DO NOT CHANGE OutFile "installer_temp.exe" !!! AutoPublish requires this.
......@@ -198,7 +198,7 @@ FunctionEnd
Section "!MoyaAdminUI moya stable v1_00_21" SecMain
Section "!MoyaAdminUI moya stable v1_00_28" SecMain
SetShellVarContext current
......@@ -226,12 +226,14 @@ Section "!MoyaAdminUI moya stable v1_00_21" SecMain
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\MoyaAdminLib.dll"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\ImageResizer.dll"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\zxing.dll"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\Interop.bpac.dll"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\AutoUpdateLib.dll"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\MoyaAdminUI.pdb"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\MoyaAdminLib.pdb"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\ImageResizer.pdb"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\zxing.pdb"
File "C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\AutoUpdateLib.pdb"
......@@ -322,12 +324,14 @@ Section "Uninstall"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\MoyaAdminLib.dll"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\ImageResizer.dll"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\zxing.dll"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\Interop.bpac.dll"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\AutoUpdateLib.dll"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\MoyaAdminUI.pdb"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\MoyaAdminLib.pdb"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\ImageResizer.pdb"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\zxing.pdb"
Delete "$INSTDIR\C:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminUI\bin\Debug\AutoUpdateLib.pdb"
......
using MoyaAdminLib;
using DirectShowLib;
using MoyaAdminLib;
using MoyaAdminUI.MoyaAPI;
using MoyaSignup.Dataclasses;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.IO.Ports;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Touchless.Vision.Camera;
//using Touchless.Vision.Camera;
namespace MoyaSignup
{
......@@ -23,59 +26,118 @@ namespace MoyaSignup
InitializeComponent();
}
private List<DsDeviceContainer> webCams = new List<DsDeviceContainer>();
public List<DsDeviceContainer> Webcams
{
get { return webCams; }
set { webCams = value; }
}
private void SaveButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.ApiURL = apiURLTextBox.Text;
Properties.Settings.Default.ApiApplicationKey = ApiKeyTextBox.Text;
Properties.Settings.Default.ApiUser = ApiUserTextBox.Text;
Properties.Settings.Default.ApiPass = ApiPassTextBox.Text;
ApiCredential apiCredential = null;
if(printerModelComboBox.SelectedItem != null)
if (resetApiTokenCheckBox.Checked)
{
Properties.Settings.Default.ThermoPrinter = (int) printerModelComboBox.SelectedItem;
try
{
apiCredential = RestClient.GetApiCredential(usernameTextBox.Text, pwTextBox.Text, ApiKeyTextBox.Text, apiURLTextBox.Text);
}
catch (Exception ex)
{
MessageBox.Show("Failed to get api credentials: " + ex.Message);
}
if (apiCredential != null)
{
Properties.Settings.Default.ApiURL = apiURLTextBox.Text;
Properties.Settings.Default.ApiApplicationKey = ApiKeyTextBox.Text;
Properties.Settings.Default.ApiUser = apiCredential.authname;
Properties.Settings.Default.ApiPass = apiCredential.secret;
Properties.Settings.Default.ApiTokenSet = true;
}
}
if(printerPortComboBox.SelectedItem != null)
if (usbRadioButton.Checked)
{
string comPort = (string)this.printerPortComboBox.SelectedItem;
Debug.WriteLine("[ApiSettings] Selected modemport is '" + comPort + "'");
foreach (string p in SerialPort.GetPortNames())
if (printerNameComboBox.SelectedItem != null)
{
if (comPort == p || comPort.Contains("(" + p + ")"))
Properties.Settings.Default.PrinterTypeSelected = 0;
Properties.Settings.Default.ReceiptPrinterName = (string)printerNameComboBox.SelectedItem;
}
}
else
{
if (printerModelComboBox.SelectedItem != null)
{
Properties.Settings.Default.PrinterTypeSelected = 1;
Properties.Settings.Default.ThermoPrinter = (int)printerModelComboBox.SelectedItem;
}
if (printerPortComboBox.SelectedItem != null)
{
string comPort = (string)this.printerPortComboBox.SelectedItem;
Debug.WriteLine("[ApiSettings] Selected modemport is '" + comPort + "'");
foreach (string p in SerialPort.GetPortNames())
{
Debug.WriteLine("[ApiSettings] Setting modemport to '" + p + "'");
Properties.Settings.Default.printerPort = p;
break;
if (comPort == p || comPort.Contains("(" + p + ")"))
{
Debug.WriteLine("[ApiSettings] Setting modemport to '" + p + "'");
Properties.Settings.Default.printerPort = p;
break;
}
}
}
}
if(webCamComboBox.SelectedItem != null)
foreach(DsDeviceContainer webCamContainer in webcamsCheckedListBox.CheckedItems)
{
Properties.Settings.Default.Camera = (string)webCamComboBox.SelectedItem;
webCams.Add(webCamContainer);
}
Properties.Settings.Default.Save();
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
RestClient.ApiUser = Properties.Settings.Default.ApiUser;
RestClient.ApiURL = Properties.Settings.Default.ApiURL;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
private void ApiSettings_Load(object sender, EventArgs e)
{
if(Properties.Settings.Default.ApiTokenSet)
{
resetApiTokenCheckBox.Checked = false;
} else
{
resetApiTokenCheckBox.Checked = true;
}
apiURLTextBox.Text = Properties.Settings.Default.ApiURL;
ApiKeyTextBox.Text = Properties.Settings.Default.ApiApplicationKey;
ApiUserTextBox.Text = Properties.Settings.Default.ApiUser;
ApiPassTextBox.Text = Properties.Settings.Default.ApiPass;
//usernameTextBox.Text = Properties.Settings.Default.ApiUser;
//pwTextBox.Text = Properties.Settings.Default.ApiPass;
printerModelComboBox.Items.Add(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
printerModelComboBox.Items.Add(ThermoPrinterLibrary.ThermoPrinter.Models.TMT188II);
printerPortComboBox.Items.Clear();
foreach(string printer in System.Drawing.Printing.PrinterSettings.InstalledPrinters)
{
printerNameComboBox.Items.Add(printer);
if (printer == Properties.Settings.Default.ReceiptPrinterName)
printerNameComboBox.SelectedItem = printer;
}
if (Properties.Settings.Default.PrinterTypeSelected == 0)
usbRadioButton.Checked = true;
else if (Properties.Settings.Default.PrinterTypeSelected == 1)
serialRadioButton.Checked = true;
try
{
using (var searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity"))
......@@ -118,10 +180,59 @@ namespace MoyaSignup
}
}
}
DsDevice[] captureDevices = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice);
int i = 0;
for (i = 0; i < captureDevices.Length; i++)
{
DsDeviceContainer device = new DsDeviceContainer();
device.Device = captureDevices[i];
device.Idx = i;
int idx = webcamsCheckedListBox.Items.Add(device);
if (captureDevices[i].Name.Contains("720p"))
webcamsCheckedListBox.SetItemChecked(idx, true);
}
textBox1.Text += "\r\n" + Path.Combine(Program.AppDataPath, "debug.log");
}
private void resetApiTokenCheckBox_CheckedChanged(object sender, EventArgs e)
{
if(!resetApiTokenCheckBox.Checked)
{
apiURLTextBox.ReadOnly = true;
usernameTextBox.ReadOnly = true;
pwTextBox.ReadOnly = true;
ApiKeyTextBox.ReadOnly = true;
} else
{
apiURLTextBox.ReadOnly = false;
usernameTextBox.ReadOnly = false;
pwTextBox.ReadOnly = false;
ApiKeyTextBox.ReadOnly = false;
}
}
private void usbRadioButton_CheckedChanged(object sender, EventArgs e)
{
if(usbRadioButton.Checked)
{
serialRadioButton.Checked = false;
printerModelComboBox.Enabled = false;
printerPortComboBox.Enabled = false;
printerNameComboBox.Enabled = true;
}
}
foreach(Camera cam in CameraService.AvailableCameras)
private void serialRadioButton_CheckedChanged(object sender, EventArgs e)
{
if(serialRadioButton.Checked)
{
webCamComboBox.Items.Add(cam.Name);
usbRadioButton.Checked = false;
printerNameComboBox.Enabled = false;
printerModelComboBox.Enabled = true;
printerPortComboBox.Enabled = true;
}
}
}
......
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("ThermalDotNet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("oryx")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A186A64A-2BBD-4CF2-9101-B8B53BAB4987}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>ThermalDotNet</RootNamespace>
<AssemblyName>ThermalDotNet</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<GenerateDocumentation>true</GenerateDocumentation>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<GenerateDocumentation>true</GenerateDocumentation>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="ThermalPrinter.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<ChangeLogPolicy UpdateMode="None" inheritsSet="Mono">
<MessageStyle LineAlign="0" />
</ChangeLogPolicy>
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>
\ No newline at end of file
namespace MoyaSignup
{
partial class CroppedImageControl
{
/// <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 Component 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.pictureBox1 = new System.Windows.Forms.PictureBox();
this.scoreLabel = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(3, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(280, 410);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// scoreLabel
//
this.scoreLabel.AutoSize = true;
this.scoreLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.scoreLabel.Location = new System.Drawing.Point(393, 192);
this.scoreLabel.Name = "scoreLabel";
this.scoreLabel.Size = new System.Drawing.Size(19, 20);
this.scoreLabel.TabIndex = 1;
this.scoreLabel.Text = "0";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.Location = new System.Drawing.Point(336, 192);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(51, 20);
this.label2.TabIndex = 2;
this.label2.Text = "Score";
//
// CroppedImageControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label2);
this.Controls.Add(this.scoreLabel);
this.Controls.Add(this.pictureBox1);
this.Name = "CroppedImageControl";
this.Size = new System.Drawing.Size(524, 417);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label scoreLabel;
private System.Windows.Forms.Label label2;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Emgu.CV;
using Emgu.CV.UI;
namespace MoyaSignup
{
public partial class CroppedImageControl : UserControl
{
public CroppedImageControl()
{
InitializeComponent();
}
public void SetScore(decimal score)
{
scoreLabel.Text = score.ToString();
}
public void SetPicture(Bitmap image)
{
pictureBox1.Image = image;
}
}
}
<?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>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MoyaSignup.Dataclasses
{
public class DebugWriteListener : TraceListener
{
StreamWriter log;
public DebugWriteListener(string logfile)
{
log = new StreamWriter(logfile, false, Encoding.UTF8);
}
public delegate void DebugWriteEventHandler(string text);
public event DebugWriteEventHandler NewText;
public event DebugWriteEventHandler NewTextRow;
public override void WriteLine(string line)
{
if (NewTextRow != null)
NewTextRow(timeNow() + ": " + line);
try
{
log.WriteLine(timeNow() + ": " + line);
if (Program.LogFrm != null)
Program.LogFrm.WriteLogLine(line);
} catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
string timeNow()
{
const int decimals = 3;
DateTime dt = DateTime.Now;
string ms = dt.Millisecond.ToString();
if (ms.Length > decimals)
ms = ms.Substring(0, decimals);
ms = ms.PadRight(decimals, '0');
return dt.ToString("T") + "." + ms;
}
public override void Write(string text)
{
if (NewText != null)
NewText(text);
}
public override void Close()
{
log.Close();
base.Close();
}
}
}
using DirectShowLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MoyaSignup.Dataclasses
{
public class DsDeviceContainer
{
private DsDevice device;
public DsDevice Device
{
get { return device; }
set { device = value; }
}
private int idx;
public int Idx
{
get { return idx; }
set { idx = value; }
}
public override string ToString()
{
return device.Name;
}
}
}
......@@ -46,6 +46,7 @@
this.btnFinnish.TabIndex = 80;
this.btnFinnish.UseVisualStyleBackColor = true;
this.btnFinnish.Visible = false;
this.btnFinnish.Click += new System.EventHandler(this.btnFinnish_Click_1);
//
// btnEnglish
//
......@@ -81,8 +82,10 @@
this.userDetailsEditor1.BackColor = System.Drawing.Color.Transparent;
this.userDetailsEditor1.Location = new System.Drawing.Point(3, 83);
this.userDetailsEditor1.Name = "userDetailsEditor1";
this.userDetailsEditor1.ReceiptPrinterName = null;
this.userDetailsEditor1.Size = new System.Drawing.Size(1043, 673);
this.userDetailsEditor1.TabIndex = 98;
this.userDetailsEditor1.ThermoPrinter = null;
this.userDetailsEditor1.Visible = false;
this.userDetailsEditor1.CloseView += new System.EventHandler(this.userDetailsEditor1_CloseView);
this.userDetailsEditor1.Load += new System.EventHandler(this.userDetailsEditor1_Load);
......
using System;
using DirectShowLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
......@@ -6,12 +7,17 @@ using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WebCam;
using ImageFilters;
//using WebCam;
//using ImageFilters;
using System.IO;
using MoyaAdminLib;
using System.Diagnostics;
using ThermoPrinterLibrary;
using Emgu.CV;
using Emgu.CV.Structure;
using Emgu.CV.CvEnum;
using Emgu.CV.UI;
using MoyaSignup.Dataclasses;
namespace MoyaSignup
{
......@@ -19,6 +25,8 @@ namespace MoyaSignup
{
ThermoPrinter thermoPrinter;
List<DsDeviceContainer> webCams;
//public delegate void ThermoPrinterEvent(ThermoPrinter.Models model);
//public event ThermoPrinterEvent SetPrinter;
......@@ -91,13 +99,22 @@ namespace MoyaSignup
ApiSettings form = new ApiSettings();
form.ShowDialog();
if(Properties.Settings.Default.printerPort != null && Properties.Settings.Default.ThermoPrinter > 0)
webCams = new List<DsDeviceContainer>();
if(form.Webcams != null && form.Webcams.Count > 0)
{
webCams = form.Webcams;
}
Program.CaptureDevices = webCams;
if(Properties.Settings.Default.PrinterTypeSelected == 1 && Properties.Settings.Default.printerPort != null && Properties.Settings.Default.ThermoPrinter > 0)
{
ThermoPrinter.Models model = (ThermoPrinter.Models)Properties.Settings.Default.ThermoPrinter;
SetPrinter(model);
userLoginControl1.SetPrinter += SetPrinter;
}
userLoginControl1.SetPrinter += SetPrinter;
}
......@@ -177,6 +194,58 @@ namespace MoyaSignup
this.Activate();
}
public void HandleKeyUpEvent(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
Debug.WriteLine("[form1] Catched key event alt + ctrl + S: Shutting down the program. Sender: " + sender.ToString());
allowShutdown = true;
Application.Exit();
return;
} else if(e.Alt && e.Control && e.KeyCode == Keys.C)
{
if (Program.WebCams != null)
{
WebCamViewForm frm = new WebCamViewForm(Program.WebCams);
frm.Show();
} else if(Program.CaptureDevices != null && Program.CaptureDevices.Count > 0)
{
List<Capture> cams = new List<Emgu.CV.Capture>();
foreach (DsDeviceContainer device in Program.CaptureDevices)
{
Capture capture = new Capture(device.Idx);
capture.SetCaptureProperty(CAP_PROP.CV_CAP_PROP_FRAME_HEIGHT, 720);
capture.SetCaptureProperty(CAP_PROP.CV_CAP_PROP_FRAME_WIDTH, 1280);
capture.QueryFrame();
Debug.WriteLine("[takepicturecontrol] adding webcam " + device.Device.Name + "' to webcams");
cams.Add(capture);
}
Program.WebCams = cams;
WebCamViewForm frm = new WebCamViewForm(Program.WebCams);
frm.Show();
}
}
else if (e.Alt && e.Control && e.KeyCode == Keys.D)
{
if (Program.LogFrm == null)
{
Program.LogFrm = new LogForm();
Program.LogFrm.Show();
}
}
else if (e.Alt && e.KeyCode == Keys.F5)
{
//userDetailsEditor1.SetPrinter(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
//MessageBox.Show("Printteri: IDP3210");
}
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
......@@ -184,7 +253,12 @@ namespace MoyaSignup
allowShutdown = true;
Application.Exit();
return;
} else if (e.Alt && e.KeyCode == Keys.F5)
} /*else if(e.Alt && e.Control && e.KeyCode == Keys.C)
{
WebCamViewForm frm = new WebCamViewForm(webCams);
frm.Show();
}*/
else if (e.Alt && e.KeyCode == Keys.F5)
{
//userDetailsEditor1.SetPrinter(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
//MessageBox.Show("Printteri: IDP3210");
......@@ -201,6 +275,11 @@ namespace MoyaSignup
this.Close();
return;
}
/*else if (e.Alt && e.Control && e.KeyCode == Keys.C)
{
WebCamViewForm frm = new WebCamViewForm(webCams);
frm.Show();
}*/
}
......@@ -227,7 +306,11 @@ namespace MoyaSignup
{
userLoginControl1.Visible = false;
userDetailsEditor1.LoadUser(userLoginControl1.CurrentUser);
userDetailsEditor1.ThermoPrinter = thermoPrinter;
if (Properties.Settings.Default.PrinterTypeSelected == 1)
userDetailsEditor1.ThermoPrinter = thermoPrinter;
else if (Properties.Settings.Default.PrinterTypeSelected == 0)
userDetailsEditor1.ReceiptPrinterName = Properties.Settings.Default.ReceiptPrinterName;
userLoginControl1.Clear();
userDetailsEditor1.Visible = true;
//userLoginControl1.CurrentUser;
......@@ -244,6 +327,15 @@ namespace MoyaSignup
userLoginControl1.Visible = true;
}
public void SetUsersPicture(Bitmap image)
{
userDetailsEditor1.SetUsersImage(image);
userDetailsEditor1.LatestFrame = image;
}
private void btnFinnish_Click_1(object sender, EventArgs e)
{
}
}
}
namespace MoyaSignup
{
partial class LogForm
{
/// <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.logTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// logTextBox
//
this.logTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.logTextBox.Location = new System.Drawing.Point(0, 0);
this.logTextBox.Multiline = true;
this.logTextBox.Name = "logTextBox";
this.logTextBox.ReadOnly = true;
this.logTextBox.Size = new System.Drawing.Size(632, 420);
this.logTextBox.TabIndex = 0;
this.logTextBox.TextChanged += new System.EventHandler(this.logTextBox_TextChanged);
//
// LogForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(632, 420);
this.Controls.Add(this.logTextBox);
this.Name = "LogForm";
this.Text = "LogForm";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox logTextBox;
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MoyaSignup
{
public partial class LogForm : Form
{
public LogForm()
{
InitializeComponent();
}
public void WriteLogLine(string line)
{
logTextBox.Text += line + "\r\n";
logTextBox.Focus();
logTextBox.SelectionStart = logTextBox.Text.Length - 1;
logTextBox.SelectionLength = 0;
}
private void logTextBox_TextChanged(object sender, EventArgs e)
{
}
}
}
<?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>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
......@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MoyaSignup</RootNamespace>
<AssemblyName>MoyaSignup</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<FileUpgradeFlags>
......@@ -33,6 +33,8 @@
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
......@@ -43,6 +45,8 @@
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
......@@ -55,8 +59,17 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<UseVSHostingProcess>false</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="AForge, Version=2.2.5.0, Culture=neutral, PublicKeyToken=c1db6ff4eaa06aeb, processorArchitecture=MSIL">
<HintPath>packages\AForge.2.2.5\lib\AForge.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="AForge.Video, Version=2.2.5.0, Culture=neutral, PublicKeyToken=cbfb6e07d173c401, processorArchitecture=MSIL">
<HintPath>packages\AForge.Video.2.2.5\lib\AForge.Video.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="AutoUpdateLib">
<HintPath>Resources\AutoUpdateLib.dll</HintPath>
</Reference>
......@@ -64,10 +77,34 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>deps\ConfLib2.dll</HintPath>
</Reference>
<Reference Include="DirectShowLib, Version=2.1.0.1599, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\DirectShowLib.1.0.0\lib\DirectShowLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="DynamicPg, Version=1.3.6.41028, Culture=neutral">
<SpecificVersion>False</SpecificVersion>
<HintPath>deps\DynamicPg.dll</HintPath>
</Reference>
<Reference Include="Emgu.CV, Version=2.2.1.1150, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Emgu.CV.dll</HintPath>
</Reference>
<Reference Include="Emgu.CV.GPU, Version=2.2.1.1150, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Emgu.CV.GPU.dll</HintPath>
</Reference>
<Reference Include="Emgu.CV.ML, Version=2.2.1.1150, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Emgu.CV.ML.dll</HintPath>
</Reference>
<Reference Include="Emgu.CV.UI, Version=2.2.1.1150, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Emgu.CV.UI.dll</HintPath>
</Reference>
<Reference Include="Emgu.Util, Version=2.2.1.1150, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>Resources\Emgu.Util.dll</HintPath>
</Reference>
<Reference Include="Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>deps\Mono.Security.dll</HintPath>
......@@ -80,6 +117,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>deps\Npgsql.dll</HintPath>
</Reference>
<Reference Include="QRCoder, Version=1.3.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\QRCoder.1.3.3\lib\net40\QRCoder.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
......@@ -97,6 +138,14 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\QRCoder.1.3.3\lib\net40\UnityEngine.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ZedGraph, Version=5.1.7.430, Culture=neutral, PublicKeyToken=02a83cbd123fcd60, processorArchitecture=MSIL">
<HintPath>packages\ZedGraph.5.1.7\lib\net35-Client\ZedGraph.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="API32.cs" />
......@@ -106,6 +155,14 @@
<Compile Include="ApiSettings.Designer.cs">
<DependentUpon>ApiSettings.cs</DependentUpon>
</Compile>
<Compile Include="CroppedImageControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="CroppedImageControl.Designer.cs">
<DependentUpon>CroppedImageControl.cs</DependentUpon>
</Compile>
<Compile Include="Dataclasses\DebugWriteListener.cs" />
<Compile Include="Dataclasses\DsDeviceContainer.cs" />
<Compile Include="Filters.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
......@@ -114,6 +171,12 @@
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="HeartBeatMonitor.cs" />
<Compile Include="LogForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="LogForm.Designer.cs">
<DependentUpon>LogForm.cs</DependentUpon>
</Compile>
<Compile Include="mjpeg\ByteArrayUtils.cs" />
<Compile Include="mjpeg\MJPEGConfiguration.cs" />
<Compile Include="mjpeg\MJPEGSource.cs" />
......@@ -123,15 +186,35 @@
<Compile Include="mjpeg\SourceDescriptions.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WaitForm.cs" />
<Compile Include="TakePictureForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TakePictureForm.Designer.cs">
<DependentUpon>TakePictureForm.cs</DependentUpon>
</Compile>
<Compile Include="WaitForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WaitForm.Designer.cs" />
<Compile Include="WebCamViewForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WebCamViewForm.Designer.cs">
<DependentUpon>WebCamViewForm.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="ApiSettings.resx">
<DependentUpon>ApiSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="CroppedImageControl.resx">
<DependentUpon>CroppedImageControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="LogForm.resx">
<DependentUpon>LogForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="mjpeg\MJPEGSourcePage.resx">
<DependentUpon>MJPEGSourcePage.cs</DependentUpon>
</EmbeddedResource>
......@@ -148,6 +231,9 @@
<EmbeddedResource Include="TakePictureControl.resx">
<DependentUpon>TakePictureControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="TakePictureForm.resx">
<DependentUpon>TakePictureForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserDetailsEditor.resx">
<DependentUpon>UserDetailsEditor.cs</DependentUpon>
</EmbeddedResource>
......@@ -155,6 +241,10 @@
<DependentUpon>UserLoginControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WaitForm.resx" />
<EmbeddedResource Include="WebCamViewForm.resx">
<DependentUpon>WebCamViewForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
......@@ -220,14 +310,6 @@
<Project>{25113a41-1991-4d34-95c0-47c238037a39}</Project>
<Name>ThermoPrinterLibrary</Name>
</ProjectReference>
<ProjectReference Include="..\WebCamLib\WebCamLib.vcxproj">
<Project>{fd48314a-9615-4ba6-913a-03787fb2dd30}</Project>
<Name>WebCamLib</Name>
</ProjectReference>
<ProjectReference Include="..\WebCamWrapper\WebCamWrapper.csproj">
<Project>{cc5d5149-0092-4508-ac34-2abe1468a1c9}</Project>
<Name>WebCamWrapper</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="deps\ConfLib2.dll" />
......@@ -235,6 +317,11 @@
<Content Include="deps\Mono.Security.dll" />
<Content Include="deps\Mono.Security.Protocol.Tls.dll" />
<Content Include="deps\Npgsql.dll" />
<Content Include="haarcascade_frontalface_default.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="License-LGPL.txt" />
<None Include="Resources\haarcascade_frontalface_default.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
......@@ -245,7 +332,6 @@
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
<PostBuildEvent>$(SolutionDir)/../../\AutoUpdate\src\AutoPublish\bin\Debug\AutoPublish.exe $(ConfigurationName) $(ProjectName) $(SolutionDir) $(TargetPath)</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file
......@@ -7,36 +7,32 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaSignup", "MoyaSignup.cs
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "..\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCamLib", "..\WebCamLib\WebCamLib.vcxproj", "{FD48314A-9615-4BA6-913A-03787FB2DD30}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebCamWrapper", "..\WebCamWrapper\WebCamWrapper.csproj", "{CC5D5149-0092-4508-AC34-2ABE1468A1C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThermoPrinterLibrary", "..\ThermoPrinterLibrary\ThermoPrinterLibrary\ThermoPrinterLibrary.csproj", "{25113A41-1991-4D34-95C0-47C238037A39}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Any CPU.ActiveCfg = Debug|x86
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|x86.ActiveCfg = Debug|x86
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|x86.Build.0 = Debug|x86
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Any CPU.ActiveCfg = Release|x86
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|x86.ActiveCfg = Release|x86
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|x86.Build.0 = Release|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.ActiveCfg = Debug|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|x86.ActiveCfg = Debug|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|x86.Build.0 = Debug|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.ActiveCfg = Release|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|x86.ActiveCfg = Release|x86
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|x86.Build.0 = Release|x86
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|x86.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|x86.Build.0 = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|x86.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|x86.Build.0 = Release|Win32
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|x86.ActiveCfg = Debug|x86
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|x86.Build.0 = Debug|x86
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|x86.ActiveCfg = Release|x86
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|x86.Build.0 = Release|x86
{25113A41-1991-4D34-95C0-47C238037A39}.Debug|Any CPU.ActiveCfg = Debug|x86
{25113A41-1991-4D34-95C0-47C238037A39}.Debug|x86.ActiveCfg = Debug|x86
{25113A41-1991-4D34-95C0-47C238037A39}.Debug|x86.Build.0 = Debug|x86
{25113A41-1991-4D34-95C0-47C238037A39}.Release|Any CPU.ActiveCfg = Release|x86
{25113A41-1991-4D34-95C0-47C238037A39}.Release|x86.ActiveCfg = Release|x86
{25113A41-1991-4D34-95C0-47C238037A39}.Release|x86.Build.0 = Release|x86
EndGlobalSection
......
using System;
using Emgu.CV;
using MoyaSignup.Dataclasses;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Windows.Forms;
......@@ -7,18 +11,32 @@ namespace MoyaSignup
{
static class Program
{
public static Form1 form1;
public static DebugWriteListener DebugWListener;
public static Form1 Form1;
public static LogForm LogFrm;
public static DateTime HeartBeat = System.DateTime.Now;
public static string AppDataPath = "";
public static List<DsDeviceContainer> CaptureDevices;
public static List<Capture> WebCams;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (!Debugger.IsAttached)
{
if (args.Length == 0 || args[0] != "-noautoupdate")
{
if (AutoUpdateLib.AutoUpdateCore.CheckForUpdates(null))
return; //program is required to close by autoupdate (probably updated)
}
}
System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
Version appVersion = a.GetName().Version;
string appVersionString = appVersion.ToString();
......@@ -28,12 +46,51 @@ namespace MoyaSignup
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.ApplicationVersion = appVersionString;
}
AppDataPath = Path.Combine(Application.LocalUserAppDataPath, "MoyaSignup");
if (!Directory.Exists(AppDataPath))
Directory.CreateDirectory(AppDataPath);
Directory.SetCurrentDirectory(AppDataPath);
DebugWListener = new DebugWriteListener("debug.log");
Debug.Listeners.Add(DebugWListener);
Debug.WriteLine("[program] Opened debug log");
Directory.SetCurrentDirectory(Application.StartupPath);
//HeartBeatMonitor hbmon = new HeartBeatMonitor();
form1 = new Form1();
Form1 = new Form1();
Form1.KeyUp += Form1_KeyUp;
Application.Run(Form1);
Application.Run(form1);
Debug.Close();
//hbmon.Stop();
}
private static void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
Debug.WriteLine("[program] Catched key event alt + ctrl + S: Shutting down the program.");
Form1.AllowShutdown = true;
//allowShutdown = true;
Application.Exit();
return;
} else if(e.Alt && e.Control && e.KeyCode == Keys.C)
{
//WebCamViewForm frm = new WebCamViewForm(webCams);
//frm.Show();
}
else if (e.Alt && e.KeyCode == Keys.F5)
{
//userDetailsEditor1.SetPrinter(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
//MessageBox.Show("Printteri: IDP3210");
}
}
}
}
......@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 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.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyVersion("1.0.45.0")]
[assembly: AssemblyFileVersion("1.0.45.0")]
......@@ -112,12 +112,12 @@
<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>
<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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="vecto_tausta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\vecto_tausta.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
......
......@@ -130,5 +130,41 @@ namespace MoyaSignup.Properties {
this["ApiURL"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool ApiTokenSet {
get {
return ((bool)(this["ApiTokenSet"]));
}
set {
this["ApiTokenSet"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("POS-58")]
public string ReceiptPrinterName {
get {
return ((string)(this["ReceiptPrinterName"]));
}
set {
this["ReceiptPrinterName"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("-1")]
public int PrinterTypeSelected {
get {
return ((int)(this["PrinterTypeSelected"]));
}
set {
this["PrinterTypeSelected"] = value;
}
}
}
}
......@@ -29,5 +29,14 @@
<Setting Name="ApiURL" Type="System.String" Scope="User">
<Value Profile="(Default)">http://myapi.moya.endpoint/MoyaWeb</Value>
</Setting>
<Setting Name="ApiTokenSet" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ReceiptPrinterName" Type="System.String" Scope="User">
<Value Profile="(Default)">POS-58</Value>
</Setting>
<Setting Name="PrinterTypeSelected" Type="System.Int32" Scope="User">
<Value Profile="(Default)">-1</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
This diff could not be displayed because it is too large.
......@@ -28,17 +28,22 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.pbIncoming = new System.Windows.Forms.PictureBox();
this.btnTakePic = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.pictureTakenLabel = new System.Windows.Forms.Label();
this.secondsLabel = new System.Windows.Forms.Label();
this.takePictureTimer = new System.Windows.Forms.Timer(this.components);
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).BeginInit();
this.SuspendLayout();
//
// pbIncoming
//
this.pbIncoming.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbIncoming.Location = new System.Drawing.Point(3, 3);
this.pbIncoming.Location = new System.Drawing.Point(5, 3);
this.pbIncoming.Name = "pbIncoming";
this.pbIncoming.Size = new System.Drawing.Size(299, 411);
this.pbIncoming.Size = new System.Drawing.Size(640, 360);
this.pbIncoming.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pbIncoming.TabIndex = 119;
this.pbIncoming.TabStop = false;
......@@ -46,25 +51,62 @@
// btnTakePic
//
this.btnTakePic.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnTakePic.Location = new System.Drawing.Point(3, 419);
this.btnTakePic.Location = new System.Drawing.Point(176, 369);
this.btnTakePic.Name = "btnTakePic";
this.btnTakePic.Size = new System.Drawing.Size(299, 36);
this.btnTakePic.TabIndex = 120;
this.btnTakePic.Text = "Ota uusi kuva";
this.btnTakePic.Text = "Ota kuva";
this.btnTakePic.UseVisualStyleBackColor = true;
this.btnTakePic.Click += new System.EventHandler(this.btnTakePic_Click_1);
this.btnTakePic.KeyUp += new System.Windows.Forms.KeyEventHandler(this.btnTakePic_KeyUp);
//
// timer1
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// pictureTakenLabel
//
this.pictureTakenLabel.AutoSize = true;
this.pictureTakenLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.pictureTakenLabel.Location = new System.Drawing.Point(203, 408);
this.pictureTakenLabel.Name = "pictureTakenLabel";
this.pictureTakenLabel.Size = new System.Drawing.Size(244, 20);
this.pictureTakenLabel.TabIndex = 121;
this.pictureTakenLabel.Text = "Kuva otetaan automaattisesti";
this.pictureTakenLabel.Visible = false;
//
// secondsLabel
//
this.secondsLabel.AutoSize = true;
this.secondsLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.secondsLabel.Location = new System.Drawing.Point(279, 428);
this.secondsLabel.Name = "secondsLabel";
this.secondsLabel.Size = new System.Drawing.Size(93, 20);
this.secondsLabel.TabIndex = 122;
this.secondsLabel.Text = "%s päästä";
this.secondsLabel.Visible = false;
//
// takePictureTimer
//
this.takePictureTimer.Interval = 1000;
this.takePictureTimer.Tick += new System.EventHandler(this.takePictureTimer_Tick);
//
// TakePictureControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.secondsLabel);
this.Controls.Add(this.pictureTakenLabel);
this.Controls.Add(this.btnTakePic);
this.Controls.Add(this.pbIncoming);
this.Name = "TakePictureControl";
this.Size = new System.Drawing.Size(306, 461);
this.Size = new System.Drawing.Size(650, 455);
this.Load += new System.EventHandler(this.TakePictureControl_Load);
this.VisibleChanged += new System.EventHandler(this.TakePictureControl_VisibleChanged);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.TakePictureControl_KeyUp);
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
......@@ -72,5 +114,9 @@
private System.Windows.Forms.PictureBox pbIncoming;
private System.Windows.Forms.Button btnTakePic;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label pictureTakenLabel;
private System.Windows.Forms.Label secondsLabel;
private System.Windows.Forms.Timer takePictureTimer;
}
}
No preview for this file type
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!