Fixed login verification and gui
This commit is contained in:
Binary file not shown.
@@ -58,7 +58,7 @@ namespace ErgometerApplication
|
|||||||
|
|
||||||
public void validateLogin(string username, string password)
|
public void validateLogin(string username, string password)
|
||||||
{
|
{
|
||||||
if (username.Length >= 4)
|
if (username.Length > 0)
|
||||||
{
|
{
|
||||||
if (password.Length == 0)
|
if (password.Length == 0)
|
||||||
{
|
{
|
||||||
@@ -66,13 +66,7 @@ namespace ErgometerApplication
|
|||||||
panelLogin.lblVerification.ForeColor = Color.Red;
|
panelLogin.lblVerification.ForeColor = Color.Red;
|
||||||
panelLogin.lblVerification.Visible = true;
|
panelLogin.lblVerification.Visible = true;
|
||||||
}
|
}
|
||||||
if (password.Length > 0 && password.Length < 4)
|
if (password.Length > 0)
|
||||||
{
|
|
||||||
panelLogin.lblVerification.Text = "Vul een wachtwoord in van minimaal 4 karakters.";
|
|
||||||
panelLogin.lblVerification.ForeColor = Color.Red;
|
|
||||||
panelLogin.lblVerification.Visible = true;
|
|
||||||
}
|
|
||||||
if (password.Length >= 3)
|
|
||||||
{
|
{
|
||||||
string error = "";
|
string error = "";
|
||||||
bool connect = MainClient.Connect(SerialPort.GetPortNames()[0], username, password, out error);
|
bool connect = MainClient.Connect(SerialPort.GetPortNames()[0], username, password, out error);
|
||||||
@@ -96,7 +90,7 @@ namespace ErgometerApplication
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
panelLogin.lblVerification.Text = "Vul een gebruikersnaam in van minimaal 4 karakters.";
|
panelLogin.lblVerification.Text = "Vul een gebruikersnaam in.";
|
||||||
panelLogin.lblVerification.ForeColor = Color.Red;
|
panelLogin.lblVerification.ForeColor = Color.Red;
|
||||||
panelLogin.lblVerification.Visible = true;
|
panelLogin.lblVerification.Visible = true;
|
||||||
}
|
}
|
||||||
@@ -136,6 +130,11 @@ namespace ErgometerApplication
|
|||||||
{
|
{
|
||||||
panelLogin.BringToFront();
|
panelLogin.BringToFront();
|
||||||
panelTopBar.Visible = false;
|
panelTopBar.Visible = false;
|
||||||
|
panelLogin.lblVerification.Text = "U bent uitgelogd.";
|
||||||
|
panelLogin.lblVerification.ForeColor = Color.Blue;
|
||||||
|
panelLogin.lblVerification.Visible = true;
|
||||||
|
panelLogin.textBoxUsername.Text = "";
|
||||||
|
panelLogin.textBoxPassword.Text = "";
|
||||||
sessionLogout();
|
sessionLogout();
|
||||||
updateTimer.Stop();
|
updateTimer.Stop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ namespace ErgometerApplication
|
|||||||
this.textBoxUsername.Name = "textBoxUsername";
|
this.textBoxUsername.Name = "textBoxUsername";
|
||||||
this.textBoxUsername.Size = new System.Drawing.Size(167, 20);
|
this.textBoxUsername.Size = new System.Drawing.Size(167, 20);
|
||||||
this.textBoxUsername.TabIndex = 2;
|
this.textBoxUsername.TabIndex = 2;
|
||||||
|
this.textBoxUsername.KeyDown += TextBoxPassword_KeyDown;
|
||||||
//
|
//
|
||||||
// lblLoginTitle
|
// lblLoginTitle
|
||||||
//
|
//
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user