Using Metals and Stars to Constrain Galaxies' Past Gaseous Inflows and Outflows