示例#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;
        }
示例#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
        }
示例#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);
            }
        }
示例#4
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Console.WriteLine("Contestant number " + contestant.RegistrationNumber + " is " + contestant.firstName + " " + contestant.lastName + ".");
 }
示例#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");
 }
示例#6
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Console.WriteLine(contestant.FirstName + contestant.LastName);
     Console.WriteLine(contestant.EmailAddress);
     Console.WriteLine(contestant.RegistrationNumber);
 }
示例#7
0
 public void MakeContestant()
 {
     Contestant _contestant = new Contestant();
 }
 public void RegisterContestant(Contestant contestant)
 {
     contestant.registrationNumber = counter;
     contestantName.Add(contestant.registrationNumber, contestant);
     counter++;
 }
示例#9
0
 //Member methods
 public void RegisterContestant(Contestant contestant)
 {
     contestant.registrationNumber = contestants.Count + 1;
     contestants.Add(contestant.registrationNumber, contestant);
 }
示例#10
0
 //functions
 public void RegisterContestant(Contestant contestant, Sweepstakes sweepstakes)
 {
     sweepstakes.listOfContestants.Add(contestant);
 }
示例#11
0
 public void SetWinnerBool()
 {
     winner          = PickWinner();
     winner.IsWinner = true;
 }
示例#12
0
 public void PrintContestantInfo(Contestant contestant)
 {
     UserInterface.DisplayWinner(contestant);
 }
示例#13
0
 //member methods
 public void RegisterContestant(Contestant contestant)
 {
     //add to dictionary
     contestants.Add(contestant.RegistrationNumber, contestant);
 }
示例#14
0
 public void AddContestant(Contestant contestant)
 {
     contestants.Add(contestant);
 }
示例#15
0
 public static void PrintContestantUI(Contestant contestant)
 {
     Console.WriteLine($"{contestant.registrationNumber}: {contestant.firstName} {contestant.lastName}, {contestant.email}");
 }
示例#16
0
 public void PrintContestantInfo(Contestant contestant)
 {
 }
示例#17
0
 public void PrintContestantInfo(Contestant contestant)
 {
     Console.WriteLine("The Winner is " + contestant);
     Console.ReadLine();
     Console.Clear();
 }
示例#18
0
 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);
 }
示例#20
0
 //Member Methods
 public void RegisterContestant(Contestant contestant)
 {
     dictionaryNumber++;
     contestants.Add(dictionaryNumber, contestant);
 }
示例#21
0
 public void RegisterContestant(Contestant contestant)
 {
     dict.Add(contestant.RegNumber, contestant.FirstName + " " + contestant.LastName);
 }
示例#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);
 }
示例#23
0
 public void Registercontestant(Contestant contestant)
 {
     contestants.Add(entries, contestant);
     contestant.entryNum = entries;
     entries++;
 }
示例#24
0
 public void NotifyAllContestants()
 {
     Contestant contestantWinner = PickWinner();
     //contestants[]
 }
示例#25
0
 public void RegisterContestant(Contestant contestant)
 {
     contestantDictionary.Add(contestants, contestant);
     contestants++;
 }
示例#26
0
 //DOES
 public void RegisterContestant(Contestant contestant)
 {
     dictionaryOfContestants.Add(EntryNo, contestant);
 }
示例#27
0
 //member methods (CAN DO)
 public void RegisterContestant(Contestant contestant)
 {
     numberOfRegisteredContestants++;
     contestants.Add(contestant.RegistrationNumber, contestant);
 }
示例#28
0
 public void PrintContestantInfo(Contestant contestant)
 {
     UserInterface.PrintContestantUI(contestant);
 }
示例#29
0
 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();
 }