private static void getCandy() { int index = showCandies("SELECCIONE LA GOLOSINA A COMPRAR"); if (index >= 0 && index < Program.cinema.candies.Count) { ArrayList items2 = new ArrayList(); Candy candy = Program.cinema.candies.ToArray()[index]; items2.Add("Dulce: " + candy.name); items2.Add("Precion: $" + candy.price); VentaControl venta = new VentaControl(index, items2, 20); if (venta.newVenta()) { Console.Clear(); Console.WriteLine("GOLOSINA COMPRADA CON EXITO"); Console.ReadKey(); } } }
private static void getMovie() { int index = showMovies("SELECCIONE LA PELICULA QUE DESEA"); if (index >= 0 && index < Program.cinema.movies.Count) { Console.Clear(); ArrayList items = new ArrayList(); Movie movie = Program.cinema.movies.ToArray()[index]; foreach (Room r in movie.rooms) { items.Add(String.Format("Tipo: {0}, precio: ${1}, disponible: {2} ", r.type, r.price, r.free)); } items.Add("SALIR"); Menu menu = new Menu(items, 15, 7, "SELECCIONE LA SALA QUE DESEA"); menu.printItems(); int option = menu.getOption(); if (option >= 0 && option < items.Count - 1) { Room room = movie.rooms.ToArray()[option]; ArrayList items2 = new ArrayList(); items2.Add("Pelicula: " + movie.name); items2.Add("Sala: " + room.type); items2.Add("Precio por boleto: $" + room.price); VentaControl venta = new VentaControl(index, option, room.free, items2); if (venta.newVenta()) { Console.Clear(); Seat seat = new Seat(room.rows, room.columns, room.matriz); List <OptionSeat> value = seat.getIndex(venta.quantity, movie.name); foreach (OptionSeat val in value) { room.matriz[val.y][val.x] = false; } Console.SetCursorPosition(0, 11); Console.WriteLine("PELICULA RESERVADA CON EXITO"); Console.ReadKey(); } } } }