Exemplo n.º 1
0
        /// <summary>
        /// Lee universidad en formato xml
        /// </summary>
        /// <returns></returns>
        public Universidad Leer()
        {
            Universidad       u;
            string            path = Directory.GetCurrentDirectory() + @"\universidad.xml";
            Xml <Universidad> xmlu = new Xml <Universidad>();

            xmlu.Leer(path, out u);
            return(u);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Lee el archivo de el comercio
        /// </summary>
        /// <returns> Devuelve un string con el contenido del archivo</returns>
        public static string Leer()
        {
            Comercio       co  = new Comercio();
            Xml <Comercio> xml = new Xml <Comercio>();

            xml.Leer("comercio.xml", out co);

            return(co.ToString());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Mñetodo que toma los datos del archivo XML con los que se cargará la lista de pedidos
        /// </summary>
        /// <returns>Devuelve una lista de pedidos</returns>
        public static List <Pedido> Leer()
        {
            List <Pedido>        datos           = new List <Pedido>();
            string               path            = String.Format("{0}\\listaDePedidos.xml", Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
            Xml <List <Pedido> > auxListaPedidos = new Xml <List <Pedido> >();

            auxListaPedidos.Leer(path, out datos);

            return(datos);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Deserializa un listado de pedidos
        /// </summary>
        /// <returns>una List<> de tipo Pedido</returns>
        public static List <Pedido> Leer()
        {
            List <Pedido>        datos      = new List <Pedido>();
            string               path       = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "inventario.xml");
            Xml <List <Pedido> > auxPedidos = new Xml <List <Pedido> >();

            auxPedidos.Leer(path, out datos);

            return(datos);
        }
Exemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static Universidad Leer()
        {
            Xml <Universidad> xml     = new Xml <Universidad>();
            Universidad       uni     = new Universidad();
            string            archivo = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + ".\\Universidad.xml";

            xml.Leer(archivo, out uni);

            return(uni);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Deserealizo un xml
        /// </summary>
        /// <returns></returns>
        public static List <PedidosVan> Leer()
        {
            List <PedidosVan>        pedidos    = new List <PedidosVan>();
            string                   path       = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "Pedidos.xml");
            Xml <List <PedidosVan> > auxPedidos = new Xml <List <PedidosVan> >();

            auxPedidos.Leer(path, out pedidos);

            return(pedidos);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Lee el listado de ventas en un archivo en formato XML
        /// </summary>
        /// <returns></returns>
        public static List <Venta> Leer()
        {
            List <Venta>        datos   = new List <Venta>();
            string              archivo = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "inventario.xml");
            Xml <List <Venta> > read    = new Xml <List <Venta> >();

            read.Leer(archivo, out datos);

            return(datos);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Carga la lista de empleados desde un archivo Xml, también ejecuta los métodos encargados de obtener las listas de alimentos e Indumentaria de la base de datos.
        /// </summary>
        public static void CargarDatos()
        {
            List <Empleado>        auxList     = new List <Empleado>();
            string                 rutaArchivo = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "Empleados.xml");
            Xml <List <Empleado> > archivoXml  = new Xml <List <Empleado> >();

            archivoXml.Leer(rutaArchivo, out auxList);
            listaEmpleados    = auxList;
            listaAlimentos    = ProductosDAO.ObtenerListaAlimentos();
            listaIndumentaria = ProductosDAO.ObtenerListaIndumentaria();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Metodo que permite leer el archivo Xlm de ordenes de compra externas (Temas Archivos y deserializacion)
        /// </summary>
        /// <returns>Devuelve un booleano para control de ejecucion</returns>
        public static bool Leer()
        {
            bool   retValue = false;
            string path     = String.Format("{0}\\OrdenesDeCompraExternas.xml", Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
            Xml <List <OrdenDeCompra> > auxListaOrdenes = new Xml <List <OrdenDeCompra> >();

            if (auxListaOrdenes.Leer(path, out Distribuidora.listaDeOrdenesDeCompra))
            {
                retValue = true;
            }

            return(retValue);
        }
Exemplo n.º 10
0
        public static string Leer()
        {
            Xml <Docente> auxArchivo = new Xml <Docente>();
            //List<Docente> auxArchivo = new List<Docente>();
            //string path = AppDomain.CurrentDomain.BaseDirectory;
            string path = (Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\SegundoParcial\JardinUtn\Docentes.xml");

            if (!auxArchivo.Leer(path + @"Docentes.xml", out Docente rtn))
            {
                rtn = null;
            }

            return(rtn.ToString());
        }
Exemplo n.º 11
0
        public static void CargarColaPedidos()
        {
            Queue <PedidoConfirmado> auxColaPedidos = new Queue <PedidoConfirmado>();
            List <PedidoConfirmado>  auxList;
            string rutaArchivo = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "Pedidos.xml");
            Xml <List <PedidoConfirmado> > archivoXml = new Xml <List <PedidoConfirmado> >();

            archivoXml.Leer(rutaArchivo, out auxList);
            foreach (var item in auxList)
            {
                auxColaPedidos.Enqueue(item);
            }
            colaPedidos = auxColaPedidos;
        }
Exemplo n.º 12
0
        /// <summary>
        /// Metodo utilizado para precargar los pedidos en la pantalla en preparacion
        /// </summary>
        public static void PreCargadoPedidos()
        {
            try
            {
                List <Pedido>        recuperarPedidos = new List <Pedido>();
                Xml <List <Pedido> > archivoXML       = new Xml <List <Pedido> >();

                pedidos = archivoXML.Leer(AppDomain.CurrentDomain.BaseDirectory + @"pedidosPreCarga0000.xml", recuperarPedidos);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// Deserializa
        /// </summary>
        /// <returns></returns>
        public static Carrito LeerXml()
        {
            Xml <Carrito> temp = new Xml <Carrito>();
            Carrito       cTemp;

            // try
            //{
            temp.Leer("carrito.xml", out cTemp);
            //}
            //catch(Exception ex)
            //{
            //  throw new ArchivosException();
            // }
            return(cTemp);
        }
Exemplo n.º 14
0
        /// <summary>
        /// Método estático Leer
        /// Lee los datos del archivo XML datosUniversidad.xml
        /// </summary>
        /// <returns>Retorna un objeto universidad con los datos leidos del archivo</returns>
        public static Universidad Leer()
        {
            Universidad universidad = null;

            try
            {
                Xml <Universidad> datosUniversidad = new Xml <Universidad>();
                datosUniversidad.Leer("datosUniversidad.xml", out universidad);
            }
            catch (Exception e)
            {
                throw new ArchivosException(e);
            }
            return(universidad);
        }
Exemplo n.º 15
0
 /// <summary>
 /// Permite leer la informacion del negocio desde un archivo xml.
 /// </summary>
 /// <returns></returns>
 public static Artistica Leer()
 {
     try
     {
         Artistica       artistica = new Artistica();
         Xml <Artistica> archivo   = new Xml <Artistica>();
         archivo.Leer((System.IO.Directory.GetCurrentDirectory()
                       + @"\ArchivosGuardados\Artistica.xml"), out artistica);
         return(artistica);
     }
     catch (Exception e)
     {
         throw new ArchivosException(e);
     }
 }
        /// <summary>
        /// Lee el listado de ventas guardado en un archivo XML
        /// </summary>
        /// <returns>bool true si se pude deserializar, false si no<Venta></returns>
        public static bool ObtenerVentasXml()
        {
            List <Cliente>        datos  = new List <Cliente>();
            string                path   = AppDomain.CurrentDomain.BaseDirectory + "Ventas.xml";
            Xml <List <Cliente> > auxXML = new Xml <List <Cliente> >();

            auxXML.Leer(path, out datos);

            if (datos != null)
            {
                filaClientes = datos;
                return(true);
            }
            return(false);
        }
Exemplo n.º 17
0
        public List <Persona> Leer()
        {
            bool retorno = false;
            Xml <List <Persona> > leerPersona = new Xml <List <Persona> >();

            retorno = leerPersona.Leer(AppDomain.CurrentDomain.BaseDirectory + "\\Personas.xml", out List <Persona> auxPersona);

            if (retorno)
            {
                return(auxPersona);
            }
            else
            {
                return(new List <Persona>());
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// metodo que lee un objeto casino xml
        /// </summary>
        /// <returns></returns>
        public static Casino Leer()
        {
            Casino informacion = new Casino();

            Xml <Casino> aux = new Xml <Casino>();

            try
            {
                aux.Leer("Casino.xml", out informacion);
            }
            catch (Excepciones.ArchivosException e)
            {
                throw new Excepciones.ArchivosException(e);
            }

            return(informacion);
        }
Exemplo n.º 19
0
        /// <summary>
        /// Deserealiza un archivo xml con pedidos, los carga en una lista y luego los pasa a una cola
        /// </summary>
        /// <returns></returns>
        public static Queue <Pedido> Deserealizar()
        {
            List <Pedido> auxLista = new List <Pedido>();

            Queue <Pedido> auxQueue = new Queue <Pedido>();

            Xml <List <Pedido> > Leer = new Xml <List <Pedido> >();

            if (Leer.Leer(ubicacionArchivo, out auxLista))
            {
                foreach (Pedido item in auxLista)
                {
                    auxQueue.Enqueue(item);
                }
            }

            return(auxQueue);
        }
Exemplo n.º 20
0
        /// <summary>
        /// Leer de clase retornará un Universidad con todos los datos previamente serializados.
        /// </summary>
        /// <returns>una universidad con los datos ya cargados</returns>
        public Universidad Leer()
        {
            Xml <Universidad> xml = new Xml <Universidad>();
            bool        retorno   = false;
            Universidad uni       = new Universidad();

            try
            {
                //string fileName = AppDomain.CurrentDomain.BaseDirectory + "PruebaDeGuardarUniversidad.xml";

                string[] aux = Regex.Split(Directory.GetCurrentDirectory(), @"\\Palmieri.Matias_Ezequiel.2C.TP3");
                aux[0] += "\\Universidad.xml";

                retorno = xml.Leer(aux[0], out uni);
            }
            catch (Exception e)
            {
                throw new Exception("Ocurrio un problema posiblemente en texto.guardar fijate la inner", e);
            }
            return(uni);
        }
Exemplo n.º 21
0
        /// <summary>
        /// Carga las comidas que estan guardadas en el xml
        /// </summary>
        /// <returns></returns>
        ///
        public static bool CargarComidasDelXml()
        {
            List <Comida> listaAux = new List <Comida>();

            string path = String.Concat(AppDomain.CurrentDomain.BaseDirectory, "ListaPedidos.xml");

            Xml <List <Comida> > auxPedidos = new Xml <List <Comida> >();

            if (auxPedidos.Leer(path, out listaAux))
            {
                ///Si entro hasta aca es porque se pudo leer bien el xml ,ahi carga en la cola la lista de comidas en la cola.
                foreach (Comida c in listaAux)
                {
                    cocinandose.Enqueue(c);
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 22
0
 public static void LeerXml()
 {
     ventas = Xml <List <Pedido> > .Leer("ventas.xml");
 }
Exemplo n.º 23
0
        /// <summary>
        /// Lee los datos de un archivo xml.
        /// </summary>
        /// <param name="path">Ruta del archivo.</param>
        /// <returns>Fabrica nueva con los datos del archivo.</returns>
        public static Fabrica Leer(string path)
        {
            Xml <Fabrica> lF = new Xml <Fabrica>();

            return(lF.Leer(path));
        }