コード例 #1
0
        public void addDetails(string bookName)
        {
            if (!contactRepo.GetBookByName(bookName))
            {
                contactRepo.AddBook(bookName);
            }
            contactModel.bookName = bookName;
            Console.WriteLine("Enter First Name:");
            contactModel.firstName = Console.ReadLine();
            if (contactRepo.checkDuplicateNameByBook(contactModel))
            {
                Console.WriteLine("person all ready exists");
                return;
            }
            Console.WriteLine("Enter Last Name");
            contactModel.lastName = Console.ReadLine();
            Console.WriteLine("Enter Address");
            contactModel.address = Console.ReadLine();
            Console.WriteLine("Enter City");
            contactModel.city = Console.ReadLine();
            Console.WriteLine("Enter State");
            contactModel.state = Console.ReadLine();
            Console.WriteLine("Enter zip");
            contactModel.zip = Console.ReadLine();
            Console.WriteLine("Enter Phone Number");
            contactModel.phoneNumber = Console.ReadLine();
            Console.WriteLine("Enter Email");
            contactModel.email = Console.ReadLine();

            if (contactRepo.AddContact(contactModel))
            {
                Console.WriteLine("Records added successfully");
            }
        }