Beispiel #1
0
        static void Main(string[] args)
        {
            InitConfiguration();

            var userDataAccess = new UserDataAccess();
            var firstData      = userDataAccess.SelectDebtors();

            foreach (var value in firstData)
            {
                if (value.IsRegistered == true)
                {
                    Console.WriteLine($"Должник: {value.FirstName} {value.LastName}");
                }
            }

            int authorId         = 3;
            var authorDataAccess = new AuthorDataAccess();
            var secondData       = authorDataAccess.SelectAuthorsByBook(authorId);

            Console.WriteLine("Автор(-ы): ");

            foreach (var value in secondData)
            {
                Console.WriteLine($"{value.FirstName} {value.LastName}");
            }

            var bookDataAccess = new BookDataAccess();
            var thirdData      = bookDataAccess.SelectAvailableBooks();

            Console.WriteLine($"Доступные книги: ");

            foreach (var value in thirdData)
            {
                Console.WriteLine($"{value.Name}");
            }

            int userId    = 2;
            var forthData = bookDataAccess.SelectBooksByUser(userId);

            Console.WriteLine($"У пользователя с Id {userId} книга(-и) ");

            foreach (var value in forthData)
            {
                Console.WriteLine($"{value.Name}");
            }

            //userDataAccess.DeleteAllDebtors();
        }