From d01ad475a13b522b4a9f60b7fb311a11381529f7 Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Tue, 20 Oct 2015 23:27:19 +0200 Subject: [PATCH] Much more reliable interface. Bugfixes --- ErgometerDoctorApplication/MainWindow.cs | 32 +++++++++++------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/ErgometerDoctorApplication/MainWindow.cs b/ErgometerDoctorApplication/MainWindow.cs index b35cf29..550854a 100644 --- a/ErgometerDoctorApplication/MainWindow.cs +++ b/ErgometerDoctorApplication/MainWindow.cs @@ -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)