Exemple #1
0
        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;
        }
Exemple #2
0
        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
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Console.WriteLine("Contestant number " + contestant.RegistrationNumber + " is " + contestant.firstName + " " + contestant.lastName + ".");
 }
Exemple #5
0
 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);
 }
Exemple #7
0
 public void MakeContestant()
 {
     Contestant _contestant = new Contestant();
 }
 public void RegisterContestant(Contestant contestant)
 {
     contestant.registrationNumber = counter;
     contestantName.Add(contestant.registrationNumber, contestant);
     counter++;
 }
Exemple #9
0
 //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;
 }
Exemple #12
0
 public void PrintContestantInfo(Contestant contestant)
 {
     UserInterface.DisplayWinner(contestant);
 }
Exemple #13
0
 //member methods
 public void RegisterContestant(Contestant contestant)
 {
     //add to dictionary
     contestants.Add(contestant.RegistrationNumber, contestant);
 }
Exemple #14
0
 public void AddContestant(Contestant contestant)
 {
     contestants.Add(contestant);
 }
Exemple #15
0
 public static void PrintContestantUI(Contestant contestant)
 {
     Console.WriteLine($"{contestant.registrationNumber}: {contestant.firstName} {contestant.lastName}, {contestant.email}");
 }
Exemple #16
0
 public void PrintContestantInfo(Contestant contestant)
 {
 }
Exemple #17
0
 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);
 }
Exemple #20
0
 //Member Methods
 public void RegisterContestant(Contestant contestant)
 {
     dictionaryNumber++;
     contestants.Add(dictionaryNumber, contestant);
 }
Exemple #21
0
 public void RegisterContestant(Contestant contestant)
 {
     dict.Add(contestant.RegNumber, contestant.FirstName + " " + contestant.LastName);
 }
Exemple #22
0
 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);
 }
Exemple #23
0
 public void Registercontestant(Contestant contestant)
 {
     contestants.Add(entries, contestant);
     contestant.entryNum = entries;
     entries++;
 }
Exemple #24
0
 public void NotifyAllContestants()
 {
     Contestant contestantWinner = PickWinner();
     //contestants[]
 }
Exemple #25
0
 public void RegisterContestant(Contestant contestant)
 {
     contestantDictionary.Add(contestants, contestant);
     contestants++;
 }
Exemple #26
0
 //DOES
 public void RegisterContestant(Contestant contestant)
 {
     dictionaryOfContestants.Add(EntryNo, contestant);
 }
Exemple #27
0
 //member methods (CAN DO)
 public void RegisterContestant(Contestant contestant)
 {
     numberOfRegisteredContestants++;
     contestants.Add(contestant.RegistrationNumber, contestant);
 }
Exemple #28
0
 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();
 }