private void _connectButton_Click(object sender, EventArgs e)
        {
            // Loop through all items the ListBox. 

            foreach (User u in _clientList.SelectedItems)
            {                
               //var mainScreen = new MainScreen(u);
               var mainScreen = new TrainingScreen(u);
               
               mainScreen.Show();
            }
            this.Dispose();
        }
Exemplo n.º 2
0
        private void LoginPacketResponse(Packet p)
        {
            var resp = p as LoginResponsePacket;

            if (resp == null)
                return;

            if (this.InvokeRequired)
            {
                this.Invoke((new Action(() => LoginPacketResponse(p))));
                return;
            }


            if (resp.Status == "200")
            {

                RH_APP.Classes.Settings.GetInstance().authToken = resp.AuthToken;
                RH_APP.Classes.Settings.GetInstance().CurrentUser = resp.User;
                if (resp.User.IsSpecialist || resp.User.IsAdministrator)
                {
                    //var mainScreen = new MainScreen(true);
                    TCPController.OnPacketReceived -= LoginPacketResponse;
                    //mainScreen.ShowDialog();

                    this.Hide();
                    MainMenu m = new MainMenu();
                    m.Show();
                }
                else if (resp.User.IsClient)
                {
                        this.Hide();
                        //var mainScreen = new MainScreen(false);
                        var mainScreen = new TrainingScreen(false);
                        TCPController.OnPacketReceived -= LoginPacketResponse;
                        mainScreen.Text = " Remote Healthcare - Client Edition";
                        mainScreen.ShowDialog();

                }
            }
            else
            {
                MessageBox.Show(resp.Description, "Your application has been reviewed");
            }

            

        }