Beispiel #1
0
        static void Main(string[] args)
        {
            Expendedora exp = new Expendedora();

            Console.WriteLine("Bienvenido a la Expendedora!");
            Console.WriteLine("\nIngrese una tecla para pasar al Menú de Usuario.");
            Console.ReadKey();
            Console.Clear();

            bool continuarActivo = true;

            do
            {
                Console.Clear();
                Console.WriteLine("MENÚ DE USUARIO");
                Console.WriteLine("\n 0 - ENCENDER MÁQUINA" +
                                  "\n 1 - LATAS DISPONIBLES" +
                                  "\n 2 - INGRESAR LATA" +
                                  "\n 3 - EXTRAER LATA" +
                                  "\n 4 - OBTENER BALANCE" +
                                  "\n 5 - MOSTRAR STOCK" +
                                  "\n 6 - EXIT");

                try
                {
                    int opcion = ConsolaHelper.OpcionMenu(0, 6, "\nIndique la opción a la que desee ingresar: ");
                    Console.Clear();

                    switch (opcion)
                    {
                    case 0:
                        exp.EncenderMaquina();
                        break;

                    case 1:
                        //LISTAR LATAS
                        break;

                    case 2:
                        IngresarLata(exp);
                        break;

                    case 3:
                        ExtraerLata(exp);
                        break;

                    case 4:
                        ObtenerBalance(exp);
                        break;

                    case 5:
                        MostrarStock(exp);
                        break;

                    case 6:
                        Exit();
                        continuarActivo = false;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("\nLo sentimos, ha ocurrido un error en el sistema. " + ex.Message);
                    Console.WriteLine("\nIngrese una tecla para continuar.");
                    Console.ReadKey();
                    Console.Clear();
                }
            } while (continuarActivo is true);
        }
        static void Main(string[] args)
        {
            bool _continuarActivo = true;

            TiendaRopa Lupo = new TiendaRopa();

            Console.WriteLine("BIENVENIDOS A LA TIENDA DE ROPA LUPO!\n\nIngrese una tecla para pasar al Menú Principal.");
            Console.ReadKey();

            do
            {
                Console.Clear();
                Console.WriteLine("MENÚ PRINCIPAL\n");
                Console.WriteLine("1 - REGISTRAR INDUMENTARIA\n" +
                                  "2 - MODIFICAR INDUMENTARIA\n" +
                                  "3 - QUITAR INDUMENTARIA\n" +
                                  "4 - LISTAR INDUMENTARIA\n" +
                                  "5 - INGRESAR ORDEN\n" +
                                  "6 - LISTAR ORDEN\n" +
                                  "7 - DEVOLVER ORDER\n" +
                                  "8 - EXIT\n");

                try
                {
                    int opcion = ConsolaHelper.OpcionMenu(1, 8, "Ingrese la opción en la que desee ingresar: ");
                    Console.Clear();

                    switch (opcion)
                    {
                    case 1:
                        Program.RegistrarIndumentaria(Lupo);
                        break;

                    case 2:
                        Program.ModificarIndumentaria(Lupo);
                        break;

                    case 3:
                        Program.QuitarIndumentaria(Lupo);
                        break;

                    case 4:
                        Program.ListarIndumentaria(Lupo);
                        break;

                    case 5:
                        break;

                    case 6:
                        break;

                    case 7:
                        break;

                    case 8:
                        Program.Exit();
                        _continuarActivo = false;
                        break;

                    default:
                        Console.WriteLine("Ha ingresado una opción inválida. Por favor, intentelo nuevamente.");
                        break;
                    }
                } catch (Exception ex)
                {
                    Console.WriteLine("Lo sentimos, hubo un error durante la ejecución. " + ex.Message);
                }
            } while (_continuarActivo);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            bool continuarActivo = true;

            Facultad FCE = new Facultad("FCE", 3);

            Console.WriteLine("BIENVENIDOS A " + FCE.Nombre);
            Console.WriteLine("\nIngrese una tecla para pasar al Menú de Usuario.");
            Console.ReadKey();
            Console.Clear();

            do
            {
                Console.Clear();
                Console.WriteLine("MENÚ DE USUARIO\n");
                Console.WriteLine("1 - AGREGAR ALUMNO\n" +
                                  "2 - AGREGAR EMPLEADO\n" +
                                  "3 - ELIMINAR ALUMNO\n" +
                                  "4 - ELIMINAR EMPLEADO\n" +
                                  "5 - MODIFICAR EMPLEADO\n" +
                                  "6 - LISTAR ALUMNOS\n" +
                                  "7 - LISTAR EMPLEADOS\n" +
                                  "8 - EXIT\n");

                try
                {
                    int opcion = ConsolaHelper.OpcionMenu(1, 8);
                    Console.Clear();

                    switch (opcion)
                    {
                    case 1:
                        Program.AgregarAlumno(FCE);
                        break;

                    case 2:
                        Program.AgregarEmpleado(FCE);
                        break;

                    case 3:
                        Program.EliminarAlumno(FCE);
                        break;

                    case 4:
                        Program.EliminarEmpleado(FCE);
                        break;

                    case 5:
                        Program.ModificarEmpleado(FCE);
                        break;

                    case 6:
                        Program.ListarAlumnos(FCE);
                        break;

                    case 7:
                        Program.ListarEmpleados(FCE);
                        break;

                    case 8:
                        Program.Exit();
                        continuarActivo = false;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("\nLo sentimos hubo un error en el sistema. " + ex.Message + "Intentelo nuevamente.");
                    Console.WriteLine("\nIngrese una tecla para continuar.");
                    Console.ReadKey();
                    Console.Clear();
                }
            } while (continuarActivo == true);
        }
        static void Main(string[] args)
        {
            bool _continuarActivo = true;

            VentaRepuestos vtaRep = new VentaRepuestos("RE-PUESTO", "Warnes 666");

            Console.WriteLine("BIENVENIDO A " + vtaRep.Nombre + "!");
            Console.WriteLine("\nIngrese una tecla para pasar al Menú de Usuario.");
            Console.ReadKey();
            Console.Clear();

            do
            {
                Console.Clear();
                Console.WriteLine("MENÚ DE USUARIO\n");
                Console.WriteLine("1 - AGREGAR REPUESTO\n" +
                                  "2 - QUITAR REPUESTO\n" +
                                  "3 - MODIFICAR PRECIO\n" +
                                  "4 - AGREGAR STOCK\n" +
                                  "5 - QUITAR STOCK\n" +
                                  "6 - LISTAR REPUESTOS POR CATEGORIA\n" +
                                  "7 - LISTAR REPUESTOS\n" +
                                  "8 - EXIT\n");
                try
                {
                    int opcion = ConsolaHelper.OpcionMenu(1, 8);
                    Console.Clear();

                    switch (opcion)
                    {
                    case 1:
                        Program.AgregarRepuesto(vtaRep);
                        break;

                    case 2:
                        Program.QuitarRepuesto(vtaRep);
                        break;

                    case 3:
                        Program.ModificarPrecio(vtaRep);
                        break;

                    case 4:
                        Program.AgregarStock(vtaRep);
                        break;

                    case 5:
                        Program.QuitarStock(vtaRep);
                        break;

                    case 6:
                        Program.ListarRepuestosPorCategoria(vtaRep);
                        break;

                    case 7:
                        Program.ListarRepuestos(vtaRep);
                        break;

                    case 8:
                        Program.Exit();
                        _continuarActivo = false;
                        break;
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("\nLo sentimos, hubo un error en la ejecución del programa. Mensaje: " + ex.Message);
                }
            } while (_continuarActivo == true);
        }