private void btnRegister_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == "" || txtPassword.Text == "")
            {
                MessageBox.Show("Username dan Password harus diisi !");
                txtUsername.Focus();
            }
            else
            {
                login.setUsername(txtUsername.Text);
                login.setPassword(txtPassword.Text);

                status = impUser.insertUser(login);

                if (status == false)
                {
                    MessageBox.Show("Register Failed !!");
                    txtUsername.Text = "";
                    txtPassword.Text = "";
                    txtUsername.Focus();
                }
                else
                {
                    MessageBox.Show("Register Success !!");
                    txtUsername.Text = "";
                    txtPassword.Text = "";
                    txtUsername.Focus();

                    frmLogin l = new frmLogin();
                    l.Show();
                    this.Hide();
                }
            }
        }
示例#2
0
        private void btnInput_Click(object sender, EventArgs e)
        {
            if (txtUsername.Text == "" || txtPassword.Text == "")
            {
                MessageBox.Show("Username dan Password harus diisi !");
                txtUsername.Focus();
            }
            else
            {
                entUser.setUsername(txtUsername.Text);
                entUser.setPassword(txtPassword.Text);

                status = impUser.insertUser(entUser);

                if (status == false)
                {
                    MessageBox.Show("Input Failed !!");
                    txtUsername.Text = "";
                    txtPassword.Text = "";
                    txtUsername.Focus();
                }
                else
                {
                    MessageBox.Show("Input Success !!");
                    txtUsername.Text = "";
                    txtPassword.Text = "";
                    txtUsername.Focus();
                }
                viewUser();
            }
        }