Ejemplo n.º 1
0
        private void _grid_Policies_AfterRowActivate(object sender, EventArgs e)
        {
            bool enabled = false;

            if (_grid_Policies.ActiveRow != null && _grid_Policies.ActiveRow.IsDataRow)
            {
                int policyId = (int)_grid_Policies.ActiveRow.Cells[colHeaderHiddenPolicyId].Value;
                Program.gController.Repository.RefreshPolicies();
                loadAssessmentsDataSource(policyId, true);
                Policy p = Program.gController.Repository.GetPolicy(policyId);
                if (!p.HasAssessments() && !p.IsSystemPolicy)
                {
                    enabled = true;
                }
            }
            _cmsi_Policies_Delete.Enabled = enabled;
        }