Ejemplo n.º 1
0
        private void btnLogout_Click(object sender, EventArgs e)
        {
            DialogResult dialog = MessageBox.Show("Bạn muốn đăng xuất à?", "Xác nhận", MessageBoxButtons.YesNo);

            if (dialog == DialogResult.Yes)
            {
                Properties.Settings.Default.userName = "";
                Properties.Settings.Default.passUser = "";
                Properties.Settings.Default.Save();
                this.Hide();
                DangNhap dn = new DangNhap();
                dn.Show();
            }
        }
Ejemplo n.º 2
0
        private void ThongTinNhanVien_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dialog = MessageBox.Show("Bạn muốn thoát à?", "Xác nhận", MessageBoxButtons.YesNo);

            if (dialog == DialogResult.No)
            {
                e.Cancel = true;
            }
            else
            {
                DangNhap dangNhap = new DangNhap();
                dangNhap.Show();
                this.Hide();
            }
        }
 public void check()
 {
     if (Properties.Settings.Default.userName != "")
     {
         string Account  = Properties.Settings.Default.userName;
         string Password = Properties.Settings.Default.passUser;
         if (dnv.DangNhap(Account, Password))
         {
             DanhSachChucNang DSCN = new DanhSachChucNang(int.Parse(dnv.CheckRole(Account)), dnv.GetUserName(Account));
             DSCN.Show();
         }
     }
     else
     {
         DangNhap dn = new DangNhap();
         dn.Show();
     }
 }