I'm sorry to hear you are locked out of your device. You have an option to unlock your device should you ever forget your password or pin. Did you create a Samsung account on the A505? If so, you can log onto https://findmymobile.samsung.com/#home and click on "Unlock," it'll ask you to enter and confirm your password.
If this does not work, unfortunately, you will need to 'factory reset' the phone and any usaved data will be lost. Upon restarting the phone, it will ask for the Google account associate with the phone. Should you not have this information, you will need to take the phone to a Samsung or authorized Samsung service location, with proof of purchase to remove the Google lock and unlock the device. Sincere apologies for any inconvinience.
Hope this information has been helpful.