示例#1
0
        private void button1_Click(object sender, EventArgs e)

        {
            int kt = 0;

            if (textBox1.Text != "UserName" && textBox2.Text != "PassWord")
            {
                foreach (var kq in UsserrDTO.lstU)
                {
                    if (kq.Username == textBox1.Text && kq.Pass == textBox2.Text)
                    {
                        kt = 1;
                        break;
                    }
                }
                if (kt == 1)
                {
                    HSB.Login(textBox1.Text, textBox2.Text);
                    MessageBox.Show("Đăng nhập thành công");
                    MainGUI.ActiveForm.Hide();
                    MainGUI m = new MainGUI();
                    m.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng");
                }
            }
            else
            {
                MessageBox.Show(textBox2.Text);
            }
        }
示例#2
0
        private void button14_Click(object sender, EventArgs e)
        {
            HSB.Logout();
            MainGUI.ActiveForm.Hide();
            MainGUI m = new MainGUI();

            m.ShowDialog();
        }