implementata istruzione per ordinamento

This commit is contained in:
Simone Argenziano
2013-12-18 18:45:34 +01:00
parent fc9310ad17
commit 0688474c0d
2 changed files with 18 additions and 5 deletions

View File

@@ -239,9 +239,18 @@ public class 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)
{
if(deal instanceof Vacanze)
@@ -265,6 +274,7 @@ public class Catalogo{
if(deal instanceof CeneInRistoranti)
{
CeneInRistoranti dealCena = (CeneInRistoranti)deal;
if((dealCena.eAcquistabile()))
{
visualizzaCena(dealCena);
@@ -276,9 +286,13 @@ public class 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 -----");
for(Utilizzabile deal: catalogoOfferte)
{
@@ -298,7 +312,6 @@ public class Catalogo{
if(!(dealCena.eAcquistabile())) {visualizzaCena(dealCena);continue;}
}
}
}
/**
* Questa metodo aggiunge credito al conto dell'utente
@@ -334,7 +347,7 @@ public class Catalogo{
System.out.println("----- Shop ----");
System.out.println("### Prodotti ###");
offerteAttive();
offerteAttive(user);
System.out.println("Offerta da acquistare[inserisci id]: ");
Scanner inputData = new Scanner(System.in);

View File

@@ -49,7 +49,7 @@ public class ClientSession {
catalogo.aggiungiCredito(username);
break;
case "2":
catalogo.offerteAttive();
catalogo.offerteAttive(username);
break;
case "3":
catalogo.acquistaProdotto(username);