The solution of the inner and outer Dirichlet problems based on the discrete double-layer potential