Пример #1
0
        //Retorna un reporte de permisos segun un rango de fechas ingresado
        public List <ReportePermisoFila> ReportePermisos(DateTime inicio, DateTime termino)
        {
            List <ReportePermisoFila> filas = new List <ReportePermisoFila>();

            using (WebServiceAppEscritorioClient cliente = new WebServiceAppEscritorioClient())
            {
                string xml = cliente.getReportePermisos(inicio, termino);
                //Se crea la representacion de un documento xml
                XDocument doc = XDocument.Parse(xml);
                IEnumerable <XElement> reporteXML = doc.Root.Elements();
                foreach (var filaTemp in reporteXML)
                {
                    ReportePermisoFila fila = new ReportePermisoFila();
                    //Se cargan los datos del permiso con la informacion del documento
                    fila.LeerXML(filaTemp);
                    //Se agrega a las filas
                    filas.Add(fila);
                }
            }
            return(filas);
        }