コード例 #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();
            }
        }
コード例 #2
0
        private void modifyButton_Click(object sender, EventArgs e)
        {
            // Better make sure it isn't the empty string or all blanks
            string newProjectName = modifyTextbox.Text.Trim();

            if (newProjectName == "")
            {
                MessageBox.Show("Feature name cannot be empty or blank", "Attention");
                return;
            }
            FakeFeatureRepository fake2 = new FakeFeatureRepository();

            if (fake2.isDuplicate(newProjectName))
            {
                MessageBox.Show("Feature title already exists.", "Attention");
                return;
            }
            Feature feat = new Feature
            {
                ID    = _selectId,
                Title = modifyTextbox.Text.Trim()
            };

            string result = fake2.Modify(feat);

            if (result != FakeFeatureRepository.NO_ERROR)
            {
                MessageBox.Show("Error modifying title. Error: " + result);
            }
            else
            {
                MessageBox.Show("Title modification successful.", "Information");
                this.Close();
            }
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            selectedFeature.Title = this.featureToModify.Text.ToString().Trim();
            FakeFeatureRepository modifiedFeature = new FakeFeatureRepository();
            string mdfy = modifiedFeature.Modify(selectedFeature);

            if (string.IsNullOrEmpty(mdfy))
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show(mdfy, "Error !");
            }
        }
コード例 #4
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            temporaryFeature.Title     = textBoxTitle.Text.Trim();
            temporaryFeature.Id        = selectedFeauture.Id;
            temporaryFeature.ProjectId = selectedFeauture.ProjectId;
            string result = FakeFeature.Modify(temporaryFeature);

            if (result != FakeFeatureRepository.NO_ERROR)
            {
                MessageBox.Show("Error modifying feature. Error: " + result);
            }
            else
            {
                MessageBox.Show("Feature modification successful.", "Information");
                this.Close();
            }
        }
コード例 #5
0
        private void ModifyFeatureButton_Click(object sender, EventArgs e)
        {
            Feature featureToBeModifiedAs = new Feature();

            featureToBeModifiedAs.Title     = this.TitleTextBox.Text;
            featureToBeModifiedAs.ProjectId = feature.ProjectId;
            featureToBeModifiedAs.Id        = feature.Id;

            String featureToModify = featureRepository.Modify(featureToBeModifiedAs);

            if (!featureToModify.Equals(""))
            {
                MessageBox.Show(featureToModify, "Attention");
            }
            else
            {
                this.Close();
            }
        }