public FormDashboard(string pname) { InitializeComponent(); this.CenterToParent(); int y = 0; foreach (Project p in FakeProjectRepository._Projects) { if (pname == p.Name) { id = p.Id; } } DateTime today = DateTime.Today; int year = today.Year; List <string> Months = newissue.GetIssuesByMonth(id); foreach (string x in Months) { y = 0; foreach (Issue t in FakeIssueRepository._Issues) { if (t.DiscoveryDate.Month.ToString() == x) { y++; } } listBox1.Items.Add(year + " - " + x + ": " + y); } List <string> Discovered = newissue.GetIssuesbyDiscoverer(id); foreach (string x in Discovered) { y = 0; foreach (Issue t in FakeIssueRepository._Issues) { if (t.Discoverer == x) { y++; } } foreach (AppUser user in FakeAppUserRepository._AppUsers.Values) { if (user.UserName == x) { listBox2.Items.Add(user.LastName + ", " + user.FirstName + ": " + y); } } } label4.Text = newissue.GetTotalNumberOfIssues(id).ToString(); }
private void IssueDashboard_Load(object sender, EventArgs e) { List <string> text = IssueRepository.GetIssuesByDiscoverer(_SelectedProjectId); foreach (string s in text) { listbxDiscoverer.Items.Add(s); } List <string> months = IssueRepository.GetIssuesByMonth(_SelectedProjectId); foreach (string m in months) { listbxMonth.Items.Add(m); } lblTotalIssues.Text = IssueRepository.GetTotalNumberOfIssues(_SelectedProjectId).ToString(); }
private void UpdateIssuesByMonth(int projectId) { FakeIssueRepository issueRepository = new FakeIssueRepository(); List <string> issuesByMonthList = issueRepository.GetIssuesByMonth(projectId); var issuesByMonthCount = from issue in issuesByMonthList group issue by issue into monthGroup select new { Month = monthGroup.Key.ToString() + ": " + monthGroup.Count().ToString() }; for (int i = 0; i < issuesByMonthCount.Count(); i++) { string line = parseIssuesByMonth(issuesByMonthCount.ElementAt(i).ToString()); listBoxIssuesByMonth.Items.Add(line); } }
private void FormDashboard_Load(object sender, EventArgs e) { this.CenterToParent(); int i = _Issues.GetTotalNumberOfIssues(_selId); IDBox.Text = (i.ToString()); List <String> IssueMonth = _Issues.GetIssuesByMonth(_selId); List <String> users = _Issues.GetIssuesByDiscoverer(_selId); foreach (string monthly in IssueMonth) { MonthBox.Items.Add(monthly); } foreach (string DiscoverersIssues in users) { DiscoverBox.Items.Add(DiscoverersIssues); } }