Exemple #1
0
        //button login
        private void btnLogin_Click(object sender, EventArgs e)

        {
            Client user     = new Client();
            String username = textBox1.Text; //string username
            String password = textBox2.Text; //string pass

            if (textBox1.Text == "")         //uname tidak boleh kosong
            {
                MessageBox.Show("Username tidak boleh kosong");
            }
            else if (textBox2.Text == "")
            {
                MessageBox.Show("Username tidak boleh kosong");
            }
            else
            {//jika masukan username&password bukan user dan pbo123 makalogin gagal
                if (textBox1.Text != "user" && textBox2.Text != "pbo123")
                {
                    MessageBox.Show("LOGIN GAGAL");
                }
                else
                {
                    MessageBox.Show("LOGIN BERHASIL! SELAMAT DATANG");
                    menuBaru menu = new menuBaru();
                    menu.Show();
                    this.Visible = false;
                }
            }
        }
Exemple #2
0
        private void button6_Click(object sender, EventArgs e)
        {
            //akan menampilkan menu sebelumnya jika menekan back
            menuBaru menuBaru = new menuBaru();

            menuBaru.Show();
            this.Hide();
        }