Ejemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            if (txbUser.Text.Length == 0 || txbPass.Text.Length == 0)
            {
                MyMessageBox.Show("Tên đăng nhập hoặc mật khẩu bị trống!", MessageBoxButtons.OK);
            }
            else
            {
                if (BUS_LoginAccount.Login(txbUser.Text, txbPass.Text))
                {
                    if (!ckbRemember.Checked)
                    {
                        txbPass.Clear();
                    }

                    BUS_LoginAccount.ShowAvatar(txbUser.Text);
                    BUS_Actions.AddActions(txbUser.Text, "Đăng nhập");

                    fMain f = new fMain();
                    this.Hide();
                    f.ShowDialog();
                    this.Show();
                }
                else
                {
                    MyMessageBox.Show("Tên đăng nhập hoặc mật khẩu không đúng!", MessageBoxButtons.OK);
                }
            }
        }
Ejemplo n.º 2
0
        private void BtnDangNhap_Click(object sender, EventArgs e)
        {
            fMain fmain = new fMain();

            this.Hide();
            fmain.ShowDialog();
            this.Close();
        }
Ejemplo n.º 3
0
        private void login()
        {
            accountDTO.Username = txbUsername.Text;
            accountDTO.Password = txbPassword.Text;

            if (accountBus.Login(accountDTO))
            {
                Hide();
                fMain f = new fMain(accountDTO.Displayname, accountDTO.Role, accountDTO.Img);
                f.ShowDialog();
            }
            else
            {
                MessageBox.Show("Sai tên tài khoản hoặc mật khẩu!!!");
                txbPassword.Clear();
                txbUsername.Clear();
                txbUsername.Focus();
            }
        }