Exemplo n.º 1
0
        private void buttonModify_Click(object sender, EventArgs e)
        {
            FakeRequirementRepository Freq = new FakeRequirementRepository();
            Requirement req = new Requirement();
            string      error;

            req.ProjectID = _ProjectID;
            req.FeatureID = _NewFeatID;
            req.ID        = _RequirementID;
            req.Statement = textBoxState.Text;

            error = Freq.Modify(req);
            if (error != "")
            {
                MessageBox.Show(error, "Attention");
            }
            else
            {
                MessageBox.Show("Requirement Successfully Modified!", "Attention");
                this.Close();
            }
        }
Exemplo n.º 2
0
 public string Add(Requirement requirement)
 {
     if (requirement.Statement == "")
     {
         return(EMPTY_STATEMENT_ERROR);
     }
     foreach (Requirement req in requirements)
     {
         if (requirement.Statement == req.Statement)
         {
             return(DUPLICATE_STATEMENT_ERROR);
         }
     }
     if (requirement.ProjectID == 0)
     {
         return(MISSING_PROJECTID_ERROR);
     }
     if (requirement.FeatureID == 0)
     {
         return(MISSING_FEATUREID_ERROR);
     }
     requirements.Add(requirement);
     return(NO_ERROR);
 }