public FormIssueDashboard(int ProjectId) { InitializeComponent(); CenterToScreen(); FakeIssueRepository = new FakeIssueRepository(); currentProjectId = ProjectId; numberOfIssuesLabel.Text = "Total Number of Issues: " + FakeIssueRepository.GetTotalNumberOfIssues(currentProjectId); List <string> issueMonths = FakeIssueRepository.GetIssuesByMonth(currentProjectId); List <string> issueDicoverers = FakeIssueRepository.GetIssuesByDiscoverer(currentProjectId); foreach (string s in issueMonths) { issuesMonthListBox.Items.Add(s); } foreach (string s in issueDicoverers) { issuesDiscovererListBox.Items.Add(s); } }
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(); }