Exemple #1
0
        private void signoutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Đăng xuất thành công", "Thông báo");
            for (int i = Application.OpenForms.Count - 1; i >= 0; i--)
            {
                if (Application.OpenForms[i].Name != "GDngoai")
                {
                    Application.OpenForms[i].Close();
                }
            }
            GDngoai gdngoai = Application.OpenForms["GDngoai"] as GDngoai;

            gdngoai.xulyquyen(0);
            this.Close();
        }
Exemple #2
0
        private void xulydangnhap()
        {
            bool    kiemtra = taikhoan.KTdangnhap(thUsername.Text, thPass.Text);
            GDngoai f2      = Application.OpenForms["GDngoai"] as GDngoai;

            if (kiemtra == true)
            {
                MessageBox.Show("Đăng nhập thành công", "Thông báo");
                f2.tk    = thUsername.Text;
                f2.quyen = taikhoan.KTquyen(thUsername.Text);
                this.Close();
            }
            else
            {
                f2.quyen = 0;
                MessageBox.Show("Đăng nhập thất bại", "Thông báo");
            }
        }