Exemplo n.º 1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            string error = "";

            if (txtAccount.Text == "")
            {
                error = "Tài khoản không được để trống";
            }
            else if (txtPassword.Text == "")
            {
                error = "Mật khẩu không được để trống";
            }
            //users.getUsernamPassword(txtAccount.Text, txtPassword.Text) != null
            if (error == "")
            {
                string username = txtAccount.Text;
                string password = txtPassword.Text;
                if (!users.getUsernamPassword(username, password))
                {
                    MessageBox.Show("Tài khoản hoặc mật khẩu không tồn tại");
                }
                else
                {
                    fManager f = new fManager(users.idUser());
                    this.Hide();
                    f.ShowDialog();
                    resetAcc();
                    this.Show();
                }
            }
            else
            {
                MessageBox.Show(error, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemplo n.º 2
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            fManager f = new fManager();

            this.Hide();
            f.ShowDialog();
            this.Show();
        }
Exemplo n.º 3
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            //string error = "";
            //if (txtAccount.Text == "")
            //{
            //    error = "Tai khoan khong duoc de trong";
            //}
            //else if (txtPassword.Text == "")
            //{
            //    error = "Mat khau khong duoc de trong";
            //}
            ////users.getUsernamPassword(txtAccount.Text, txtPassword.Text) != null
            //if (error == "")
            //{
            //    string username = txtAccount.Text;
            //    string password = txtPassword.Text;
            //    if (!users.getUsernamPassword(username, password))
            //    {
            //        MessageBox.Show("Tai khoan hoac mat khau khong ton tai");
            //    }
            //    else
            //    {
            //        fManager f = new fManager();
            //        this.Hide();
            //        f.ShowDialog();
            //        resetAcc();
            //        this.Show();
            //    }
            //}

            //else
            //{
            //    MessageBox.Show(error, "Thong bao", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            //}

            fManager f = new fManager();

            this.Hide();
            f.ShowDialog();
            resetAcc();
            this.Show();
        }