private void removeToolStripMenuItem1_Click(object sender, System.EventArgs e)
        {
            FormSelectRequirement selectARequirement = new FormSelectRequirement(currentProjectID);

            selectARequirement.ShowDialog();
            if (selectARequirement.getRequirementId() != -1)
            {
                DialogResult messageBoxResult = MessageBox.Show("Are you sure you want to remove this requirement?", "Confirmation", MessageBoxButtons.YesNo);
                if (messageBoxResult == DialogResult.Yes)
                {
                    requirementRepository.Remove(requirementRepository.GetRequirementById(selectARequirement.getRequirementId()));
                }
            }
        }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            Requirement needed = (Requirement)dataGridView1.CurrentRow.DataBoundItem;
            string      result = repo.Remove(needed);

            if (result == "")
            {
                MessageBox.Show("Requirement Removed Successfully");
                this.Close();
            }
            else
            {
                MessageBox.Show(result, "Attention");
            }
        }