see, the concept is simple, the only thing you hav to keep in mind is choosing your own sign convention & proceeding accordingly..
for example::if you take the downward direction as -ve, then g(acting downward) will also be -ve or displacement (wich is again downward) is also -ve in both cases you've given & so, you'll get the ans. accordingly. also, in 1st case, 'v' will be -ve coz' its acted downward but in 2nd case it will be +ve coz' its acted upwards....