public static Entidades.FacturasProductos BuscarB(int id) { Entidades.FacturasProductos nuevo; using (var db = new LibreriaCamiloDb()) { try { nuevo = db.FacturasProductos.Find(id); } catch (Exception) { throw; } return(nuevo); } }
public static Productos BuscarRelacion(int id) { Productos estudiante = null; using (var conexion = new LibreriaCamiloDb()) { try { estudiante = conexion.Productos.Find(id); } catch (Exception) { throw; } } return(estudiante); }
public static List <Entidades.FacturasProductos> GetListado(Expression <Func <Entidades.FacturasProductos, bool> > criterioBusqueda) { List <Entidades.FacturasProductos> lista = new List <Entidades.FacturasProductos>(); using (var db = new LibreriaCamiloDb()) { try { lista = db.FacturasProductos.Where(criterioBusqueda).ToList(); } catch (Exception) { throw; } return(lista); } }
public static List <Entidades.FacturasProductos> GetListodo() { List <Entidades.FacturasProductos> lista = new List <Entidades.FacturasProductos>(); using (var db = new LibreriaCamiloDb()) { try { lista = db.FacturasProductos.ToList(); } catch (Exception) { throw; } return(lista); } }
public static bool Guardar(FacturasProductos relacion) { bool resultado = false; using (var conexion = new LibreriaCamiloDb()) { try { conexion.FacturasProductos.Add(relacion); conexion.SaveChanges(); resultado = true; } catch (Exception) { throw; } } return(resultado); }
public static List <Productos> Listar(Expression <Func <FacturasProductos, bool> > criterioBusqueda) { List <Productos> listado = new List <Productos>(); List <FacturasProductos> relaciones = null; using (var conexion = new LibreriaCamiloDb()) { try { relaciones = conexion.FacturasProductos.Where(criterioBusqueda).ToList(); foreach (var item in relaciones) { listado.Add(ProductosBLL.BuscarRelacion(item.ProductoId)); } } catch (Exception) { throw; } } return(listado); }