Usually, nothing changes when negating any part of the sentence:
Я люблю шокалад. I like chocolate.
Я не люблю шоколад. I don't like chocolate.
Не я люблю шоколад (, а она). It's not me that likes chocolate(, it's her).
Я люблю не шоколад(, а какао). It's not chocolate that I like(, but cocoa)
The cases remain the same regardless if it's the direct object or indirect.
The difference occurs when the verb is есть, explicitly or implicitly, which, when negated, becomes нет, which requires genitive.
У меня есть сестра. I have a sister.
У меня нет сестры. I don't have a sister.
Мне двадцать два года. I am twenty-two years old.
Мне нет двадцати двух лет. I am younger than twenty-two years old.
Мне не двадцать два года. I am not twenty-two years old.
The difference between the last two examples is that in the first sentence the implicit verb is negated and becomes нет and thus requires genitive, whereas in the second example, the implicit verb remains implicit, and 22 is negated, so nothing changes, you just add не to the part you negate, in this case, the numeral. Hope this helps.