Ejemplo n.º 1
0
        private void FormRemoveFeature_Load(object sender, EventArgs e)
        {
            FakeRequirementRepository reqRep = new FakeRequirementRepository();
            FormSelectFeature         form   = new FormSelectFeature(projectId);

            form.ShowDialog();
            CenterToScreen();
            Feature feature;

            if (form.DialogResult == DialogResult.OK)
            {
                feature = repo.GetFeatureById(form.selectedId);
                DialogResult result = MessageBox.Show("Are you sure you want to remove : " + feature.Title, "Confirmation", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    if (reqRep.CountByFeatureId(feature.Id) != 0)
                    {
                        result = MessageBox.Show("There are one or more requirements associated with this feature. These requirements will be destroyed if you remove this  feature. Are you sure you want to remove: " + feature.Title, "Confirmation", MessageBoxButtons.YesNo);
                        if (result == DialogResult.Yes)
                        {
                            reqRep.RemoveByFeatureId(feature.Id);
                            repo.Remove(feature);
                        }
                    }
                    else
                    {
                        repo.Remove(feature);
                    }
                }
            }
            Close();
        }
Ejemplo n.º 2
0
        private void FormModfyFeature_Load(object sender, EventArgs e)
        {
            FormSelectFeature form = new FormSelectFeature(this.projectId);

            form.ShowDialog();
            CenterToScreen();
            if (form.DialogResult != DialogResult.OK)
            {
                Close();
            }
            else
            {
                featureId         = form.selectedId;
                titleTextbox.Text = repo.GetFeatureById(featureId).Title;
            }
        }