/// <summary> /// Send a Mail Blast to the mailing list /// Reference: /// </summary> /// <param name="sweepstake"></param> public void SendMailBlast(Sweepstake sweepstake) { Console.WriteLine("Preparing to send e-mail blast!"); string emailSmtpServer = UserInterface.ShowPrompt("Enter an SMTP server e.g. smtp.gmail.com:"); string emailUserName = UserInterface.ShowPrompt("Enter e-mail username: "******"Enter e-mail password: "******"Winner! You win the " + sweepstake.GetSweepstakeName(); emailMessage.Body = "You are the winner " + currentWinner.firstName; smtpServer.Port = 587; smtpServer.Credentials = new NetworkCredential(emailUserName, emailUserPassword); smtpServer.EnableSsl = true; smtpServer.Send(emailMessage); }
/// <summary> /// A marketing and promotions method to bring in cash to the casino /// </summary> /// <param name="sweepstake"></param> private void PromoteSweepstake(Sweepstake sweepstake) { UserInterface.ShowDrawingWinner(); sweepstake.PickWinner(); UserInterface.ShowWinnerAnnouncement(); Console.WriteLine(sweepstake.GetSweepstakeName()); sweepstake.PrintContestantInfo(sweepstake.GetContestantWinner()); UserInterface.ShowMailingList(); SendMailBlast(sweepstake); }
/// <summary> /// Show the alert to the contestants /// </summary> /// <param name="sweepstake"></param> public void AlertContestants(Sweepstake sweepstake) { foreach (KeyValuePair <int, Contestant> contestant in sweepstake.GetSweepstakeContestants()) { bool isContestantWinner; isContestantWinner = contestant.Value == sweepstake.GetContestantWinner(); if (isContestantWinner) { UserInterface.ShowLooser(); } else { UserInterface.ShowWinner(); } } }