What's the difference between て言ってた vs ように言われた?


I have learned recently that ように can be used for advice, command, ask and so
on. Is there a difference between て言ってた and ように言われた? For example:

> 私はママにTVを消すように言われた。
>
> ママは私にTVを消しなさいって言ってた。




Passive or active voice and indirect or direct quote.  
The first sentence translates to

> I was told by my mother to turn the TV off.

The second one to

> Mother told me: Turn the TV off.

と or って follows a direct quote.




Passive or active voice and indirect or direct quote.  
The first sentence translates to

> I was told by my mother to turn the TV off.

The second one to

> Mother told me: Turn the TV off.

と or って follows a direct quote.

