コード例 #1
0
        private void selectbutton_Click(object sender, EventArgs e)
        {
            FormModifyIssue form = new FormModifyIssue(selectedId);

            form.ShowDialog();
            this.Close();
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows == null)
            {
                MessageBox.Show("A project must be selected.", "Attention");
            }
            else
            {
                string selectedId = dataGridView1.SelectedRows[0].Cells[0].Value + string.Empty;
                _SelectedIssueId = Convert.ToInt32(selectedId);
            }

            if (previousPage == 1)
            {
                this.Hide();
                FormModifyIssue form = new FormModifyIssue(_SelectedIssueId);
                form.ShowDialog();
                form.Dispose();
            }
            if (previousPage == 2)
            {
                this.Hide();
                DialogResult isSure = MessageBox.Show("Are you sure you want to remove: " + dataGridView1.SelectedRows[0].Cells[1].Value.ToString(), "Confirmation", MessageBoxButtons.YesNo);
                if (isSure == DialogResult.Yes)
                {
                    FakeIssueRepository repository = new FakeIssueRepository();
                    int      id          = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
                    string   title       = dataGridView1.SelectedRows[0].Cells[1].Value + string.Empty;
                    DateTime date        = Convert.ToDateTime(dataGridView1.SelectedRows[0].Cells[2].Value.ToString());
                    string   discoverer  = dataGridView1.SelectedRows[0].Cells[3].Value + string.Empty;
                    string   description = dataGridView1.SelectedRows[0].Cells[4].Value + string.Empty;
                    string   component   = dataGridView1.SelectedRows[0].Cells[5].Value + string.Empty;
                    string   status      = dataGridView1.SelectedRows[0].Cells[6].Value + string.Empty;
                    int      issuestatus = _StatusRepository.GetIdByStatus(status);

                    Issue issue = new Issue {
                        Id = id, Title = title, DiscoveryDate = date, Discoverer = discoverer, InitialDescription = description, Component = component, IssueStatusId = issuestatus
                    };


                    bool result = repository.Remove(issue);
                    if (result == true)
                    {
                        MessageBox.Show("Issue removed.", "Information");
                    }
                    else
                    {
                        MessageBox.Show("Error removing issue " + issue.Title, "Information");
                    }

                    Close();
                }
                if (isSure == DialogResult.No)
                {
                    MessageBox.Show("Remove canceled", "Attention", MessageBoxButtons.OK);
                    Close();
                }
            }
        }
コード例 #3
0
        private void issuesModifyToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            IssueSelect select = new IssueSelect(_CurrentAppUser, selected_id);

            select.ShowDialog();
            if (select.DialogResult == DialogResult.OK)
            {
                FormModifyIssue form = new FormModifyIssue(select.selectedIssueID, selected_id);
                form.ShowDialog();
                form.Dispose();
            }
            select.Dispose();
        }
コード例 #4
0
        private void issuesModifyToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            FormSelectIssue form   = new FormSelectIssue(_CurrentAppUser, 1);
            DialogResult    result = form.ShowDialog();

            if (result == DialogResult.OK)
            {
                int             selectedIssueId = form._SelectedIssueId;
                FormModifyIssue modifyIssue     = new FormModifyIssue(selectedIssueId);
            }

            form.Dispose();
        }