The adjective ending depends on the case and the article in which you are speaking. If it's the definite article you use -e for nominative, and -en for accusative, genitive, and dative. If it's the indefinite article you use -er for nominative and -en for accusative, genitive, and dative. If there is no article, you use -er for nominative, -en for accusative and genitive, and -em for dative.