Coexistence of open and closed type nodal line topological semimetals in two dimensional B2C