Esempio n. 1
0
        private void FormModifyIssue_Load(object sender, EventArgs e)
        {
            FormSelectIssue form = new FormSelectIssue(projectId);

            form.ShowDialog();
            CenterToScreen();
            if (form.DialogResult != DialogResult.OK)
            {
                Close();
            }
            else
            {
                currentIssue = repository.GetIssueById(form.selectedId);
                foreach (AppUser x in userRepo.GetAll())
                {
                    discovererDropDown.Items.Add(x.LastName + ", " + x.FirstName);
                }
                discovererDropDown.SelectedIndex = 0;
                idTextBox.Text                  = currentIssue.Id.ToString();
                titleTextBox.Text               = currentIssue.Title;
                dateTimePicker.Value            = currentIssue.DiscoveryDate;
                discovererDropDown.SelectedItem = currentIssue.Discoverer;
                componentTextBox.Text           = currentIssue.Component;
                statusDropDown.SelectedIndex    = currentIssue.IssueStatusId;
                descriptionTextBox.Text         = currentIssue.InitialDescription;
            }
        }
Esempio n. 2
0
        private void issuesRemoveToolStripMenuItem_Click(object sender, System.EventArgs e)
        {
            Issue               issue;
            FormSelectIssue     form = new FormSelectIssue(_CurrentProjectId);
            FakeIssueRepository repo = new FakeIssueRepository();
            DialogResult        result;

            form.ShowDialog();
            if (form.DialogResult == DialogResult.OK)
            {
                issue  = repo.GetIssueById(form.selectedId);
                result = MessageBox.Show("Are you sure you want to remove: " + issue.Title + "?", "Confirmation", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    repo.Remove(issue);
                }
                else
                {
                    MessageBox.Show("Remove canceled.", "Attention", MessageBoxButtons.OK);
                }
            }
            form.Dispose();
        }