Exemplo n.º 1
0
        private void FeatureRemove_Click(object sender, System.EventArgs e)
        {
            FormSelectFeature form = new FormSelectFeature(featureRepository, projectSelection, 1);

            form.ShowDialog();
            form.Dispose();
        }
        private void removeToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            FakeRequirementRepository requirementRepository = new FakeRequirementRepository();

            FormSelectFeature selectAFeature = new FormSelectFeature(currentProjectID);

            selectAFeature.ShowDialog();

            if (selectAFeature.featureId != -1)
            {
                DialogResult messageBoxResult = MessageBox.Show("Are you sure you want to remove: " + featureRepository.GetFeatureById(selectAFeature.featureId).Title, "Confirmation", MessageBoxButtons.YesNo);
                if (messageBoxResult == DialogResult.Yes)
                {
                    DialogResult messageBoxResultTwo = DialogResult.No;
                    if (requirementRepository.CountByFeatureId(selectAFeature.featureId) > 0)
                    {
                        messageBoxResultTwo = MessageBox.Show("There are one or more requirements associated with this feature These Requirements will be destoryed if you remove this feature. Are you sure you want to remove: " + featureRepository.GetFeatureById(selectAFeature.featureId).Title, "Confirmation", MessageBoxButtons.YesNo);
                    }

                    if (messageBoxResultTwo == DialogResult.Yes || requirementRepository.CountByFeatureId(selectAFeature.featureId) == 0)
                    {
                        featureRepository.Remove(featureRepository.GetFeatureById(selectAFeature.featureId));
                        requirementRepository.RemoveByFeatureId(selectAFeature.featureId);
                    }
                }
                else
                {
                }
            }
            selectAFeature.Dispose();
        }
Exemplo n.º 3
0
        private void modifyToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            FormSelectFeature selectFeature = new FormSelectFeature(currentProjectid);

            selectFeature.ShowDialog();
            selectFeature.Dispose();
        }
Exemplo n.º 4
0
        private void modifyToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            FormSelectFeature formSelect = new FormSelectFeature(selected_id);

            formSelect.ShowDialog();
            if (formSelect.DialogResult == DialogResult.OK)
            {
                FormModifyFeature formModify = new FormModifyFeature(selected_id, formSelect.selectedFeatureID);
                formModify.ShowDialog();
                formModify.Dispose();
            }
        }
        private void modifyToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            FormSelectFeature selectAFeature = new FormSelectFeature(currentProjectID);

            selectAFeature.ShowDialog();
            if (selectAFeature.featureId != -1)
            {
                FormModifyFeature modifyAFeature = new FormModifyFeature(selectAFeature.featureId);
                modifyAFeature.ShowDialog();
                modifyAFeature.Dispose();
            }

            selectAFeature.Dispose();
        }
Exemplo n.º 6
0
        private void removeToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            FormSelectFeature         formSelect                = new FormSelectFeature(selected_id);
            FakeFeatureRepository     fakeFeatureRepository     = new FakeFeatureRepository(selected_id);
            FakeRequiremnetRepository fakeRequiremnetRepository = new FakeRequiremnetRepository(selected_id);

            formSelect.ShowDialog();
            if (formSelect.DialogResult == DialogResult.OK)
            {
                Feature      tmp          = fakeFeatureRepository.GetFeatureByID(formSelect.selectedFeatureID);
                int          count        = fakeRequiremnetRepository.CountByFeatureID(formSelect.selectedFeatureID);
                string       del          = "Are you sure you want to delete " + tmp.Title;
                string       associated   = "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" + tmp.Title + "?";
                DialogResult dialogResult = MessageBox.Show(del, "Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (count > 0)
                    {
                        DialogResult dialogResult2 = MessageBox.Show(associated, "Confirmation", MessageBoxButtons.YesNo);
                        if (dialogResult2 == DialogResult.Yes)
                        {
                            fakeFeatureRepository.Remove(tmp);
                            fakeRequiremnetRepository.RemoveByFeatureID(tmp.Id);
                        }
                        else
                        {
                            MessageBox.Show("Delete cancelled", "Attention");
                        }
                    }
                }
                else if (dialogResult == DialogResult.No)
                {
                    MessageBox.Show("Delete cancelled", "Attention");
                }
            }
            formSelect.Dispose();
        }