Exemplo n.º 1
0
        private void CreateFeatureButton_Click(object sender, EventArgs e)
        {
            string errorMessage = "x";

            if (operationType == 0)
            {
                Feature newFeature = new Feature();

                newFeature.ProjectId = selectedProject;
                newFeature.Title     = FeatureTitleBox.Text;
                errorMessage         = formFeatureRepo.Add(newFeature);
            }

            else if (operationType == 1)
            {
                modifyFeature.Title = FeatureTitleBox.Text;
                errorMessage        = formFeatureRepo.Modify(modifyFeature);
            }

            if (errorMessage != "")
            {
                MessageBox.Show(errorMessage, "", MessageBoxButtons.OK);
            }

            else
            {
                Dispose();
            }
        }
Exemplo n.º 2
0
        private void CreateFeatureButton_Click(object sender, EventArgs e)
        {
            feature.Title     = TitleTextBox.Text;
            feature.ProjectId = projectId;

            string result = featureRepository.Add(feature);

            if (!result.Equals(""))
            {
                MessageBox.Show(result, "Attention");
            }
            else
            {
                this.Close();
            }
        }
Exemplo n.º 3
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            Feature feature = new Feature();

            feature.ProjectId = selected_project_id;
            feature.Title     = textBox1.Text.Trim();
            string result = fakeFeature.Add(feature);

            if (result == FakeFeatureRepository.NO_ERROR)
            {
                MessageBox.Show("Feature Added Successfully");
            }
            else
            {
                MessageBox.Show("Feature not added, " + result, "Attention");
            }
            this.Close();
        }
Exemplo n.º 4
0
        private void CreateFeat_Click(object sender, EventArgs e)
        {
            FakeFeatureRepository myFeatures = new FakeFeatureRepository();
            Feature newFeature = new Feature();

            //newFeature.id = myFeatures.getNextFeatureId();
            newFeature.ProjectId = currentProject;
            newFeature.Title     = this.newFeatTitle.Text.Trim();

            string addition = myFeatures.Add(newFeature);

            if (!string.IsNullOrEmpty(addition))
            {
                MessageBox.Show(addition, "ERROR !");
            }
            else
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }
Exemplo n.º 5
0
        private void createButton_Click(object sender, EventArgs e)
        {
            FakeFeatureRepository feat = new FakeFeatureRepository();
            Feature f = new Feature();

            f.ID        = feat.GetNextFeatureID(_selectProj);
            f.ProjectID = _selectProj;

            if (feat.isDuplicate(featTextBox.Text.Trim()) == true)
            {
                MessageBox.Show("Title Must Be Unique", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (featTextBox.Text.Trim() == "")
            {
                MessageBox.Show("Title Must Have a Value", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                f.Title = featTextBox.Text.Trim();
                feat.Add(f);
            }
            this.Close();
        }