Example #1
0
        public override string ToString()
        {
            StringBuilder retorno = new StringBuilder();

            retorno.AppendFormat("  --Centralita--\n");
            retorno.AppendFormat("Razon: {0}\n", razonSocial);
            retorno.AppendFormat("Gan_Total: {0}\n", CalcularGanancia(TipoLlamada.Todas));
            retorno.AppendFormat("Gan_Local: {0}\n", CalcularGanancia(TipoLlamada.Local));
            retorno.AppendFormat("Gan_Provincia: {0}\n", CalcularGanancia(TipoLlamada.Provincial));
            retorno.AppendFormat("Llamadas:\n");
            foreach (Llamada llamada in Llamadas)
            {
                if (llamada is Local)
                {
                    Local aux = (Local)llamada;
                    retorno.AppendLine(aux.ToString());
                }
                else if (llamada is Provincial)
                {
                    Provincial aux = (Provincial)llamada;
                    retorno.AppendLine(aux.ToString());
                }
            }
            return(retorno.ToString());
        }
Example #2
0
        public string Mostrar()
        {
            StringBuilder mystringBuilder = new StringBuilder();

            mystringBuilder.AppendFormat("\nRazon Social: {0}.\nGanacia Local: {1}, Ganacia Provincial: {2}.\nGanancia Total: {3}\n\n", this.razonSocial, this.GananciasPorLocal, this.GanaciasPorProvincial, this.GanaciasPorTotal);
            foreach (Llamada llamada in listaDeLlamadas)
            {
                if (llamada is Local)
                {
                    Local aux = (Local)llamada;
                    mystringBuilder.AppendLine(aux.ToString());
                }
                else if (llamada is Provincial)
                {
                    Provincial aux = (Provincial)llamada;
                    mystringBuilder.AppendLine(aux.ToString());
                }
                mystringBuilder.AppendLine("");
            }
            return(mystringBuilder.ToString());
        }