Exemplo n.º 1
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            String username = this.textBoxLogin.Text;
            String password = this.textBoxPassword.Text;
            String token    = EISclient.logIn(username, password);

            if (token.Equals("DENIED") || token.Equals("DBMS FAILURE"))
            {
                System.Windows.Forms.MessageBox.Show("An error occured; you have not been logged-in. " +
                                                     "Check your username and password and try again");
            }
            else
            {
                parent.setUsername(username);
                parent.setPassword(password);
                parent.setToken(token);
                parent.displayList();
                this.Close();
            }
        }
Exemplo n.º 2
0
        private void buttonOK_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(this.textBoxNew.Text))
            {
                if (this.textBoxNew.Text.Equals(this.textBoxConfirm.Text))
                {
                    if (this.textBoxCurrent.Text.Equals(this.password))
                    {
                        String password = this.textBoxNew.Text;
                        String msg      = EISclient.changePassword(username, password, token);

                        if (msg.Equals("SUCCESS"))
                        {
                            parent.setPassword(password);
                            System.Windows.Forms.MessageBox.Show("Password successfully changed.");
                            this.Close();
                        }
                        else
                        {
                            System.Windows.Forms.MessageBox.Show("An error occured; your password has not been changed.");
                        }
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("The \"Current Password\" must equal your current passowrd.");
                    }
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show("The \"New Password\" and \"Confirm Password\" fields must be equal.");
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("The \"New Password\" field must contain a value.");
            }
        }