コード例 #1
0
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex > 0)
     {
         dataGridView1.Enabled = true;
         btnSelect.Enabled     = true;
         Feature            selected_feature = fake.GetFeatureByTitle(comboBox1.SelectedItem.ToString());
         List <Requirement> list             = fakeRequiremnet.GetAll(selected_project);
         dataGridView1.Rows.Clear();
         dataGridView1.Refresh();
         foreach (Requirement r in list)
         {
             if (r.FeatureId == selected_feature.Id)
             {
                 int             rowid = dataGridView1.Rows.Add();
                 DataGridViewRow row   = dataGridView1.Rows[rowid];
                 row.Cells["ID"].Value          = r.Id.ToString();
                 row.Cells["Requirement"].Value = r.Statement;
             }
         }
     }
     else
     {
         dataGridView1.Enabled = false;
         btnSelect.Enabled     = false;
     }
 }
コード例 #2
0
        private void CrtReq_Click(object sender, EventArgs e)
        {
            FakeRequirementRepository myReqs = new FakeRequirementRepository();
            FakeFeatureRepository     myFs   = new FakeFeatureRepository();
            Feature newF = new Feature();

            newF = myFs.GetFeatureByTitle(this.selFeat.SelectedItem.ToString());
            Requirement newR = new Requirement();

            newR.ProjectId = curProj;
            newR.FeatureId = newF.id;
            newR.Statement = this.statMentBox.Text.Trim();


            string addReq = myReqs.Add(newR);

            if (string.IsNullOrEmpty(addReq))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show(addReq, "Error !");
            }
        }
コード例 #3
0
        private void FeatureComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            Feature testFeature = new Feature();

            testFeature      = featureRepository.GetFeatureByTitle(FeatureComboBox.Text, currentProjectId);
            currentFeatureId = testFeature.Id;
            SetTable();
        }
コード例 #4
0
        private void selFeat_SelectedIndexChanged(object sender, EventArgs e)
        {
            FakeRequirementRepository myReqs  = new FakeRequirementRepository();
            FakeFeatureRepository     myFeats = new FakeFeatureRepository();
            Feature newFeature = new Feature();

            newFeature = myFeats.GetFeatureByTitle(this.selFeat.SelectedItem.ToString());
            if (newFeature.id != -1)
            {
                this.statMentBox.Enabled = true;
                this.CrtReq.Enabled      = true;
            }
            else
            {
                this.statMentBox.Enabled = false;
                this.CrtReq.Enabled      = false;
            }
        }
コード例 #5
0
        private void CreateRequirementButton_Click(object sender, EventArgs e)
        {
            Feature     feature     = featureRepository.GetFeatureByTitle(this.FeatureComboBox.GetItemText(FeatureComboBox.SelectedItem), currentProjectId);
            Requirement requirement = new Requirement();

            requirement.FeatureId = feature.Id;
            requirement.ProjectId = currentProjectId;
            requirement.Statement = StatementTextBox.Text;
            string result = requirementRepository.Add(requirement);

            if (!result.Equals(""))
            {
                MessageBox.Show(result, "Attention");
            }
            else
            {
                this.Close();
            }
        }
コード例 #6
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Feature myFeature = F.GetFeatureByTitle(this.featureList.SelectedItem.ToString());

            this.reqList.Rows.Clear();

            if (myFeature.id == -1)
            {
                this.reqList.Rows.Clear();
                //this.reqList.Rows.Clear();
                this.label2.Enabled  = false;
                this.reqList.Enabled = false;
                this.selReq.Enabled  = false;
                this.reqList.ColumnHeadersVisible = false;
            }
            else
            {
                List <Requirement> Rs = new List <Requirement>();
                Rs = R.GetAll(currentProject);

                foreach (Requirement r in Rs)
                {
                    if (r.FeatureId == myFeature.id)
                    {
                        this.reqList.Rows.Add(r.id.ToString(), r.Statement);
                    }
                }

                this.reqList.ColumnHeadersVisible = true;
                this.label2.Enabled = true;

                if (this.reqList.Rows.Count > 0)
                {
                    this.reqList.Enabled = true;
                    this.selReq.Enabled  = true;
                }
                else
                {
                    this.reqList.Enabled = false;
                    this.selReq.Enabled  = false;
                }
            }
        }
コード例 #7
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            Requirement requirement = new Requirement();
            Feature     feature     = fake.GetFeatureByTitle(comboBox1.SelectedItem.ToString());

            requirement.FeatureId = feature.Id;
            requirement.Statement = richTextBox1.Text.Trim();
            requirement.ProjectId = selected_project;
            string result = fakeRequiremnet.Add(requirement);

            if (result == FakeFeatureRepository.NO_ERROR)
            {
                MessageBox.Show("Requirement Added Successfully");
            }
            else
            {
                MessageBox.Show("Requirement not added, " + result, "Attention");
            }
            this.Close();
        }
コード例 #8
0
        private void mdfyReq_Click(object sender, EventArgs e)
        {
            Requirement modifiedRequirement = new Requirement();

            modifiedRequirement.id        = selectedRequirement.id;
            modifiedRequirement.ProjectId = selectedRequirement.ProjectId;
            modifiedRequirement.FeatureId = F.GetFeatureByTitle(this.featsList.Text.ToString()).id;
            modifiedRequirement.Statement = this.statBox.Text.ToString();

            string modify = R.Modify(modifiedRequirement);

            if (string.IsNullOrEmpty(modify))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show(modify, "Error !");
            }
        }