Exemplo n.º 1
0
        private void btnCAPQUYEN_Click(object sender, EventArgs e)
        {
            frmDangnhap f = new frmDangnhap();

            f.Show();
            this.Close();
        }
Exemplo n.º 2
0
        private void đĂNGXUẤTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dlr = MessageBox.Show("Bạn có chắc muốn đăng xuất?", "THÔNG BÁO", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

            if (DialogResult.OK == dlr)
            {
                frmDangnhap f = new frmDangnhap();
                f.Show();
                this.Close();
            }
        }
Exemplo n.º 3
0
        private void btnketnoi_Click(object sender, EventArgs e)
        {
            sv   = txtserver.Text;
            db   = txttencsdl.Text;
            user = txtuser.Text;
            pass = txtpass.Text;
            Connection con = new Connection();

            if (con.OpenConn() == true)
            {
                frmDangnhap f = new frmDangnhap();
                f.Show();
            }
            else
            {
                MessageBox.Show("ket noi that bai");
            }
        }
Exemplo n.º 4
0
        private void btnketnoi_Click(object sender, EventArgs e)
        {
            sv   = txtserver.Text;
            db   = txttencsdl.Text;
            user = txtuser.Text;
            pass = txtpass.Text;
            Connection con = new Connection();

            if (txtserver.Text == "" || txttencsdl.Text == "" || txtuser.Text == "" || txtpass.Text == "")
            {
                warning.Play();
                //success.Stop();
                //error.Stop();

                lbChuy.Text = "Thông tin kết nối không được bỏ trống!";
            }
            else
            {
                try
                {
                    lbChuy.Text = "";
                    if (con.OpenConn() == true)
                    {
                        //success.Play();
                        frmDangnhap f = new frmDangnhap();
                        f.Show();
                        this.Hide();
                    }
                    else
                    {
                        error.Play();
                        MessageBox.Show("Kết nối thất bại! Vui lòng kiểm tra lại thông tin kết nối!");
                    }
                }
                catch (Exception ex)
                {
                    error.Play();
                    MessageBox.Show("" + ex);
                }
            }
        }