STUDIES OF OPEN CHARM AND CHARMONIUM PRODUCTION AT LHCb