コード例 #1
0
        private void AddCustomerToList()
        {
            Console.Clear();
            Console.WriteLine("What is the Customers first name?");
            string FirstName = Console.ReadLine();

            Console.WriteLine("What is the customers last name?");
            string LastName = Console.ReadLine();

            Console.WriteLine("what is the Type of customer?\n" +
                              "1. Potential\n" +
                              "2. Current\n" +
                              "3. Past");
            string Userinput = Console.ReadLine().ToLower();

            EmailStatus _emailStatus = new EmailStatus();

            switch (Userinput)
            {
            case "1":
            case "potential":
                _emailStatus = EmailStatus.Potential;
                break;

            case "2":
            case "current":
                _emailStatus = EmailStatus.Current;
                break;

            case "3":
            case "past":

                _emailStatus = EmailStatus.Past;
                break;
            }

            Console.WriteLine("What is the customers email address?");
            string EmailAddress = Console.ReadLine();

            EmailPoco CustomerToList = new EmailPoco(FirstName, LastName, _emailStatus, EmailAddress);

            _emailRepo.AddPersonToEmailList(CustomerToList);

            Console.WriteLine("Customer Was added to the email list. Press any key to continue.");
            Console.ReadKey();
        }
コード例 #2
0
 public void RemoveCustomerFromList(EmailPoco Customer)
 {
     EmailList.Remove(Customer);
 }
コード例 #3
0
 public void AddPersonToEmailList(EmailPoco NewPerson)
 {
     EmailList.Add(NewPerson);
 }