Ejemplo n.º 1
0
        private static string ArmarFormatoMensaje()
        {
            int    i;
            string texto;
            string linea = "";

            if (Sello.TryParse(mensaje, out texto))
            {
                Sello.mensaje = texto;
                for (i = 0; i < mensaje.Length + 2; i++)
                {
                    linea += "*";
                }
                linea += "\n";
                linea += "*";
                linea += Sello.mensaje;
                linea += "*";
                linea += "\n";
                for (i = 0; i < mensaje.Length + 2; i++)
                {
                    linea += "*";
                }
            }
            else
            {
                linea = "Error!!!! Mensaje vacio!!!!";
            }
            return(linea);
        }
Ejemplo n.º 2
0
        public static string Imprimir()
        {
            string cadena = "";

            if (Sello.TryParse(Sello.Mensaje, out cadena) == true)
            {
                cadena = Sello.ArmarFormatoMensaje();
            }
            return(cadena);
        }
Ejemplo n.º 3
0
 public static string Imprimir()
 {
     if (Sello.TryParse(Sello.mensaje, out string cadena))
     {
         cadena = ArmarMensajeConFormato();
     }
     else
     {
         cadena = "El mensaje està vacio.";
     }
     return(cadena);
 }
Ejemplo n.º 4
0
        public static string Imprimir()
        {
            string cadena  = "";
            string retorno = "";

            if (Sello.TryParse(Sello.mensaje, out cadena))
            {
                retorno = Sello.ArmarFormatoMensaje();
            }

            return(retorno);
        }
Ejemplo n.º 5
0
        public static string Imprimir()
        {
            String cadena  = "";
            String retorno = "Error cadena vacia";

            if (Sello.TryParse(Sello.mensaje, out cadena))
            // if (Sello.TryParse(Sello.mensaje))
            {
                Sello.mensaje = cadena;
                retorno       = Sello.ArmarFormatoMensaje();
            }

            return(retorno);
        }
Ejemplo n.º 6
0
        public static string Imprimir()
        {
            string cadena;
            string retorno;

            if (Sello.TryParse(Sello.mensaje, out cadena))
            {
                Sello.mensaje = cadena;
                retorno       = Sello.ArnarFormatoMensaje(Sello.mensaje);
            }
            else
            {
                retorno = Sello.mensaje;
            }
            return(retorno);
        }
Ejemplo n.º 7
0
        private static string ArmarFormatoMensaje()
        {
            int    cantidad;
            string a = "";
            int    i;
            string cadena = "";

            if (Sello.TryParse(Sello.mensaje, out cadena))
            {
                Sello.mensaje = cadena;


                cantidad = Sello.mensaje.Length;

                cantidad = cantidad + 2;

                for (i = 0; i < cantidad; i++)
                {
                    a = a + "*";
                }
                a = a + "\n";
                a = a + "*";
                a = a + Sello.mensaje;
                a = a + "*\n";

                for (i = 0; i < cantidad; i++)
                {
                    a = a + "*";
                }
            }
            else
            {
                Console.BackgroundColor = ConsoleColor.Red;
                Console.WriteLine("No hay mensaje para imprimir");
                Console.BackgroundColor = ConsoleColor.DarkGray;
            }
            return(a);
        }