Last year I booked a trip to Germany via the Delta website. The flights there were operated by Air France. The flights home were operated via KLM. I received mileage credit for all flights. I just had to submit my receipt of purchase and my boarding passes to AS and the miles posted in a week or two.
But of course, YMMV.