Much more reliable interface. Bugfixes

This commit is contained in:
2015-10-20 23:27:19 +02:00
parent 29051fdaff
commit d01ad475a1
+14 -18
View File
@@ -19,7 +19,7 @@ namespace ErgometerDoctorApplication
{
InitializeComponent();
conPanelLogin.BringToFront();
request = 0;
request = 2;
updateTimer.Start();
}
@@ -27,8 +27,6 @@ namespace ErgometerDoctorApplication
private void BtnActiveSessions_Click(object sender, EventArgs e)
{
this.HeaderLabel.Text = "Actieve Sessies";
conActiveSessions.BringToFront();
//conActiveSessions.data.Rows.Clear();
if(MainClient.activesessions.Count > 0)
{
@@ -41,25 +39,20 @@ namespace ErgometerDoctorApplication
conActiveSessions.labelActiveSessions.Text = "Er zijn geen actieve sessies.";
}
/*
str += client.Value + ", ";
MainClient.StartNewCLient(client.Value, client.Key);
conActiveSessions.data.Rows.Add(client.Value, client.Key);
//conActiveSessions.labelActiveSessions.Text = str;
Console.WriteLine(str);
*/
conActiveSessions.BringToFront();
}
private void BtnClientData_Click(object sender, EventArgs e)
{
this.HeaderLabel.Text = "Clientenbestand";
conClientData.BringToFront();
if (MainClient.users.Count > 0)
{
conClientData.updateUsers(MainClient.users);
}
conClientData.BringToFront();
}
private void BtnBroadcast_Click(object sender, EventArgs e)
@@ -71,9 +64,6 @@ namespace ErgometerDoctorApplication
private void BtnSessionHistory_Click(object sender, EventArgs e)
{
this.HeaderLabel.Text = "Sessie geschiedenis";
conSessionHistory.BringToFront();
//MainClient.StartOldCLient("Test", 1148735907);
if (MainClient.oldSessionsData.Count > 0)
{
@@ -85,6 +75,8 @@ namespace ErgometerDoctorApplication
conSessionHistory.updateHistory(MainClient.oldSessionsData);
conSessionHistory.labelSessionHistory.Text = "Er zijn geen oude sessies.";
}
conSessionHistory.BringToFront();
}
public void validateLogin()
{
@@ -95,6 +87,13 @@ namespace ErgometerDoctorApplication
{
conPanelLogin.textBoxPassword.Text = "";
conPanelLogin.labelLoginInfo.Text = "";
if (MainClient.activesessions.Count > 0)
{
conActiveSessions.labelActiveSessions.Text = "";
conActiveSessions.updateActiveSessions(MainClient.activesessions);
}
showDashboard();
}
else
@@ -136,10 +135,7 @@ namespace ErgometerDoctorApplication
else if (request == 1)
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.SESSIONDATA, MainClient.Session));
else if (request == 2)
{
Console.WriteLine("Requesting all old sessions");
MainClient.SendNetCommand(new NetCommand(NetCommand.RequestType.ALLSESSIONS, MainClient.Session));
}
request ++;
if (request > 2)