private void sendPreEventReportToolStripMenuItem_Click(object sender, EventArgs e) { var recipient = new MailAddress("*****@*****.**", "Henchman Office"); int stones = 0; string message = ""; string name = lstEvents.SelectedItems[0].Text; string eventType = lstEvents.SelectedItems[0].SubItems[1].Text; if (eventType == "Tournament") { Tournament tournament = Config.Settings.GetTournament(name); if (tournament.PreEventSent) if (MessageBox.Show("You have already sent a Pre-Event Report for this Event. Are you sure you " + "want to send the report again?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No) return; foreach (var id in tournament.PlayerIDs) if (Config.Settings.GetPlayer(id).Name.ToLower() != Config.Settings.SMTPFromName.ToLower()) stones += 2; if (stones > 30) stones = 30; message += "Real Name: " + Config.Settings.SMTPFromName + "\r\n"; message += "Forum Name: " + Config.Settings.ForumName + "\r\n"; message += "Event Type: Tournament\r\n"; message += "Date and Time of Event: " + tournament.Date.ToString("yyyy-MM-dd hh:mm tt") + "\r\n"; message += "Location of Event: " + tournament.Location + "\r\n"; message += "Estimated Soulstones: " + stones.ToString() + " Soulstones\r\n"; message += "Link to Event on the Wyrd Forums: " + (tournament.ForumURL.Length > 0 ? tournament.ForumURL : "[INSERT LINK HERE]") + "\r\n"; } else { League league = Config.Settings.GetLeague(name); if (league.PreEventSent) if (MessageBox.Show("You have already sent a Pre-Event Report for this Event. Are you sure you " + "want to send the report again?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.No) return; string leagueType = ""; if (league.Achievements.Count > 0 && league.Format != EventFormat.None) leagueType = "Achievement and Competitive League"; else if (league.Achievements.Count > 0) leagueType = "Achievement League"; else leagueType = "Competitive League"; //foreach (string ID in league.Players) // if (Config.Settings.GetPlayer(ID).Name.ToLower() != Config.Settings.SMTPFromName.ToLower()) // stones += 3; //if (stones > 45) stones = 45; message += "Real Name: " + Config.Settings.SMTPFromName + "\r\n"; message += "Forum Name: " + Config.Settings.ForumName + "\r\n"; message += "Event Type: " + leagueType + "\r\n"; message += "Dates of Event: " + league.StartDate.ToString("yyyy-MM-dd"); if (league.StartDate.ToString("yyyyMMdd") == league.EndDate.ToString("yyyyMMdd")) message += " (One Day League)\r\n"; else message += " through " + league.EndDate.ToString("yyyy-MM-dd") + "\r\n"; message += "Location of Event: " + league.Location + "\r\n"; //message += "Estimated Soulstones: " + stones.ToString() + " Soulstones\r\n"; message += "Estimated Soulstones: [3 Soulstones per Player] (maximum 45)\r\n"; message += "Link to Event on the Wyrd Forums: " + (league.ForumURL.Length > 0 ? league.ForumURL : "[INSERT LINK HERE]") + "\r\n"; } var dialog = new frmSendEmail("Pre Event Report: " + name, "Please verify ALL information is " + "accurate and filled in! Once you have confirmed the details, " + "and added any further notes of your " + "own if desired, press Send.", recipient, "Pre Event report: " + name, null, message); DialogResult result = dialog.ShowDialog(); dialog.Close(); if (result == DialogResult.OK) { if (eventType == "Tournament") { Tournament tournament = Config.Settings.GetTournament(name); tournament.PreEventSent = true; } else { League league = Config.Settings.GetLeague(name); league.PreEventSent = true; } Config.Settings.SaveEvents(); } }
private void sendPostEventReportToolStripMenuItem_Click(object sender, EventArgs e) { var recipient = new MailAddress("*****@*****.**", "Henchman Office"); int stones = 0; string message = ""; string name = lstEvents.SelectedItems[0].Text; string eventType = lstEvents.SelectedItems[0].SubItems[1].Text; if (eventType == "Tournament") { Tournament tournament = Config.Settings.GetTournament(name); if (!tournament.Completed) if (MessageBox.Show("This Tournament is not registered as having completed yet. Are you sure you " + "wish to send a Post Event report?", "Event Not Completed", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.No) return; foreach (var id in tournament.Players.Keys) if (Config.Settings.GetPlayer(id).Name.ToLower() != Config.Settings.SMTPFromName.ToLower()) stones += 2; if (stones > 30) stones = 30; message += "Real Name: " + Config.Settings.SMTPFromName + "\r\n"; message += "Forum Name: " + Config.Settings.ForumName + "\r\n"; message += "Event Type: Tournament\r\n"; message += "Date and Time of Event: " + tournament.Date.ToString("yyyy-MM-dd hh:mm tt") + "\r\n"; message += "Location of Event: " + tournament.Location + "\r\n"; message += "Soulstones Earned: " + stones.ToString() + " Soulstones\r\n"; message += "Link to Event on the Wyrd Forums: " + (tournament.ForumURL.Length > 0 ? tournament.ForumURL : "[INSERT LINK HERE]") + "\r\n"; } else { var pastReference = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0); League league = Config.Settings.GetLeague(name); if (league.EndDate >= pastReference) if (MessageBox.Show("This League's end date has not passed yet. Are you sure you " + "wish to send a Post Event report?", "Event Not Completed", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2) == DialogResult.No) return; string leagueType = ""; if (league.Achievements.Count > 0 && league.Format != EventFormat.None) leagueType = "Achievement and Competitive League"; else if (league.Achievements.Count > 0) leagueType = "Achievement League"; else leagueType = "Competitive League"; foreach (string ID in league.Players) if (Config.Settings.GetPlayer(ID).Name.ToLower() != Config.Settings.SMTPFromName.ToLower()) stones += 3; if (stones > 45) stones = 45; message += "Real Name: " + Config.Settings.SMTPFromName + "\r\n"; message += "Forum Name: " + Config.Settings.ForumName + "\r\n"; message += "Event Type: " + leagueType + "\r\n"; message += "Dates of Event: " + league.StartDate.ToString("yyyy-MM-dd"); if (league.StartDate.ToString("yyyyMMdd") == league.EndDate.ToString("yyyyMMdd")) message += " (One Day League)\r\n"; else message += " through " + league.EndDate.ToString("yyyy-MM-dd") + "\r\n"; message += "Location of Event: " + league.Location + "\r\n"; message += "Soulstones Earned: " + stones.ToString() + " Soulstones\r\n"; message += "Link to Event on the Wyrd Forums: " + (league.ForumURL.Length > 0 ? league.ForumURL : "[INSERT LINK HERE]") + "\r\n"; } var dialog = new frmSendEmail("Post Event Report: " + name, "Please verify ALL information is " + "accurate and filled in! Once you have confirmed the details, " + "and added any further notes of your " + "own if desired, press Send.", recipient, "Post Event report: " + name, null, message); DialogResult result = dialog.ShowDialog(); dialog.Close(); if (result == DialogResult.OK) { if (eventType == "Tournament") { Tournament tournament = Config.Settings.GetTournament(name); tournament.PostEventSent = true; } else { League league = Config.Settings.GetLeague(name); league.PostEventSent = true; } Config.Settings.SaveEvents(); } }
private void sendFeedbackToolStripMenuItem_Click(object sender, EventArgs e) { var dialog = new frmSendEmail("Feedback Form", "This form will send an email to the developer " + "directly. Please list as much details as you can when filling out the form. (Be sure to have " + "configured SMTP settings first.)", new MailAddress("*****@*****.**", "Chris Dundon"), "Suggestions for the Logbook", "Logbook Feedback"); dialog.ShowDialog(); dialog.Close(); }