コード例 #1
0
 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);
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }