Пример #1
0
        public static String getXmlPost()
        {
            Sis_informador theSis_informador = new Sis_informador("03107", "OK", "1", "2019_01_18 11_53_55");

            List <Sis_alerta> theListSis_alerta = new List <Sis_alerta>();

            Sis_alerta theSis_alerta = new Sis_alerta("BAAMONDE", "2");

            theSis_alerta.listAlertas.Add(new Alerta("51", "eth1 conexion eliminada", "2019_01_21 16_43_34"));
            //theSis_alerta.listAlertas.Add(new Alerta("52", "eth2 conexion eliminada", "2012_01_21 16_43_34"));
            theListSis_alerta.Add(theSis_alerta);

            /*
             * Sis_alerta theSis_alerta1 = new Sis_alerta("BAAMONDE", "1");
             * theSis_alerta1.listAlertas.Add(new Alerta("51", "eth1 conexion eliminada", "2019_01_21 16_43_34"));
             * theSis_alerta1.listAlertas.Add(new Alerta("52", "eth2 conexion eliminada", "2012_01_21 16_43_34"));
             * theListSis_alerta.Add(theSis_alerta1);
             */

            mensaje theMensaje = new mensaje(theSis_informador);

            theMensaje.sis_alerta = theListSis_alerta;



            XmlSerializer xmlSerializer = new XmlSerializer(theMensaje.GetType());

            using (StringWriter textWriter = new StringWriter())
            {
                xmlSerializer.Serialize(textWriter, theMensaje);
                return(textWriter.ToString());
            }
        }
Пример #2
0
        public static mensaje getMensaje()
        {
            Sis_informador theSis_informador = new Sis_informador("03107", "OK", "1", "2019_01_18 11_53_55");

            List <Sis_alerta> theListSis_alerta = new List <Sis_alerta>();

            Sis_alerta theSis_alerta = new Sis_alerta("BAAMONDE", "1");

            theSis_alerta.listAlertas.Add(new Alerta("51", "eth1 conexion eliminada", "2019_01_21 16_43_34"));
            theListSis_alerta.Add(theSis_alerta);
            mensaje theMensaje = new mensaje(theSis_informador);

            theMensaje.sis_alerta = theListSis_alerta;

            return(theMensaje);
        }