Instead of simply Encapsulating your code, why not divide your project into let's say Data Layer, Business Logic and UI.
The data layer can handle all of your data access without any knowledge of the other classes, the business logic can inherit or instantiate from the data layer and so on.