Beispiel #1
0
        private void btnDeleteAll_Click(object sender, EventArgs e)
        {
            if (ledVaiTro.EditValue == null)
            {
                XtraMessageBox.Show("Vui lòng chọn một vai trò!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                ledVaiTro.Focus();
            }
            else
            {
                if (XtraMessageBox.Show("Bạn có chắc chắn bạn muốn xóa toàn bộ các thuộc tính của các quyền bên dưới của vai trò \"" + ledVaiTro.Text + "\" không?", "Xác nhận xóa hết thuộc tính", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    int rs = 0;
                    if (ControlTree.ActiveFilterString == "")
                    {
                        rs = VaiTroQuyenCtrl.ClearAllProperties((int)ledVaiTro.EditValue, (List <SYS_Quyen>)sYSQuyenBindingSource.DataSource);
                    }
                    else
                    {
                        rs = VaiTroQuyenCtrl.ClearAllProperties((int)ledVaiTro.EditValue, TreeHelper.GetVisibleNodesData <SYS_Quyen>(ControlTree));
                    }

                    if (rs > 0)
                    {
                        XtraMessageBox.Show("Xóa các thuộc tính thành công", "Xóa các thuộc tính", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnRefreshProperties.PerformClick();
                    }
                    else
                    {
                        XtraMessageBox.Show("Không có thuộc tính nào được xóa!", "Xóa các thuộc tính", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }