implementata istruzione per ordinamento
This commit is contained in:
@@ -239,9 +239,18 @@ public class Catalogo{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Questo metodo visualizza le offerte attive del catalogo
|
* Questo metodo visualizza le offerte attive del catalogo
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
* @throws FileNotFoundException
|
||||||
*/
|
*/
|
||||||
public void offerteAttive()
|
public void offerteAttive(String user) throws FileNotFoundException, ClassNotFoundException, IOException
|
||||||
{
|
{
|
||||||
|
Entry loggedUser = Access.get_user_data(user);
|
||||||
|
if(!(loggedUser.getType()))
|
||||||
|
{
|
||||||
|
//DO SOMETHING !
|
||||||
|
}
|
||||||
|
|
||||||
for(Utilizzabile deal: catalogoOfferte)
|
for(Utilizzabile deal: catalogoOfferte)
|
||||||
{
|
{
|
||||||
if(deal instanceof Vacanze)
|
if(deal instanceof Vacanze)
|
||||||
@@ -265,6 +274,7 @@ public class Catalogo{
|
|||||||
if(deal instanceof CeneInRistoranti)
|
if(deal instanceof CeneInRistoranti)
|
||||||
{
|
{
|
||||||
CeneInRistoranti dealCena = (CeneInRistoranti)deal;
|
CeneInRistoranti dealCena = (CeneInRistoranti)deal;
|
||||||
|
|
||||||
if((dealCena.eAcquistabile()))
|
if((dealCena.eAcquistabile()))
|
||||||
{
|
{
|
||||||
visualizzaCena(dealCena);
|
visualizzaCena(dealCena);
|
||||||
@@ -276,9 +286,13 @@ public class Catalogo{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Questo metodo visualizza le offerte scadute del catalogo
|
* Questo metodo visualizza le offerte scadute del catalogo
|
||||||
|
* @throws IOException
|
||||||
|
* @throws ClassNotFoundException
|
||||||
|
* @throws FileNotFoundException
|
||||||
*/
|
*/
|
||||||
public void offerteScadute()
|
public void offerteScadute(String user) throws FileNotFoundException, ClassNotFoundException, IOException
|
||||||
{
|
{
|
||||||
|
Entry loggedUser = Access.get_user_data(user);
|
||||||
System.out.println("------ Offerte Scadute -----");
|
System.out.println("------ Offerte Scadute -----");
|
||||||
for(Utilizzabile deal: catalogoOfferte)
|
for(Utilizzabile deal: catalogoOfferte)
|
||||||
{
|
{
|
||||||
@@ -298,7 +312,6 @@ public class Catalogo{
|
|||||||
if(!(dealCena.eAcquistabile())) {visualizzaCena(dealCena);continue;}
|
if(!(dealCena.eAcquistabile())) {visualizzaCena(dealCena);continue;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Questa metodo aggiunge credito al conto dell'utente
|
* Questa metodo aggiunge credito al conto dell'utente
|
||||||
@@ -334,7 +347,7 @@ public class Catalogo{
|
|||||||
System.out.println("----- Shop ----");
|
System.out.println("----- Shop ----");
|
||||||
System.out.println("### Prodotti ###");
|
System.out.println("### Prodotti ###");
|
||||||
|
|
||||||
offerteAttive();
|
offerteAttive(user);
|
||||||
|
|
||||||
System.out.println("Offerta da acquistare[inserisci id]: ");
|
System.out.println("Offerta da acquistare[inserisci id]: ");
|
||||||
Scanner inputData = new Scanner(System.in);
|
Scanner inputData = new Scanner(System.in);
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class ClientSession {
|
|||||||
catalogo.aggiungiCredito(username);
|
catalogo.aggiungiCredito(username);
|
||||||
break;
|
break;
|
||||||
case "2":
|
case "2":
|
||||||
catalogo.offerteAttive();
|
catalogo.offerteAttive(username);
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "3":
|
||||||
catalogo.acquistaProdotto(username);
|
catalogo.acquistaProdotto(username);
|
||||||
|
|||||||
Reference in New Issue
Block a user