Ejemplo n.º 1
0
 public BodegaRepository()
 {
     lock (sync) // Evitamos que otros hilos interfieran
     {
         DBBodega = new BodegaEntities();
     }
 }
Ejemplo n.º 2
0
        ///Listar con filtros
        public IEnumerable <Clientes> ListarAllRegistros(int opc, string valor)
        {
            Contexto = new BodegaEntities();
            var Busqueda = new List <Clientes>();

            switch (opc)
            {
            case 1:
                Busqueda = Contexto.ListarClientes().Where(c => c.Apellidos.ToLower().Contains(valor.ToLower())).ToList();
                break;

            case 2:
                Busqueda = Contexto.ListarClientes().Where(c => c.Nombres.ToLower().Contains(valor.ToLower())).ToList();
                break;

            default:
                Busqueda = Contexto.ListarClientes().ToList();
                break;
            }

            return(Busqueda);
        }
Ejemplo n.º 3
0
 public FacturaRepository()
 {
     Contexto = new BodegaEntities();
     Detalles = new List <FacturaDetalle>();
 }
Ejemplo n.º 4
0
 public IEnumerable <Clientes> ListarAllRegistros()
 {
     Contexto = new BodegaEntities();
     return(new ReadOnlyCollection <Clientes>(
                Contexto.ListarClientes().ToList()));
 }
Ejemplo n.º 5
0
 public ClientesRepository()
 {
     Contexto = new BodegaEntities();
 }
Ejemplo n.º 6
0
 public IEnumerable <Producto> ListarAllRegistros()
 {
     Contexto = new BodegaEntities();
     return(Contexto.ListarProductos().ToList());
 }
Ejemplo n.º 7
0
 public ProductoRepository()
 {
     Contexto = new BodegaEntities();
 }