コード例 #1
0
        private void quayLạiToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DanhSachChucNang DSCN = new DanhSachChucNang(Role, Name);

            DSCN.Show();
            this.Hide();
        }
コード例 #2
0
        private async void btnDangNhap_Click(object sender, EventArgs e)
        {
            string Account  = txtAccount.Text;
            string Password = txtPassword.Text;

            if (Account != "" && Password != "")
            {
                pbCheck.Show();
                lbCheck.Show();
                await Task.Delay(2000);

                if (dnv.DangNhap(Account, Password))
                {
                    DanhSachChucNang DSCN = new DanhSachChucNang(int.Parse(dnv.CheckRole(Account)), dnv.GetUserName(Account));
                    DSCN.Show();
                    this.Hide();
                    if (Ckb_SaveMyPass.Checked)
                    {
                        Properties.Settings.Default.userName = txtAccount.Text;
                        Properties.Settings.Default.passUser = txtPassword.Text;
                        Properties.Settings.Default.Save();
                    }
                }
                else
                {
                    pbCheck.Hide();
                    lbCheck.Hide();
                    MessageBox.Show("Sai tài khoản hoặc mật khẩu vui lòng kiểm tra lại !");
                }
            }
            else
            {
                MessageBox.Show("Vui lòng điền đầy đủ thông tin !");
            }
        }
コード例 #3
0
        private void btnQuayLai_Click(object sender, EventArgs e)
        {
            DanhSachChucNang dscn = new DanhSachChucNang(Role, Name);

            dscn.Show();
            this.Hide();
        }
コード例 #4
0
        private void btnTurnBack_Click(object sender, EventArgs e)
        {
            DanhSachChucNang DSCN = new DanhSachChucNang(Role, Name);

            DSCN.Show();
            this.Hide();
        }
コード例 #5
0
        private void QuanLyNhanVien_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
            {
                DanhSachChucNang dscn = new DanhSachChucNang(Role, Name);
                dscn.Show();
                this.Hide();
            }
        }
コード例 #6
0
 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();
     }
 }