private void LoginButton_Click(object sender, EventArgs e)
 {
     if (UsernameTextBox.Text != string.Empty && PasswordTextBox.Text != string.Empty)
     {
         string Username = UsernameTextBox.Text;
         string Password = PasswordTextBox.Text;
         if (DoctorClient.GuiDataToServer("login", Username, Password))
         {
             SpecialistForm specialistForm = new SpecialistForm(DoctorClient);
             DoctorClient.DocGUI = specialistForm;
             specialistForm.Show();
             this.Visible = false;
         }
         else
         {
             MessageBox.Show("The username/password combination was\r\nincorrect, please try again");
         }
     }
     else
     {
         MessageBox.Show("Please fill in all required fields");
     }
 }
Пример #2
0
        private void okButton_Click(object sender, EventArgs e)
        {
            bool LoginCorrect = DoctorClient.GuiDataToServer("login", usernameText.Text, passwordText.Text);

            usernameText.Text = "";
            passwordText.Text = "";
            usernameText.Focus();

            if (LoginCorrect)
            {
                DocGUI docGUI = new DocGUI(DoctorClient);
                DoctorClient.DocGUI = docGUI;
                docGUI.Show();
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("The username and/or password was incorrect,\r\nplease try again");
            }
        }
Пример #3
0
 private void okButton_Click(object sender, EventArgs e)
 {
     if (usernameText.Text != String.Empty && passwordText.Text != String.Empty)
     {
         bool created = DoctorClient.GuiDataToServer("create_account", usernameText.Text, passwordText.Text);
         if (created)
         {
             docInput.Enabled = true;
             this.Dispose();
         }
         else
         {
             MessageBox.Show("There is already an account with this username");
         }
     }
     else
     {
         MessageBox.Show("You need to fill in all fields");
     }
 }