A thief stole confectionery, juice and food from a cafe.
Andrew Birney, 21, formerly of Sunnyhill Road, and now living in Dumfries, admitted the theft after breaking into the Wilton Lodge Park cafe between September 30 and October 1 last year.
He was sentenced to a Community Payback Order and 80 hours of unpaid work, to be completed within four months.
Co-accused Jordan Simpson, 18, of Minto Place, also admitted the offence. He had sentence deferred until November 16.
Both accused were on bail.