public static void SetEmail(Contestant contestant) { bool validEmail = false; string userEmail = ""; while (!validEmail) { Console.WriteLine("Please enter contestant's email address:"); userEmail = Console.ReadLine(); if (!userEmail.Contains("@") || !userEmail.Contains(".")) { Console.WriteLine("Invalid input, please try again."); } else { validEmail = true; } } contestant.email = userEmail; }
public void RegisterContestant(Contestant contestants) //insert sweepstakes? { counter = 1; Console.WriteLine("Enter first name"); contestant.firstName = Console.ReadLine(); Console.Clear(); Console.WriteLine("Enter last name"); contestant.lastName = Console.ReadLine(); Console.Clear(); Console.WriteLine("Enter Email "); contestant.email = Console.ReadLine(); Console.Clear(); contestant.registationNumber = counter; counter++; //todo }
public void SendEmailToWinner(Contestant contestant) { var message = new MimeMessage(); message.From.Add(new MailboxAddress("*****@*****.**")); message.To.Add(new MailboxAddress("*****@*****.**")); message.Subject = $"You are a winner of the {Name} sweepstakes!"; message.Body = new TextPart("plain") { Text = $"Hello {contestant.FirstName}," + $"You have won the {Name} sweepstakes! Please reply to this email to claim your winnings. " }; using (var client = new SmtpClient()) { client.ServerCertificateValidationCallback = (s, c, h, e) => true; client.Connect("smtp.gmail.com", 587, false); client.Authenticate("devCodeCampMailKit", ""); client.Send(message); client.Disconnect(true); } }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine("Contestant number " + contestant.RegistrationNumber + " is " + contestant.firstName + " " + contestant.lastName + "."); }
public static void DisplayWinner(Contestant contestant) { Console.WriteLine($"The winner of the sweepstakes is: {contestant.FirstName} {contestant.LastName}!\n\n{contestant.EmailAddress}\n\n"); }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine(contestant.FirstName + contestant.LastName); Console.WriteLine(contestant.EmailAddress); Console.WriteLine(contestant.RegistrationNumber); }
public void MakeContestant() { Contestant _contestant = new Contestant(); }
public void RegisterContestant(Contestant contestant) { contestant.registrationNumber = counter; contestantName.Add(contestant.registrationNumber, contestant); counter++; }
//Member methods public void RegisterContestant(Contestant contestant) { contestant.registrationNumber = contestants.Count + 1; contestants.Add(contestant.registrationNumber, contestant); }
//functions public void RegisterContestant(Contestant contestant, Sweepstakes sweepstakes) { sweepstakes.listOfContestants.Add(contestant); }
public void SetWinnerBool() { winner = PickWinner(); winner.IsWinner = true; }
public void PrintContestantInfo(Contestant contestant) { UserInterface.DisplayWinner(contestant); }
//member methods public void RegisterContestant(Contestant contestant) { //add to dictionary contestants.Add(contestant.RegistrationNumber, contestant); }
public void AddContestant(Contestant contestant) { contestants.Add(contestant); }
public static void PrintContestantUI(Contestant contestant) { Console.WriteLine($"{contestant.registrationNumber}: {contestant.firstName} {contestant.lastName}, {contestant.email}"); }
public void PrintContestantInfo(Contestant contestant) { }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine("The Winner is " + contestant); Console.ReadLine(); Console.Clear(); }
public void PrintContestantInfo(Contestant contestant) { Console.WriteLine("Contestant {1} is {2} years old.", name, age); }
public string PrintContestantInfo(Contestant contestant) { contestantInformation = String.Format(contestant.firstName, contestant.lastName); return(contestantInformation); }
//Member Methods public void RegisterContestant(Contestant contestant) { dictionaryNumber++; contestants.Add(dictionaryNumber, contestant); }
public void RegisterContestant(Contestant contestant) { dict.Add(contestant.RegNumber, contestant.FirstName + " " + contestant.LastName); }
public void PrintContestantWinnerInfo(Contestant contestant) { Console.WriteLine("First Name: " + contestantWinner.FirstName + " Last Name: " + contestantWinner.LastName); Console.WriteLine("Email Address: " + contestantWinner.EmailAddress); Console.WriteLine("Registration #: " + contestantWinner.RegistrationNumber); }
public void Registercontestant(Contestant contestant) { contestants.Add(entries, contestant); contestant.entryNum = entries; entries++; }
public void NotifyAllContestants() { Contestant contestantWinner = PickWinner(); //contestants[] }
public void RegisterContestant(Contestant contestant) { contestantDictionary.Add(contestants, contestant); contestants++; }
//DOES public void RegisterContestant(Contestant contestant) { dictionaryOfContestants.Add(EntryNo, contestant); }
//member methods (CAN DO) public void RegisterContestant(Contestant contestant) { numberOfRegisteredContestants++; contestants.Add(contestant.RegistrationNumber, contestant); }
public void PrintContestantInfo(Contestant contestant) { UserInterface.PrintContestantUI(contestant); }
public void PrintContestantInfo(Contestant contestant) { contestant.registrationNumber = contestants.Count; Console.WriteLine($"{contestant.registrationNumber} : {contestant.firstName} {contestant.lastName} : {contestant.emailAddress}"); }
public void PrintContestantInfo(Contestant contestant, int num) { Console.WriteLine("The name of the Winner is " + contestant.Contestants[num].array[0] + contestant.Contestants[num].array[1]); Console.WriteLine("The Email of the winner is " + contestant.Contestants[num].array[2]); Console.ReadKey(); }