コード例 #1
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();
            }
        }
コード例 #2
0
 public FormCreateRequirement(int project)
 {
     selected_project = project;
     fake             = new FakeFeatureRepository(selected_project);
     fakeRequiremnet  = new FakeRequiremnetRepository(selected_project);
     InitializeComponent();
 }
コード例 #3
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 !");
            }
        }
コード例 #4
0
 public FormCreateFeature(int selected_project)
 {
     InitializeComponent();
     this.CenterToParent();
     selected_project_id = selected_project;
     fakeFeature         = new FakeFeatureRepository(selected_project);
 }
コード例 #5
0
        public FormSelectFeature(FakeFeatureRepository featureRepo, int projectId, int type)
        {
            InitializeComponent();

            formFeatureRepo = featureRepo;
            selectedProject = projectId;
            operationType   = type;
        }
コード例 #6
0
 private void FormModifyFeature_Load(object sender, EventArgs e)
 {
     this.CenterToScreen();
     FakeFeature       = new FakeFeatureRepository(_SelectedProjectId);
     selectedFeauture  = FakeFeature.GetFeatureByID(featureID);
     textBoxTitle.Text = selectedFeauture.Title;
     temporaryFeature  = new Feature();
 }
コード例 #7
0
        private void FormModifyFeatureTitle_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeFeatureRepository fake = new FakeFeatureRepository();
            Feature f1 = fake.GetFeatureByID(_selectId);

            modifyTextbox.Text = f1.Title;
        }
コード例 #8
0
        public FormCreateFeature(FakeFeatureRepository featureRepo, int project, int type, Feature feature)
        {
            InitializeComponent();

            formFeatureRepo = featureRepo;
            selectedProject = project;
            operationType   = type;
            modifyFeature   = feature;
        }
コード例 #9
0
        public FormSelectRequirement(FakeFeatureRepository featureRepo, FakeRequirementRepository requirementRepo, int project, int type)
        {
            InitializeComponent();

            formFeatureRepo     = featureRepo;
            formRequirementRepo = requirementRepo;
            selectedProject     = project;
            operationType       = type;
        }
コード例 #10
0
 public FormRequirementModify(int project, int selected_requirement)
 {
     InitializeComponent();
     this.CenterToParent();
     selected_project = project;
     fake             = new FakeFeatureRepository(selected_project);
     fakeRequiremnet  = new FakeRequiremnetRepository(selected_project);
     selected_r       = selected_requirement;
 }
コード例 #11
0
 public FormSelectRequirement(int project)
 {
     InitializeComponent();
     dataGridView1.ColumnCount     = 2;
     dataGridView1.Columns[0].Name = "ID";
     dataGridView1.Columns[1].Name = "Requirement";
     selected_project = project;
     fake             = new FakeFeatureRepository(selected_project);
     fakeRequiremnet  = new FakeRequiremnetRepository(selected_project);
 }
コード例 #12
0
        private void FormSelectFeatureToRemove_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeFeatureRepository myFeatures = new FakeFeatureRepository();
            List <Feature>        myList     = myFeatures.GetAll(curProjectId);

            foreach (Feature f in myList)
            {
                this.dataGridView1.Rows.Add(f.id.ToString(), f.Title);
            }
        }
コード例 #13
0
        private void selFeatToRem_Click(object sender, EventArgs e)
        {
            if (this.dataGridView1.SelectedRows.Count == 0)
            {
                MessageBox.Show("A feature must be selected", "Error !");
            }
            else
            {
                int             selectedIndex = this.dataGridView1.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow   = this.dataGridView1.Rows[selectedIndex];

                int    selectedFeatureId    = Convert.ToInt32(selectedRow.Cells["featureId"].Value);
                string selectedFeatureTitle = selectedRow.Cells["featTitle"].Value.ToString();

                Feature featureToRemove = new Feature();
                featureToRemove.id        = selectedFeatureId;
                featureToRemove.ProjectId = curProjectId;
                featureToRemove.Title     = selectedFeatureTitle;

                FakeRequirementRepository myReqs  = new FakeRequirementRepository();
                FakeFeatureRepository     myFeats = new FakeFeatureRepository();

                if (myReqs.CountByFeatureId(selectedFeatureId) > 0)
                {
                    DialogResult confirmation = MessageBox.Show(String.Format("There are one or more requirements associateed with this feature" +
                                                                              "These requirements will be destroyed if you remove this feature.Are you sure you want to remove : {0}", selectedFeatureTitle), "Confirmation", MessageBoxButtons.YesNo);

                    if (confirmation == DialogResult.Yes)
                    {
                        string success = myFeats.Remove(featureToRemove);


                        myReqs.RemoveByFeatureId(selectedFeatureId);
                        this.DialogResult = DialogResult.OK;
                        this.Close();
                    }

                    /*else
                     * {
                     *  this.DialogResult = DialogResult.Cancel;
                     *
                     * }*/
                }
                else
                {
                    DialogResult confirmation = MessageBox.Show(String.Format("Are you sure you want to remove : {0}", selectedFeatureTitle), "Confirmation", MessageBoxButtons.YesNo);
                    if (confirmation == DialogResult.Yes)
                    {
                        myFeats.Remove(featureToRemove);
                        this.Close();
                    }
                }
            }
        }
コード例 #14
0
        private void FormSelectFeature_Load(object sender, EventArgs e)
        {
            this.CenterToParent();

            List <Feature>        myList     = new List <Feature>();
            FakeFeatureRepository myFeatures = new FakeFeatureRepository();

            myList = myFeatures.GetAll(currentProject);

            foreach (Feature f in myList)
            {
                this.featList.Rows.Add(f.id.ToString(), f.Title);
            }
        }
コード例 #15
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 !");
            }
        }
コード例 #16
0
        private void FormCreateRequirement_Load(object sender, EventArgs e)
        {
            this.CenterToParent();

            FakeFeatureRepository Features   = new FakeFeatureRepository();
            List <Feature>        myFeatures = new List <Feature>();

            myFeatures = Features.GetAll(curProj);
            this.selFeat.Items.Add("< Make Selection >");
            foreach (Feature f in myFeatures)
            {
                this.selFeat.Items.Add(f.Title);
            }


            this.statMentBox.Enabled = false;
            this.CrtReq.Enabled      = false;
        }
コード例 #17
0
        private void FormRemoveFeature_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            FakeFeatureRepository fake     = new FakeFeatureRepository();
            List <Feature>        listfeat = fake.GetAll(_selectProj);

            dataRemove.ColumnCount      = 2;
            dataRemove.Columns[0].Name  = "Id";
            dataRemove.Columns[0].Width = 30;
            dataRemove.Columns[1].Name  = "Title";
            dataRemove.Columns[1].Width = 620;

            foreach (Feature f1 in listfeat)
            {
                string[] row = { f1.ID.ToString(), f1.Title };
                dataRemove.Rows.Add(row);
            }
        }
コード例 #18
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;
            }
        }
コード例 #19
0
        public FormSelectFeature(int project_id)
        {
            InitializeComponent();
            this.CenterToParent();
            btnSelect.Enabled                    = false;
            selected_id                          = project_id;
            fakeFeatureRepository                = new FakeFeatureRepository(selected_id);
            dataGridViewFeatures.ColumnCount     = 2;
            dataGridViewFeatures.Columns[0].Name = "ID";
            dataGridViewFeatures.Columns[1].Name = "Title";
            List <Feature> tmp = fakeFeatureRepository.GetAll(selected_id);

            foreach (Feature f in tmp)
            {
                int             rowid = dataGridViewFeatures.Rows.Add();
                DataGridViewRow row   = dataGridViewFeatures.Rows[rowid];
                row.Cells["ID"].Value    = f.Id.ToString();
                row.Cells["Title"].Value = f.Title;
            }
        }
コード例 #20
0
        private void FormModifySelectReq_Load_1(object sender, EventArgs e)
        {
            this.CenterToParent();
            string featTitle;
            FakeFeatureRepository FakeFeat = new FakeFeatureRepository();

            Flist = FakeFeat.GetAll(_SelectedProj);
            comboBoxFeature.Items.Add("<Make Selection>");
            comboBoxFeature.SelectedIndex = 0;

            foreach (Feature feat in Flist)
            {
                featTitle = feat.Title;
                comboBoxFeature.Items.Add(featTitle);
            }
            dataGridReqs.Enabled = false;
            buttonSelect.Enabled = false;

            this.comboBoxFeature.SelectedIndexChanged += new System.EventHandler(comboBoxFeat_SelectedIndexChanged);
        }
コード例 #21
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();
            }
        }
コード例 #22
0
        private void selectButton_Click(object sender, EventArgs e)
        {
            if (dataRemove.SelectedCells.Count < 0)
            {
                MessageBox.Show("A must be selected.", "Attention");
            }
            else
            {
                _selectID = dataRemove.SelectedCells[0].RowIndex;
                DataGridViewRow selectedRow = dataRemove.Rows[_selectID];
                int             sID         = Convert.ToInt32(selectedRow.Cells["ID"].Value);

                _selectID = sID;

                FakeFeatureRepository fake1 = new FakeFeatureRepository();
                Feature f2 = fake1.GetFeatureByID(_selectID);
                FakeRequirementRepository req = new FakeRequirementRepository();


                DialogResult result = MessageBox.Show("Are you sure you want to Remove:" + f2.Title, "Confirmation", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    DialogResult result2 = MessageBox.Show("There are Requirements associated with this Feature.\n" + "These Requirements will also be deleted.", "Confirmation", MessageBoxButtons.YesNo);
                    if (result2 == DialogResult.Yes)
                    {
                        string res = fake1.Remove(f2);
                        req.RemoveByFeatureID(_selectID);
                    }
                    else
                    {
                        MessageBox.Show("Remove Canceled", "Attention", MessageBoxButtons.OK);
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Remove Canceled", "Attention", MessageBoxButtons.OK);
                }
            }
        }
コード例 #23
0
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            FakeRequirementRepository freq1     = new FakeRequirementRepository();
            FakeFeatureRepository     fake2     = new FakeFeatureRepository();
            List <Feature>            listFeat1 = new List <Feature>();
            Requirement req = new Requirement();

            listFeat1 = fake2.GetAll(_selectProj);

            string s = comboBoxFeature.Text;

            foreach (Feature ft in listFeat1)
            {
                if (ft.Title == s)
                {
                    __selectFeat = ft.ID;
                }
            }


            req.ID        = freq1.GetNextReqID(_selectProj);
            req.ProjectID = _selectProj;
            req.FeatureID = __selectFeat;
            req.Statement = textBoxState.Text.Trim();

            string result = freq1.Add(req);

            if (result == "")
            {
                MessageBox.Show("Requirement Added Sucessfully", "", MessageBoxButtons.OK);
                this.Close();
            }
            else
            {
                MessageBox.Show(result, "Attention", MessageBoxButtons.OK);
                return;
            }
        }
コード例 #24
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();
        }
コード例 #25
0
        private void FormCreateReq_Load(object sender, EventArgs e)
        {
            this.CenterToParent();
            string isFeat;
            FakeFeatureRepository     fake     = new FakeFeatureRepository();
            FakeRequirementRepository freq     = new FakeRequirementRepository();
            List <Feature>            listFeat = new List <Feature>();

            listFeat = fake.GetAll(_selectProj);

            textBoxState.Enabled = false;
            buttonCreate.Enabled = false;

            comboBoxFeature.Items.Add("<Make Selection>");
            comboBoxFeature.SelectedIndex = 0;

            foreach (Feature f in listFeat)
            {
                isFeat = f.Title;
                comboBoxFeature.Items.Add(isFeat);
            }

            this.comboBoxFeature.SelectedIndexChanged += new System.EventHandler(comboBoxFeat_SelectedIndexChanged);
        }