In figure (i) the force applied by the man is perpendicular to the direction of movement of mass,i.e, $$\theta =90^{0}$$
$$W=Fs\cos\theta=Fs\cos90^{0}=0$$
In figure (ii) The force applied is in direction of the movement of mass i.e. $$\theta =0^{0}$$
$$\therefore W=Fs\cos\theta =Mgs\cos\theta$$
$$=15*9.8*2*1=294J$$.