public FormRequirementSelect(int selectedProjectId) { InitializeComponent(); CenterToScreen(); this.selectedProjectId = selectedProjectId; FakeFeatureRepository fakeFeature = new FakeFeatureRepository(); List <Feature> featureList = fakeFeature.GetAll(this.selectedProjectId); foreach (Feature feat in featureList) { featureSelectComboBox.Items.Add(feat.Title); } }
private void featureSelectComboBox_SelectedIndexChanged(object sender, EventArgs e) { FakeFeatureRepository fakeFeature = new FakeFeatureRepository(); Feature selectedFeature = fakeFeature.GetFeatureByTitle(featureSelectComboBox.SelectedItem.ToString()); this.selectedFeatureId = selectedFeature.Id; requirementDataGridView1.Rows.Clear(); FakeRequirementRepository fakereq = new FakeRequirementRepository(); List <Requirement> requirementList = fakereq.GetAll(this.selectedProjectId); foreach (Requirement req in requirementList) { if (req.FeatureId == this.selectedFeatureId) { requirementDataGridView1.Rows.Add(req.Id, req.Statement); } } }