private void btnThemQuyen_Click(object sender, EventArgs e) { if (dtNotUse != null) { int _checkvalue = 0; for (int i = 0; i < dtNotUse.Rows.Count; i++) { if ((bool)dtNotUse.Rows[i]["selectvalue"] == true) { _checkvalue++; } } if (_checkvalue < 1) { MessageBox.Show(" Bạn chưa chọn quyền để thêm "); return; } Class.S_TaiKhoan tk = new Class.S_TaiKhoan(); tk.UserName = treeAccount.FocusedNode.GetDisplayText(1); if (tk.Insert_Permission(dtNotUse)) { Class.App.SaveSuccessfully(); GetList_PermissionByUser(treeAccount.FocusedNode.GetDisplayText(1)); } else { Class.App.SaveNotSuccessfully(); } } }
private void btnDanQuyen_Click(object sender, EventArgs e) { if (dtSaoChepQuyen == null) { return; } Class.S_TaiKhoan tk = new Class.S_TaiKhoan(); tk.UserName = treeAccount.FocusedNode.GetDisplayText(1); if (tk.Insert_Permission(dtSaoChepQuyen)) { Class.App.SaveSuccessfully(); GetList_PermissionByUser(treeAccount.FocusedNode.GetDisplayText(1)); } else { Class.App.SaveNotSuccessfully(); } }