Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("==================================================");
            Console.WriteLine("Welcome to the Address Book Data Retrieval Program");
            Console.WriteLine("==================================================");
            AddressBookRepository repository = new AddressBookRepository();

            repository.EnsureDataBaseConnection();
            Console.ReadKey();
            /// UC1 -- Getting all the records from the address book table
            repository.GetAllRecords();
            /// UC2 -- Insert a record to the address book
            TakeInputOfRecords();
            /// Testing for the success of the insertion to the table
            Console.WriteLine(repository.AddDataToTable(bookModel) ? "Inserted Successfully" : "Insert failed");
            /// UC3 -- Update a record to the address book
            UpdateCall();
            /// UC4 -- Delete a record from the table
            Console.WriteLine(repository.DeleteContactUsingName(null) ? "Deleted Successfully" : "Delete failed");
            /// UC5 -- Get the details of the record of the contacts in the address book of a city or state
            GetByCityOrState();
            /// UC6 -- Get the count of the record of the contacts in the address book of a city or state
            GetCountByParticularCityOrState();
            /// UC7 -- Sort the data by first name for the given city
            SortByName();
            /// UC8 -- Get the count of the contacts stored in a particular contact type
            repository.GetCountOfContactType(1);
            /// UC9 -- Getall the details from the ER - Diagram
            repository.GetAllDataFromTableUsingJoin();
            /// UC10-- Ensuring the other use cases working fine for retrieval
            repository.EnsuringOtherUseCasesForJoinedTable();
            /// UC18 -- Retrieving the data from the address book database entered within a time frame
            repository.RetrieveAllTheContactAddedInBetweenADate(Convert.ToDateTime("2018-01-01"));
            /// UC21 -- Implementing Multithreading concept to the address book problem
            /// Adding multiple data to the address book database using the multiple threads
            MultiThreadingImplementation threadingImplementation = new MultiThreadingImplementation();

            threadingImplementation.AddingMultipleContactDetailsToAddressBookThreading();
        }