Ejemplo n.º 1
0
 private void SetEntryDetails(AddressBookEntry entry)
 {
     entry.FirstName = ConsoleHelperMethods.PromptForInput("Please enter the", "first name");
     entry.LastName  = ConsoleHelperMethods.PromptForInput("Please enter the", "last name");
     entry.Address1  = ConsoleHelperMethods.PromptForInput("Please enter", "address line 1");
     entry.Address2  = ConsoleHelperMethods.PromptForInput("Please enter", "address line 2", true);
     entry.City      = ConsoleHelperMethods.PromptForInput("Please enter the", "city");
     entry.State     = ConsoleHelperMethods.PromptForInput("Please enter the", "state");
     entry.Zip       = ConsoleHelperMethods.PromptForInput("Please enter the", "zip code");
     //TODO: Implement formatting phone number input so it's always (###) ###-####.
     entry.PhoneNumber  = ConsoleHelperMethods.PromptForInput("Please enter the", "phone number");
     entry.EmailAddress = ConsoleHelperMethods.PromptForInput("Please enter the", "email address");
 }
Ejemplo n.º 2
0
 private void DeleteEntry()
 {
     do
     {
         Console.WriteLine(Environment.NewLine);
         for (int index = 0; index < this.addressBook.Entries.Count; index++)
         {
             var entry = this.addressBook.Entries[index];
             Console.WriteLine("({0}) {1}", index, entry);
         }
         var selection = ConsoleHelperMethods.PromptForNumericInput("Please select an entry to delete: ");
         this.addressBook.Entries.RemoveAt(selection);
         Console.Write("Do you want to delete another entry (y/N)?: ");
     }while (Console.ReadKey().Key == ConsoleKey.Y);
 }