1+ /**
2+ * @author Maria
3+ * @author Fran
4+ */
5+
16package terminalcli ;
27import coreapi ;
38import api .src .main .java .coreapi .*;
@@ -115,10 +120,10 @@ public void OrderInProgress_screen(Cafeteria coffe, Order ord)
115120
116121 /* ------------------------------SELECT_TYPE_SCREEN ------------------------------------- */
117122
118- public void type_screen (Cafeteria coffe , Order ord )//Terminar
123+ public void type_screen (Cafeteria coffe , Order ord )
119124 {
120125 String op ;
121- int s = 0 , range = 0 ;
126+ int s = 0 , range = 0 , cont = 0 ;
122127 Scanner keyboard = new Scanner (System .in );
123128 List <String > typeProduct = coffe .getTypes ();
124129 do
@@ -145,18 +150,18 @@ public void type_screen(Cafeteria coffe, Order ord)//Terminar
145150 System .out .println ("Introduzca una opcion valida" );
146151 else
147152 {
148-
153+ product_screen ( coffe , ord , typeProduct . get ( s - 1 ));
149154 }
150155 }
151156 }while (s < 1 || s > range );
152157 }
153158
154159 /*-------------------------------- SELECT_PRODUCT_SCREEN ------------------------------------ */
155160
156- public void product_screen (Cafeteria coffe , Order ord , String type )//Terminar
161+ public void product_screen (Cafeteria coffe , Order ord , String type )
157162 {
158163 String op ;
159- int s = 0 , range = 0 ;
164+ int s = 0 , range = 0 , q = 0 ;
160165 Scanner keyboard = new Scanner (System .in );
161166 List <Product > AvailableProduct = coffe .getAvailableProducts ();
162167 do
@@ -165,7 +170,6 @@ public void product_screen(Cafeteria coffe, Order ord, String type)//Terminar
165170 System .out .println ("---------------------------------------------" );
166171 for (Product p : AvailableProduct )
167172 {
168- //Imprimir por id??
169173 range = range + 1 ;
170174 System .out .println (range + '.' + p .getName () + " (" + p .getPrice () + " euros)" );
171175 }
@@ -184,7 +188,9 @@ public void product_screen(Cafeteria coffe, Order ord, String type)//Terminar
184188 System .out .println ("Introduzca una opcion valida" );
185189 else
186190 {
187- //�Funciones para un producto?
191+ System .out .println ("Introduce la cantidad de producto a añadir:" );
192+ q = kayboard .nextInt ();
193+ OrderService .addProductToOrder (coffe ,ord ,AvailableProduct .get (s -1 ).getId (),q )
188194 }
189195 }
190196 }while (s < 1 || s > range );
0 commit comments