public List <Empleado1> LeerEmpleados() { string datos = archivoEmpleado.Leer(); if (datos != null) { List <Empleado1> empleado = new List <Empleado1>(); string[] lineas = datos.Split('\n'); for (int i = 0; i < lineas.Length - 1; i++) { string[] campos = lineas[i].Split('|'); Empleado1 a = new Empleado1() { Nombre = campos[0], Direccion = campos[1], Correo = campos[2], Telefono = campos[3], Area = campos[4] }; empleado.Add(a); } Empleado = empleado; return(empleado); } else { return(null); } }
public List <Clientes1> LeerClientes() { string datos = archivoCliente.Leer(); if (datos != null) { List <Clientes1> clientes = new List <Clientes1>(); string[] lineas = datos.Split('\n'); for (int i = 0; i < lineas.Length - 1; i++) { string[] campos = lineas[i].Split('|'); Clientes1 a = new Clientes1() { Nombre = campos[0], Direccion = campos[1], RFC = campos[2], Telefono = campos[3], Correo = campos[4] }; clientes.Add(a); } Clientes = clientes; return(clientes); } else { return(null); } }
public List <Categorias1> LeerCategoria() { string datos = archivoCategorias.Leer(); if (datos != null) { List <Categorias1> categorias = new List <Categorias1>(); string[] lineas = datos.Split('\n'); for (int i = 0; i < lineas.Length - 1; i++) { string[] campos = lineas[i].Split('|'); Categorias1 a = new Categorias1() { Nombre = campos[0] }; categorias.Add(a); } categoria = categorias; return(categorias); } else { return(null); } }
public List <productos> LeerProductos() { string datos = archivoProductos.Leer(); if (datos != null) { List <productos> Productos = new List <productos>(); string[] lineas = datos.Split('\n'); for (int i = 0; i < lineas.Length - 1; i++) { string[] campos = lineas[i].Split('|'); productos a = new productos() { Nombre = campos[0], Descripcion = campos[1], PrecioDeCompra = campos[2], PrecioDeVenta = campos[3], Presentacion = campos[4], Categoria = campos[5] }; Productos.Add(a); } Producto = Productos; return(Productos); } else { return(null); } }