public string Modify(Requirement requirement)
        {
            string error;

            if (requirement.Statement == "")
            {
                error = EMPTY_STATEMENT_ERROR;
            }
            else if (requirements.Where(x => x.Statement.CompareTo(requirement.Statement) == 0).Count() != 0)
            {
                error = DUPLICATE_STATEMENT_ERROR;
            }
            else
            {
                error = NO_ERROR;
                requirements[requirements.FindIndex(x => x.Id == requirement.Id)].Statement = requirement.Statement;
            }
            return(error);
        }
        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();
            }
        }
 public string Remove(Requirement requirement)
 {
     requirements.RemoveAll(x => x.Id == requirement.Id);
     return(NO_ERROR);
 }