Example #1
0
 public FormRemoveFeature(int projectId)
 {
     InitializeComponent();
     this.projectId = projectId;
     repo           = new FakeFeatureRepository();
     DialogResult   = DialogResult.Cancel;
 }
Example #2
0
 public FormSelectFeature(int projectId)
 {
     InitializeComponent();
     CenterToScreen();
     selectedId        = projectId;
     featureRepository = new FakeFeatureRepository();
     DialogResult      = DialogResult.Cancel;
     foreach (Feature x in FakeFeatureRepository.features)
     {
         dataGridView1.Rows.Add(x.Id, x.Title);
     }
 }
Example #3
0
        private void createBtn_Click(object sender, EventArgs e)
        {
            FakeFeatureRepository featureRepository = new FakeFeatureRepository();
            Feature feature = new Feature();
            string  error;

            feature.Title     = titleTextbox.Text;
            feature.ProjectId = this.projectId;
            feature.Id        = FakeFeatureRepository.currentId;
            error             = featureRepository.Add(feature);
            if (error != FakeFeatureRepository.NO_ERROR)
            {
                MessageBox.Show(error, "", MessageBoxButtons.OK);
            }
            else
            {
                DialogResult = DialogResult.OK;
                Close();
            }
        }
        private void modifyBtn_Click(object sender, EventArgs e)
        {
            Requirement           requirement           = new Requirement();
            FakeFeatureRepository fakeFeatureRepository = new FakeFeatureRepository();
            string error;

            requirement.Id        = FakeRequirementRepository.currentId;
            requirement.ProjectId = this.projectId;
            requirement.Statement = statementTextbox.Text;
            requirement.FeatureId = fakeFeatureRepository.GetFeatureByTitle(featureComboBox.SelectedItem.ToString()).Id;
            error = repo.Modify(requirement);
            if (error != FakeRequirementRepository.NO_ERROR)
            {
                MessageBox.Show(error, "Attention", MessageBoxButtons.OK);
            }
            else
            {
                DialogResult = DialogResult.OK;
                Close();
            }
        }
Example #5
0
        private void featureComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            FakeFeatureRepository fakeFeatureRepository = new FakeFeatureRepository();

            foreach (DataGridViewRow x in requirementDataGridView.Rows)
            {
                requirementDataGridView.Rows.Remove(x);
            }

            if (featureComboBox.SelectedIndex != 0)
            {
                int featureId = fakeFeatureRepository.GetFeatureByTitle(featureComboBox.SelectedItem.ToString()).Id;
                foreach (Requirement x in FakeRequirementRepository.requirements.FindAll(x => x.FeatureId == featureId))
                {
                    requirementDataGridView.Rows.Add(x.Id, x.Statement);
                }
                selectBtn.Enabled = true;
            }
            else
            {
                selectBtn.Enabled = false;
            }
        }