Beispiel #1
0
        private void tsbSaveAttributes_Click(object sender, EventArgs e)
        {
            if (!chkValidForAdvancedFind.Checked && !chkValidForAudit.Checked && !chkRequirementLevel.Checked)
            {
                MessageBox.Show(this, "It is required to select at least one property to update:\r\n- Valid for advanced find\r\n- Is audit enabled\r\n - Requirement level",
                                "Warning",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);

                return;
            }

            var us = new UpdateSettings
            {
                Items = lvAttributes.Items.Cast <ListViewItem>().Select(i => (ListViewItem)i.Clone()).ToList(),
                UpdateValidForAdvancedFind = chkValidForAdvancedFind.Checked,
                UpdateAuditIsEnabled       = chkValidForAudit.Checked,
                UpdateRequirementLevel     = chkRequirementLevel.Checked,
                RequirementLevelValue      = chkRequirementLevel.Checked ? MapSdkValue(cboRequirementLevel.SelectedIndex) : null
            };

            var uaForm = new Forms.UpdateAttributesForm(Service, us);

            uaForm.ShowDialog();

            // reloads the attributes
            lvEntities_SelectedIndexChanged(null, null);
        }
        private void tsbSaveAttributes_Click(object sender, EventArgs e)
        {
            if (!chkValidForAdvancedFind.Checked && !chkValidForAudit.Checked && !chkRequirementLevel.Checked)
            {
                MessageBox.Show(this, "It is required to select at least one property to update:\r\n- Valid for advanced find\r\n- Is audit enabled\r\n - Requirement level",
                    "Warning",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Warning);

                return;
            }

            var us = new UpdateSettings
            {
                Items = lvAttributes.Items.Cast<ListViewItem>().Select(i => (ListViewItem)i.Clone()).ToList(),
                UpdateValidForAdvancedFind = chkValidForAdvancedFind.Checked,
                UpdateAuditIsEnabled = chkValidForAudit.Checked,
                UpdateRequirementLevel = chkRequirementLevel.Checked,
                RequirementLevelValue = chkRequirementLevel.Checked ? MapSdkValue(cboRequirementLevel.SelectedIndex) : null
            };

            var uaForm = new Forms.UpdateAttributesForm(Service, us);
            uaForm.ShowDialog();

            // reloads the attributes
            lvEntities_SelectedIndexChanged(null, null);
        }