i used a "plan", which is a table of numbers representing the objects to place on the grid, for example : 1 is a simple floor tile, 2 is a wall, etc...
for the rooms, i try to randomly place them on the plan without overlapping, then "dig" hallways between successive rooms (the hallways part does not check for intersecting rooms, so it can get messy).
there are a few extra checks to make sure the stairs_up are in the same place as the stairs_down from the previous floor, and that important tiles like stairs won't get crushed by the hallways.
enemy and stairs_down placement is basically random, i'll have to work on that.
then i "build" the floor from its plan.