Theoretical studies of the first- and second-row transition-metal dimethyls and their positive ions