Passing Dialog Input to the Main View and Database