Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            c += l1;
            Console.WriteLine(c.ToString());
            c += l2;
            c.OrdenarLlamadas();
            Console.WriteLine(c.ToString());
            c += l3;
            c.OrdenarLlamadas();
            Console.WriteLine(c.ToString());
            c += l4;
            c.OrdenarLlamadas();
            Console.WriteLine(c.ToString());
            Console.ReadKey();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            try
            {
                c += l1;
                c += l2;
                c += l3;
                c += l4;
                Console.WriteLine(c.ToString());
            }
            catch (CentralitaException ce)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Ocurrio un error de centralita " + ce.Message);
                Console.ForegroundColor = ConsoleColor.White;
            }
            catch (Exception e)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("ocurrio un error desconocido " + e.Message);
                Console.ForegroundColor = ConsoleColor.White;
            }
            c.OrdenarLlamadas();
            Console.WriteLine(c.ToString());
            Console.ReadKey();
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            try
            {
                c += l1;
                c += l2;
                c += l3;
                c += l4;
            }
            catch (CentralitaExcepcion e)
            {
                Console.WriteLine("{0} - {1} - {2}", e.Message, e.NombreClase, e.NombreMetodo);
            }
            c.OrdenarLlamadas();
            Console.WriteLine(c.ToString());
            Console.ReadKey();
        }
Exemplo n.º 4
0
        static void Main()
        {
            Centralita miCentralita = new Centralita("Telefonica");
            Local      l1           = new Local("casa", 30f, "jorge", 2.65f);
            Provincial l2           = new Provincial("casa2", 21f, "austaquio", Franja.Franja_1);
            Local      l3           = new Local("casa3", 45f, "luis", 1.99f);
            Provincial l4           = new Provincial(Franja.Franja_3, l2);

            Console.WriteLine("Mostrando las Llamas desordenadas");

            miCentralita.Llamadas.Add(l1);
            miCentralita.Llamadas.Add(l2);
            miCentralita.Llamadas.Add(l3);
            miCentralita.Llamadas.Add(l4);

            miCentralita.Mostrar();

            Console.ReadKey();
            Console.WriteLine("Mostrando las Llamas ordenadas");

            miCentralita.OrdenarLlamadas();
            miCentralita.Mostrar();


            Console.ReadKey();
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            Centralita centralita    = new Centralita("Telefonica");
            Local      unaLlamada    = new Local("Lanus", 30f, "Avellaneda", 2.65f);
            Provincial dosLlamada    = new Provincial("Cordoba", Franja.Franja_1, 21f, "Santa Fe");
            Local      tresLlamada   = new Local("Lomas de Zamora", 45f, "Termperley", 1.99f);
            Provincial cuatroLlamada = new Provincial(Franja.Franja_3, dosLlamada);

            //Cargamos la lista
            centralita.Lista.Add(unaLlamada);
            centralita.Lista.Add(dosLlamada);
            centralita.Lista.Add(tresLlamada);
            centralita.Lista.Add(cuatroLlamada);

            //Mostramos el contenido
            centralita.Mostrar();

            //Ordenamos la lista y la mostramos
            centralita.OrdenarLlamadas();

            Console.WriteLine("############ Lista ordenada #############");
            centralita.Mostrar();

            Console.ReadLine();
        }
Exemplo n.º 6
0
        static void Main(string[] args)
        {
            /*
             * Llamada llam = new Llamada(2 , "4225", "1111");
             * Console.WriteLine(llam.Mostrar());
             * string pp = llam.NroDestino;
             *
             * Llamada.TipoLlamada asd = Llamada.TipoLlamada.Local;
             * int i = (int)asd;
             *
             * Console.WriteLine(i);
             */

            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            c.Llamadas.Add(l1);
            Console.WriteLine(c.Mostrar());
            c.Llamadas.Add(l2);
            Console.WriteLine(c.Mostrar());
            c.Llamadas.Add(l3);
            Console.WriteLine(c.Mostrar());
            c.Llamadas.Add(l4);
            Console.WriteLine(c.Mostrar());
            c.OrdenarLlamadas();
            Console.WriteLine(c.Mostrar());
            Console.ReadKey();
        }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Centralita central1 = new Centralita("Telefonica");


            //Local llamda1 = new Local("Chacarita", "Vicente Lopez", 0.3f, 2.65f);
            central1.LLamadas.Add(new Local("Chacarita", "Vicente Lopez", 0.3f, 2.65f));
            central1.LLamadas.Add(new Provincial(Franja.Franja_1, new Llamada("Almagro", "Lanus", 0.21f)));
            central1.LLamadas.Add(new Local("Palermo", "Barracas", 0.45f, 1.99f));
            central1.LLamadas.Add(new Provincial(Franja.Franja_3, new Llamada("Almagro", "Lanus", 0.21f)));

            central1.Mostrar();
            central1.OrdenarLlamadas();

            Console.ReadLine();
        }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.


            try
            {
                c += l1;
                Console.WriteLine(c.Mostrar());
                c += l2;
                Console.WriteLine(c.Mostrar());
                c += l3;
                Console.WriteLine(c.Mostrar());
                c += l4;
                Console.WriteLine(c.Mostrar());
            }
            catch (CentralitaException e)
            {
                Console.WriteLine("Error en la clase: " + e.NombreClase);
                Console.WriteLine("Error en el metodo: " + e.NombreMetodo);
                Console.WriteLine(e.Message);
            }

            c.OrdenarLlamadas();
            Console.WriteLine();
            Console.WriteLine("Llamadas ordenadas por duracion");
            Console.WriteLine();
            Console.WriteLine(c.Mostrar());
            Console.WriteLine();
            Console.WriteLine("Log-------------------------");
            Console.WriteLine(((IGuardar <string>)l4).Leer());
            Console.ReadKey();
        }
Exemplo n.º 9
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            c = c + l1;
            c = c + l2;
            c = c + l3;
            c = c + l4;
            Console.WriteLine("\t\t LLAMADAS ORDENADAS\n\n");
            c.OrdenarLlamadas();
            Console.WriteLine(c.ToString());
            Console.ReadKey();
        }
Exemplo n.º 10
0
        static void Main(string[] args)
        {
            Centralita Telefonica = new Centralita("Telefonica");

            Local      l1 = new Local("CABA", "Lanus", 30, 2.65f);
            Local      l2 = new Local("Lanus", "Avellaneda", 45, 1.99f);
            Provincial p1 = new Provincial("Cordoba", Provincial.Franja.Franja_1, 21, "Lanus");
            Provincial p2 = new Provincial(Provincial.Franja.Franja_3, (Llamada)p1);

            Telefonica.Llamadas.Add(l1);
            Telefonica.Llamadas.Add(p1);
            Telefonica.Llamadas.Add(l2);
            Telefonica.Llamadas.Add(p2);

            Telefonica.Mostrar();

            Telefonica.OrdenarLlamadas();

            Telefonica.Mostrar();
            Console.ReadLine();
        }
Exemplo n.º 11
0
        static void Main(string[] args)
        {
            /*En el Main() se creará una Centralita (―Telefónica‖) y cuatro
             * llamadas. La primera llamada será de tipo Local, con una duración
             * de 30 seg. y un costo de 2.65. La segunda será Provincial (en la
             * franja 1 y con duración de 21 seg.) y las restantes: Local (45
             * seg. y 1.99) y Provincial (que recibe la segunda llamada y franja
             * 3).
             * 4) Las llamadas se irán registrando en la Centralita. Registrar una
             * llamada consiste en agregar a la lista genérica de tipo Llamada
             * una llamada Provincial o una llamada Local.
             * La centralita mostrará por pantalla todas las llamadas según las
             * vaya registrando (método Mostrar).
             * Luego, se ordenarán las llamadas (método OrdenarLlamadas) y se
             * volverá a mostrar por pantalla el contenido de la Centralita.
             * */
            Centralita Telefonica = new Centralita("Telefonica");

            Local      llamadaLocaluno      = new Local("4445-3333", "123-123", 0.30F, 2.65F);
            Provincial llamadaProvincialuno = new Provincial("5555-5555", Franja.Franja_1, 0.21F, "0800-333-8100");

            Local      llamadaLocaldos      = new Local("1313-3131", "5677-2311", 0.45F, 1.99F);
            Provincial llamadaProvincialdos = new Provincial(Franja.Franja_3, llamadaProvincialuno);

            #region Agregar Llamadas y Mostrar sin Ordenar
            Telefonica.Llamadas.Add(llamadaLocaluno);
            Telefonica.Llamadas.Add(llamadaProvincialdos);
            Telefonica.Llamadas.Add(llamadaLocaldos);
            Telefonica.Llamadas.Add(llamadaProvincialdos);
            Console.WriteLine("MUESTRO SIN ORDENAR: ");
            Telefonica.Mostrar();
            Console.ReadKey();
            #endregion

            Telefonica.OrdenarLlamadas();
            Console.Clear();
            Console.WriteLine("\nAHORA ORDENADO: ");
            Telefonica.Mostrar();
            Console.ReadKey();
        }
Exemplo n.º 12
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial("Morón", Provincial.Franja.Franja_1, 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, l2);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            //c.Llamadas.Add(l1);
            try
            {
                c += l1;
                //Console.WriteLine(c.Mostrar());
                //c.Llamadas.Add(l2);
                c += l2;
                //Console.WriteLine(c.Mostrar());
                //c.Llamadas.Add(l3);
                c += l3;
                //Console.WriteLine(c.Mostrar());
                //c.Llamadas.Add(l4);
                c += l4;
                //Console.WriteLine(c.Mostrar());
            }catch (CentralitaException e)
            {
                Console.WriteLine(e.Message);
            }



            c.OrdenarLlamadas();
            Console.WriteLine(c.Mostrar());
            Console.ReadKey();
        }
Exemplo n.º 13
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Cin Center");
            // Mis 4 llamadas
            Local      l1 = new Local("Bernal", 30, "Rosario", 2.65f);
            Provincial l2 = new Provincial(Provincial.Franja.Franja_1, "Morón", 21, "Bernal");
            Local      l3 = new Local("Lanús", 45, "San Rafael", 1.99f);
            Provincial l4 = new Provincial(Provincial.Franja.Franja_3, "Avellaneda", 12, "Quilmes");
            Llamada    l5 = new Provincial(Provincial.Franja.Franja_3, "Avellaneda", 12, "Quilmes");

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            try
            {
                c += l1;
                c += l2;
                c += l3;
                c += l4;
                c += l5;
                c.OrdenarLlamadas();
                Console.WriteLine(c.ToString());
            }
            catch (CentralitaException e)
            {
                Console.WriteLine(e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            Console.ReadKey();


            // object objeto = new object();
        }
Exemplo n.º 14
0
        static void Main(string[] args)
        {
            // Mi central
            Centralita c = new Centralita("Fede Center");
            // Mis 4 llamadas
            Local      l1 = new Local(30, "Bernal", "Rosario", 2.65f);
            Provincial l2 = new Provincial(21, "Morón", "Bernal", Provincial.Franja.Franja_1);
            Local      l3 = new Local(45, "Lanús", "San Rafael", 1.99f);
            Provincial l4 = new Provincial(12, "Morón", "Bernal", Provincial.Franja.Franja_3);

            // Las llamadas se irán registrando en la Centralita.
            // La centralita mostrará por pantalla todas las llamadas según las vaya registrando.
            c.Llamadas.Add(l1);
            Console.WriteLine(c.Mostrar());
            c.Llamadas.Add(l2);
            Console.WriteLine(c.Mostrar());
            c.Llamadas.Add(l3);
            Console.WriteLine(c.Mostrar());
            c.Llamadas.Add(l4);
            Console.WriteLine(c.Mostrar());
            c.OrdenarLlamadas();
            Console.WriteLine(c.Mostrar());
            Console.ReadKey();
        }