if (product instanceof Video){
Reservation reservation = new Reservation(nextID,u,product,new Date(),new Date(),false);
//System.out.println("json: " + encodeJsonObject(reservation).toJSONString());
//System.out.println("json: " + encodeJsonObjectProductstats(reservation).toJSONString());
add_reservationto_server.apacheHttpClientPost(Login.url+"api/reservation/reservation/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObject(reservation));
add_reservationto_server.apacheHttpClientPatch(Login.url+"api/reservation/product/"+reservation.getProduct().getId()+"/", reservation.getUser().getUsername(), reservation.getUser().getPassword(), encodeJsonObjectProductstats(reservation));
return reservation;
}
else if (product instanceof Book ){
Reservation reservation = new Reservation(nextID,u,product,new Date(),new Date(),false);