This commit is contained in:
331
utils/AyaImport/Login.cs
Normal file
331
utils/AyaImport/Login.cs
Normal file
@@ -0,0 +1,331 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace AyaImport
|
||||
{
|
||||
/// <summary>
|
||||
/// Summary description for Login.
|
||||
/// </summary>
|
||||
public class Login : System.Windows.Forms.Form
|
||||
{
|
||||
private System.Windows.Forms.Button btnLogin;
|
||||
private System.Windows.Forms.Button btnCancel;
|
||||
private System.Windows.Forms.TextBox edPassword;
|
||||
private System.Windows.Forms.TextBox edUsername;
|
||||
private System.Windows.Forms.TextBox edOldPassword;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.PictureBox pictureBox2;
|
||||
private System.Windows.Forms.GroupBox groupBox1;
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.Container components = null;
|
||||
|
||||
|
||||
private string mUsername;
|
||||
private string mPassword;
|
||||
private string mOldUsername;
|
||||
private string mOldPassword;
|
||||
private System.Windows.Forms.TextBox edOldUsername;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
private System.Windows.Forms.PictureBox pictureBox3;
|
||||
private System.Windows.Forms.PictureBox pictureBox4;
|
||||
private bool mLogin;
|
||||
|
||||
|
||||
public Login()
|
||||
{
|
||||
//
|
||||
// Required for Windows Form Designer support
|
||||
//
|
||||
InitializeComponent();
|
||||
|
||||
mUsername="";
|
||||
mPassword="";
|
||||
mOldUsername="";
|
||||
mOldPassword="";
|
||||
|
||||
mLogin=false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose( bool disposing )
|
||||
{
|
||||
if( disposing )
|
||||
{
|
||||
if(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(Login));
|
||||
this.btnLogin = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
this.edPassword = new System.Windows.Forms.TextBox();
|
||||
this.edUsername = new System.Windows.Forms.TextBox();
|
||||
this.edOldPassword = new System.Windows.Forms.TextBox();
|
||||
this.edOldUsername = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.pictureBox2 = new System.Windows.Forms.PictureBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.pictureBox3 = new System.Windows.Forms.PictureBox();
|
||||
this.pictureBox4 = new System.Windows.Forms.PictureBox();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnLogin
|
||||
//
|
||||
this.btnLogin.Location = new System.Drawing.Point(272, 440);
|
||||
this.btnLogin.Name = "btnLogin";
|
||||
this.btnLogin.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnLogin.TabIndex = 2;
|
||||
this.btnLogin.Text = "Login";
|
||||
this.btnLogin.Click += new System.EventHandler(this.btnLogin_Click);
|
||||
//
|
||||
// btnCancel
|
||||
//
|
||||
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.btnCancel.Location = new System.Drawing.Point(184, 440);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 3;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
//
|
||||
// edPassword
|
||||
//
|
||||
this.edPassword.Location = new System.Drawing.Point(80, 384);
|
||||
this.edPassword.Name = "edPassword";
|
||||
this.edPassword.PasswordChar = '*';
|
||||
this.edPassword.Size = new System.Drawing.Size(280, 20);
|
||||
this.edPassword.TabIndex = 1;
|
||||
this.edPassword.Text = "letmein";
|
||||
//
|
||||
// edUsername
|
||||
//
|
||||
this.edUsername.Location = new System.Drawing.Point(80, 344);
|
||||
this.edUsername.Name = "edUsername";
|
||||
this.edUsername.ReadOnly = true;
|
||||
this.edUsername.Size = new System.Drawing.Size(280, 20);
|
||||
this.edUsername.TabIndex = 17;
|
||||
this.edUsername.TabStop = false;
|
||||
this.edUsername.Text = "manager";
|
||||
//
|
||||
// edOldPassword
|
||||
//
|
||||
this.edOldPassword.Location = new System.Drawing.Point(80, 160);
|
||||
this.edOldPassword.Name = "edOldPassword";
|
||||
this.edOldPassword.PasswordChar = '*';
|
||||
this.edOldPassword.Size = new System.Drawing.Size(280, 20);
|
||||
this.edOldPassword.TabIndex = 0;
|
||||
this.edOldPassword.Text = "letmein";
|
||||
//
|
||||
// edOldUsername
|
||||
//
|
||||
this.edOldUsername.Location = new System.Drawing.Point(80, 120);
|
||||
this.edOldUsername.Name = "edOldUsername";
|
||||
this.edOldUsername.Size = new System.Drawing.Size(280, 20);
|
||||
this.edOldUsername.TabIndex = 23;
|
||||
this.edOldUsername.Text = "manager";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.Font = new System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label3.Location = new System.Drawing.Point(0, 152);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(80, 24);
|
||||
this.label3.TabIndex = 22;
|
||||
this.label3.Text = "Password:";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.Font = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label4.Location = new System.Drawing.Point(0, 120);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(80, 16);
|
||||
this.label4.TabIndex = 21;
|
||||
this.label4.Text = "Username:";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label5.Location = new System.Drawing.Point(0, 96);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(360, 16);
|
||||
this.label5.TabIndex = 25;
|
||||
this.label5.Text = "Old AyaNova CE manager account:";
|
||||
//
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
|
||||
this.pictureBox2.Location = new System.Drawing.Point(8, 0);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(368, 96);
|
||||
this.pictureBox2.TabIndex = 27;
|
||||
this.pictureBox2.TabStop = false;
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
this.groupBox1.Location = new System.Drawing.Point(0, 192);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(376, 8);
|
||||
this.groupBox1.TabIndex = 28;
|
||||
this.groupBox1.TabStop = false;
|
||||
//
|
||||
// pictureBox1
|
||||
//
|
||||
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
|
||||
this.pictureBox1.Location = new System.Drawing.Point(32, 208);
|
||||
this.pictureBox1.Name = "pictureBox1";
|
||||
this.pictureBox1.Size = new System.Drawing.Size(312, 104);
|
||||
this.pictureBox1.TabIndex = 29;
|
||||
this.pictureBox1.TabStop = false;
|
||||
//
|
||||
// pictureBox3
|
||||
//
|
||||
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
|
||||
this.pictureBox3.Location = new System.Drawing.Point(16, 336);
|
||||
this.pictureBox3.Name = "pictureBox3";
|
||||
this.pictureBox3.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox3.TabIndex = 30;
|
||||
this.pictureBox3.TabStop = false;
|
||||
//
|
||||
// pictureBox4
|
||||
//
|
||||
this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image")));
|
||||
this.pictureBox4.Location = new System.Drawing.Point(16, 376);
|
||||
this.pictureBox4.Name = "pictureBox4";
|
||||
this.pictureBox4.Size = new System.Drawing.Size(32, 32);
|
||||
this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.pictureBox4.TabIndex = 31;
|
||||
this.pictureBox4.TabStop = false;
|
||||
//
|
||||
// Login
|
||||
//
|
||||
this.AcceptButton = this.btnLogin;
|
||||
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(378, 479);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.pictureBox4);
|
||||
this.Controls.Add(this.pictureBox3);
|
||||
this.Controls.Add(this.pictureBox1);
|
||||
this.Controls.Add(this.groupBox1);
|
||||
this.Controls.Add(this.pictureBox2);
|
||||
this.Controls.Add(this.label5);
|
||||
this.Controls.Add(this.edOldPassword);
|
||||
this.Controls.Add(this.edOldUsername);
|
||||
this.Controls.Add(this.edPassword);
|
||||
this.Controls.Add(this.edUsername);
|
||||
this.Controls.Add(this.label3);
|
||||
this.Controls.Add(this.label4);
|
||||
this.Controls.Add(this.btnLogin);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.Name = "Login";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Tag = "Login";
|
||||
this.Text = "Login";
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void btnLogin_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
mUsername=edUsername.Text;
|
||||
mPassword=edPassword.Text;
|
||||
mOldUsername=edOldUsername.Text;
|
||||
mOldPassword=edOldPassword.Text;
|
||||
mLogin=true;
|
||||
Hide();
|
||||
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, System.EventArgs e)
|
||||
{
|
||||
mUsername="";
|
||||
mPassword="";
|
||||
mOldUsername="";
|
||||
mOldPassword="";
|
||||
mLogin=false;
|
||||
Hide();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public string Username
|
||||
{
|
||||
get
|
||||
{
|
||||
return mUsername;
|
||||
}
|
||||
}
|
||||
|
||||
public string Password
|
||||
{
|
||||
get
|
||||
{
|
||||
return mPassword;
|
||||
}
|
||||
}
|
||||
|
||||
public string OldUsername
|
||||
{
|
||||
get
|
||||
{
|
||||
return mOldUsername;
|
||||
}
|
||||
}
|
||||
|
||||
public string OldPassword
|
||||
{
|
||||
get
|
||||
{
|
||||
return mOldPassword;
|
||||
}
|
||||
}
|
||||
|
||||
public bool LoggingIn
|
||||
{
|
||||
get
|
||||
{
|
||||
return mLogin;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user