it seems that there was a change in the way that these processes need to be called somewhere along the way… seems that in the old version you didnt need to callout the database, but the newer you do… I believe that these are the two variations. try one and then the other.
nv.GetNextSequence(NextSequenceCode)
to
nv.GetNextSequence(this.Db,NextSequenceCode)
and
NextValue.SetSequenceCurrentValue(NextSequenceCode, NextValueReset);
To
NextValue.SetSequenceCurrentValue(this.Db,NextSequenceCode, NextValueReset);