public static Entidades.EmpleadosEmails Buscar(Expression <Func <Entidades.EmpleadosEmails, bool> > criterio)
 {
     using (var conec = new DAL.Respository <Entidades.EmpleadosEmails>())
     {
         try
         {
             return(conec.Buscar(criterio));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
 public static bool Modificar(Facturas factura)
 {
     using (var context = new DAL.Respository <Entidades.Facturas>())
     {
         try
         {
             return(context.Modificar(factura));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
 public static Productos BuscarOtro(int id)
 {
     using (var context = new DAL.Respository <Entidades.Productos>())
     {
         try
         {
             return(context.BuscarOtro(id));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
 public static List <Entidades.Empleados> GetListAll()
 {
     using (var conec = new DAL.Respository <Entidades.Empleados>())
     {
         try
         {
             return(conec.GetListAll());
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
 public static List <Entidades.Empleados> GetList(Expression <Func <Entidades.Empleados, bool> > criterio)
 {
     using (var conec = new DAL.Respository <Entidades.Empleados>())
     {
         try
         {
             return(conec.GetList(criterio));
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
Пример #6
0
        public static bool Guardar(Entidades.EmpleadosRetenciones relacion)
        {
            using (var conec = new DAL.Respository <Entidades.EmpleadosRetenciones>())
            {
                try
                {
                    return(conec.Guardar(relacion));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
Пример #7
0
        public static bool Eliminar(Entidades.Facturas factura)
        {
            using (var Context = new DAL.Respository <Entidades.Facturas>())
            {
                try
                {
                    return(Context.Eliminar(factura));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
        public static bool Modificar(Entidades.Retenciones retencion)
        {
            using (var conec = new DAL.Respository <Entidades.Retenciones>())
            {
                try
                {
                    return(conec.Modificar(retencion));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
Пример #9
0
        public static List <Entidades.Productos> ListaTodo()
        {
            using (var Context = new DAL.Respository <Entidades.Productos>())
            {
                try
                {
                    return(Context.ListaTodo());
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(null);
        }
Пример #10
0
        public static List <Entidades.Productos> Lista(Expression <Func <Entidades.Productos, bool> > criterio)
        {
            using (var Context = new DAL.Respository <Entidades.Productos>())
            {
                try
                {
                    return(Context.Lista(criterio));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(null);
        }
Пример #11
0
        public static bool Eliminar(Entidades.Productos producto)
        {
            using (var Context = new DAL.Respository <Entidades.Productos>())
            {
                try
                {
                    return(Context.Eliminar(producto));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
        public static bool Eliminar(Entidades.EmpleadosEmails email)
        {
            using (var conec = new DAL.Respository <Entidades.EmpleadosEmails>())
            {
                try
                {
                    return(conec.Eliminar(email));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
Пример #13
0
        public static Entidades.Facturas Buscar(Expression <Func <Entidades.Facturas, bool> > criterio)
        {
            using (var Context = new DAL.Respository <Entidades.Facturas>())
            {
                try
                {
                    return(Context.Buscar(criterio));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(null);
        }
        public static bool Modificar(Entidades.Empleados empleado)
        {
            using (var conec = new DAL.Respository <Entidades.Empleados>())
            {
                try
                {
                    return(conec.Modificar(empleado));
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(false);
        }
 public static bool Guardar(Facturas factura)
 {
     using (var context = new DAL.Respository <Entidades.Facturas>())
     {
         try
         {
             if (Buscar(p => p.FacturaId == factura.FacturaId) == null)
             {
                 return(context.Guardar(factura));
             }
             else
             {
                 return(context.Modificar(factura));
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
 public static bool Guardar(Productos producto)
 {
     using (var context = new DAL.Respository <Entidades.Productos>())
     {
         try
         {
             if (Buscar(p => p.ProductoId == producto.ProductoId) == null)
             {
                 return(context.Guardar(producto));
             }
             else
             {
                 return(context.Modificar(producto));
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
 }
        public static Entidades.Empleados Buscar(Expression <Func <Entidades.Empleados, bool> > criterio)
        {
            var empleado = new Entidades.Empleados();

            using (var conec = new DAL.Respository <Entidades.Empleados>())
            {
                try
                {
                    empleado = conec.Buscar(criterio);

                    if (empleado != null)
                    {
                        empleado.Retenciones.Count();
                        empleado.Relacion.Count();
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }

            return(empleado);
        }