private void FormModifyRequirement_Load(object sender, EventArgs e)
        {
            CenterToScreen();
            FormSelectRequirement form = new FormSelectRequirement(projectId);

            form.ShowDialog();
            if (form.DialogResult != DialogResult.OK)
            {
                DialogResult = DialogResult.Cancel;
                Close();
            }
            else
            {
                featureComboBox.Items.Add("<Make Selection");
                foreach (Feature x in FakeFeatureRepository.features)
                {
                    featureComboBox.Items.Add(x.Title);
                    if (x.Id == repo.GetRequirementById(form.selectedId).FeatureId)
                    {
                        featureComboBox.SelectedItem = x.Title;
                    }
                }
                statementTextbox.Text = repo.GetRequirementById(form.selectedId).Statement;
            }
        }
Example #2
0
        private void FormRemoveRequirement_Load(object sender, EventArgs e)
        {
            CenterToScreen();
            FormSelectRequirement form = new FormSelectRequirement(projectId);

            form.ShowDialog();
            Requirement requirement;

            if (form.DialogResult == DialogResult.OK)
            {
                requirement = repo.GetRequirementById(form.selectedId);
                DialogResult result = MessageBox.Show("Are you sure you want to remove : " + requirement.Statement, "Confirmation", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    repo.Remove(requirement);
                }
            }
            Close();
        }