コード例 #1
0
        public void UpdateCustomerInfo()
        {
            ReadCustomerInfo();
            Console.WriteLine("Would you like to Update your account:" +
                              "1. Yes\n" +
                              "2. No.");
            int    number    = int.Parse(Console.ReadLine());
            string firstName = null;
            string lastName  = null;

            if (number == 1)
            {
                Console.WriteLine("Please enter your first name.");
                firstName = Console.ReadLine();
                Console.WriteLine("Please enter your last name.");
                lastName = Console.ReadLine();
                _emailRepo.RemoveUpdateCustomerBySpecifications(firstName, lastName);
            }
            else
            {
                Console.WriteLine("thanks come again.");
            }

            TypeOfCustomer customer = new TypeOfCustomer();

            customer.FirstName = firstName;
            customer.LastName  = lastName;
            Console.WriteLine("Are you now a:" +
                              "1. Current Customer.\n" +
                              "2. Past Customer.\n" +
                              "3. Potentially joining the Family.");

            int response = int.Parse(Console.ReadLine());


            if (response == 1)
            {
                customer.TypeOfInsurance = InsuranceType.Current;
                customer.Email           = "Thank you for your work with us. We appreciate your loyalty. Here's a coupon.";
            }
            if (response == 2)
            {
                customer.TypeOfInsurance = InsuranceType.Future;
                customer.Email           = "We currently have the lowest rates on Helicopter Insurance!";
            }
            if (response == 3)
            {
                customer.TypeOfInsurance = InsuranceType.Past;
                customer.Email           = "It's been a long time since we've heard from you, we want you back.";
            }
            _emailRepo.AddCustomer(customer);
        }
コード例 #2
0
        public void AddCustomer()
        {
            TypeOfCustomer customer = new TypeOfCustomer();

            Console.WriteLine("What is your First Name?");
            customer.FirstName = Console.ReadLine();

            Console.WriteLine("What is your Last Name?");
            customer.LastName = Console.ReadLine();



            Console.WriteLine("Hello are you:\n" +
                              "1. Current Customer.\n" +
                              "2. Past Customer.\n" +
                              "3. Potentially joining the Family.");

            int response = int.Parse(Console.ReadLine());


            if (response == 1)
            {
                customer.TypeOfInsurance = InsuranceType.Current;
                customer.Email           = "Thank you for your work with us. We appreciate your loyalty. Here's a coupon.";
            }
            if (response == 2)
            {
                customer.TypeOfInsurance = InsuranceType.Future;
                customer.Email           = "It's been a long time since we've heard from you, we want you back.";
            }
            if (response == 3)
            {
                customer.TypeOfInsurance = InsuranceType.Past;
                customer.Email           = "We currently have the lowest rates on Helicopter Insurance!";
            }
            _emailRepo.AddCustomer(customer);
        }
コード例 #3
0
 public void RemoveCustomerDetail(TypeOfCustomer customers)
 {
     _customers.Remove(customers);
 }
コード例 #4
0
 public void AddCustomer(TypeOfCustomer customers)
 {
     _customers.Add(customers);
 }