private void btnUpdate_Click(object sender, EventArgs e) { if (txtPassword.Text != "" && txtRole.Text != "") { DialogResult dialog = MessageBox.Show("Bạn có chắc chắn muốn cập nhật mục này không?", "Xác nhận cập nhật", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialog == DialogResult.Yes) { if (DNV.Update_Account(txtPassword.Text, txtRole.Text, txtMaNv.Text)) { if (Properties.Settings.Default.UserName == txtMaNv.Text) { Properties.Settings.Default.Password = txtPassword.Text; Properties.Settings.Default.Save(); } MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); Load_Account(DNV.Account_Staff()); openButton(true); } else { MessageBox.Show("Cập nhật thất bại", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); Load_Account(DNV.Account_Staff()); } } } else { MessageBox.Show("Vui lòng không để trống", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Btn_ReFresh_Click(object sender, EventArgs e) { Data_NV DNV = new Data_NV(); Load_Account(DNV.Account_Staff()); Clear(); }
private void PhanQuyenVaTaiKhoan_Load(object sender, EventArgs e) { DNV = new Data_NV(); Load_Account(DNV.Account_Staff()); }