// creates notification for not following the standards public void FollowingStandard(HomeDashboard hd, Triggers x) { NotificationButton a = new NotificationButton(); hd.Notification_Table.Controls.Add(a.createNotificationButton(x)); hd.Notification_Table.Show(); foreach (Button tb in hd.tableLayoutPanel1.Controls) { if (tb.Text == x.TeamName) { if (tb.Image == null) { tb.Image = WindowsFormsApp1.Properties.Resources.standardIcon; tb.ImageAlign = ContentAlignment.TopRight; } else if (tb.Image != null) { tb.Image = WindowsFormsApp1.Properties.Resources.both; tb.ImageAlign = ContentAlignment.TopRight; } } } }
public void CreateTeam(HomeDashboard obj, string name, string url) { // check if either box was empty if ((name != "") && (url != "")) { // replaced "!File.Exists(fileName)" with true if (!(Variables.db.CheckTeam(name, url))) { // create team Team team = new Team(name, url); Variables.db.AddTeam(team); CreateMembers(name, url); Triggers Trigger1 = new Triggers("teamCommit", name); Variables.db.AddTriggers(Trigger1); Triggers Trigger2 = new Triggers("teamMeeting", name); Variables.db.AddTriggers(Trigger2); Triggers Trigger3 = new Triggers("standard", name); Variables.db.AddTriggers(Trigger3); obj.tableLayoutPanel1.Show(); obj.Show(); var main = Application.OpenForms.OfType <HomeDashboard>().First(); Variables.TMInstance.Write(team); } else { MessageBox.Show("Either Team name or URL already exists"); } } else { MessageBox.Show("Both Team name or URL cannot be empty"); } }
// loads notifications for the teams in the Home Dashboard public void loadNotification(HomeDashboard hd, Triggers t) { if (t.Type == "teamMeeting") { TeamMeeting(hd, t); } else if (t.Type == "teamCommit") { TeamCommit(hd, t); } else if (t.Type == "standard") { FollowingStandard(hd, t); } }
// click method for close button of team notifications on HomeDahboard public void closeButton_Click(object sender, EventArgs e, Triggers t, HomeDashboard hd) { removeNotification(t); foreach (Button tb in hd.tableLayoutPanel1.Controls) { if (tb.Text == t.TeamName) { tb.Image = null; Application.OpenForms.OfType <HomeDashboard>().First().Notification_Table.Controls.Clear(); Application.OpenForms.OfType <HomeDashboard>().First().DisplayNotifications(); } } }