public PanelClientContainer() : base()
        {
            this.panelClientChat = new PanelClientChat();

            //
            // panelClientContainer
            //
            this.Controls.Add(this.panelClientChat);
            this.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.Location = new System.Drawing.Point(0, 0);
            this.Name     = "panelClientContainer";
            this.Size     = new System.Drawing.Size(800, 600);
            this.TabIndex = 0;
        }
 public void CreateNewTest(char geslacht, int leeftijd, int gewicht, int lengte)
 {
     panelTopBar.Visible = true;
     panelClientContainer.BringToFront();
     chat = panelClientChat;
     MainClient.SendNetCommand(new NetCommand(gewicht, lengte, leeftijd, geslacht, MainClient.Session));
     MainClient.ComPort.Write("RS");
     MainClient.ComPort.Read();
     Thread.Sleep(200);
     MainClient.ComPort.Write("CM");
     MainClient.ComPort.Read();
     ergotest = new ErgometerTest(gewicht, lengte, leeftijd, geslacht, this);
     updateTimer.Start();
     beeptimer.Start();
 }
        public PanelClientContainer()
            : base()
        {
            this.panelClientChat = new PanelClientChat();

            //
            // panelClientContainer
            //
            this.Controls.Add(this.panelClientChat);
            this.Dock = System.Windows.Forms.DockStyle.Fill;
            this.Location = new System.Drawing.Point(0, 0);
            this.Name = "panelClientContainer";
            this.Size = new System.Drawing.Size(800, 600);
            this.TabIndex = 0;
        }
 public void CreateNewTest(char geslacht, int leeftijd, int gewicht, int lengte)
 {
     panelTopBar.Visible = true;
     panelClientContainer.BringToFront();
     chat = panelClientChat;
     MainClient.SendNetCommand(new NetCommand(gewicht, lengte, leeftijd, geslacht, MainClient.Session));
     MainClient.ComPort.Write("RS");
     MainClient.ComPort.Read();
     Thread.Sleep(200);
     MainClient.ComPort.Write("CM");
     MainClient.ComPort.Read();
     ergotest = new ErgometerTest(gewicht, lengte, leeftijd, geslacht, this);
     updateTimer.Start();
     beeptimer.Start();
 }
        public void validateLogin(string username, string password)
        {
            if (username.Length > 0)
            {
                if (password.Length == 0)
                {
                    panelLogin.lblVerification.Text = "Vul een wachtwoord in.";
                    panelLogin.lblVerification.ForeColor = Color.Red;
                    panelLogin.lblVerification.Visible = true;
                }
                if (password.Length > 0)
                {
                    string error = "";
                    bool connect = MainClient.Connect("COM5", username, password, out error);

                    if (connect)
                    {
                        panelClientContainer.BringToFront();
                        chat = panelClientChat;
                        this.labelUsername.Text = panelLogin.textBoxUsername.Text;
                        panelTopBar.Visible = true;
                        updateTimer.Start();
                    }
                    else
                    {
                        panelLogin.lblVerification.Text = error;
                        panelLogin.lblVerification.ForeColor = Color.Red;
                        panelLogin.lblVerification.Visible = true;
                    }

                }
            }
            else
            {
                panelLogin.lblVerification.Text = "Vul een gebruikersnaam in.";
                panelLogin.lblVerification.ForeColor = Color.Red;
                panelLogin.lblVerification.Visible = true;
            }
        }
示例#6
0
        public void validateLogin(string username, string password)
        {
            if (username.Length > 0)
            {
                if (password.Length == 0)
                {
                    panelLogin.lblVerification.Text      = "Vul een wachtwoord in.";
                    panelLogin.lblVerification.ForeColor = Color.Red;
                    panelLogin.lblVerification.Visible   = true;
                }
                if (password.Length > 0)
                {
                    string error   = "";
                    bool   connect = MainClient.Connect("COM5", username, password, out error);

                    if (connect)
                    {
                        panelClientContainer.BringToFront();
                        chat = panelClientChat;
                        this.labelUsername.Text = panelLogin.textBoxUsername.Text;
                        panelTopBar.Visible     = true;
                        updateTimer.Start();
                    }
                    else
                    {
                        panelLogin.lblVerification.Text      = error;
                        panelLogin.lblVerification.ForeColor = Color.Red;
                        panelLogin.lblVerification.Visible   = true;
                    }
                }
            }
            else
            {
                panelLogin.lblVerification.Text      = "Vul een gebruikersnaam in.";
                panelLogin.lblVerification.ForeColor = Color.Red;
                panelLogin.lblVerification.Visible   = true;
            }
        }