complete rewrite the dialogdatabasemanger and create the database class