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; Console.WriteLine(c.ToString()); c.Llamadas.Add(l3); Console.WriteLine(c.ToString()); c.Llamadas.Add(l4); Console.WriteLine(c.ToString()); c.OrdenarLlamadas(); Console.WriteLine(c.ToString()); Console.ReadKey(); }
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(); }
static void Main(string[] args) { Centralita c = new Centralita("Fede Center"); 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); c += l1; c += l2; c += l3; c += l4; c.OrdenarLlamadas(); Console.WriteLine(c.ToString()); Console.ReadKey(); }
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; c.OrdenarLlamadas(); Console.WriteLine(c.ToString()); Console.ReadKey(); }