public static List <Prestamo> FiltrarPrestamos(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <Prestamo, bool> > filtro = p => true;
            Repositorio <Prestamo> repositorio         = new Repositorio <Prestamo>();
            List <Prestamo>        list = new List <Prestamo>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //Todo por fecha
                filtro = p => p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 2:    //PrestamoId
                filtro = p => p.PrestamoId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 3:    //CuentaId
                filtro = p => p.CuentaId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
        public static List <Inventarios> FiltrarInventarios(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <Inventarios, bool> > filtro = p => true;
            Repositorio <Inventarios> repositorio         = new Repositorio <Inventarios>();
            List <Inventarios>        list = new List <Inventarios>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //Todo por fecha
                filtro = p => p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 2:    //EntradaId
                filtro = p => p.InventarioId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 3:    //ProductoId
                filtro = p => p.RopaId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
        public static List <CuentaBancaria> FiltrarCuentas(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <CuentaBancaria, bool> > filtro = p => true;
            Repositorio <CuentaBancaria> repositorio         = new Repositorio <CuentaBancaria>();
            List <CuentaBancaria>        list = new List <CuentaBancaria>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //Todo por fecha
                filtro = p => p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 2:    //CuentaId
                filtro = p => p.CuentaBancariaId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 3:    //Nombre
                filtro = p => p.Nombre.Contains(criterio) && p.Fecha >= desde && p.Fecha <= hasta;
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
 public static List <Entidades.TiposEmails> GetList(Expression <Func <Entidades.TiposEmails, bool> > criterioBusqueda)
 {
     using (var repositorio = new Repositorio <Entidades.TiposEmails>())
     {
         return(repositorio.GetList(criterioBusqueda));
     }
 }
Esempio n. 5
0
        public static bool GetList(Expression <Func <Factura, bool> > criterio, bool relaciones)
        {
            using (var db = new Repositorio <Factura>())
            {
                if ((facturaReturnedList = db.GetList(criterio)) != null)
                {
                    if (relaciones)
                    {
                        foreach (var factura in facturaReturnedList)
                        {
                            ClientesBLL.Buscar(x => x.ClienteId == factura.ClienteId, false);
                            FormasDePagosBLL.Buscar(x => x.FormaDePagoId == factura.FormaDePagoId);
                            factura.FormaDePago = FormasDePagosBLL.formaDePagoReturned;
                            factura.Cliente     = ClientesBLL.clienteReturned;
                            factura.Productos.Count();
                            facturaReturned.Pagos.Count();

                            foreach (var producto in factura.Productos)
                            {
                                int id = producto.ProductoId;
                                ProductosBLL.Buscar(x => x.ProductoId == id, true);
                                producto.Producto = ProductosBLL.productoReturned;
                            }
                        }
                    }
                    return(true);
                }
                return(false);
            }
        }
Esempio n. 6
0
        public static List <Carta> FiltrarDepositos(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <Carta, bool> > filtro = p => true;
            Repositorio <Carta> repositorio         = new Repositorio <Carta>();
            List <Carta>        list = new List <Carta>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //Todo por fecha
                filtro = p => p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 2:    //CartaId
                filtro = p => p.CartaId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 3:    //DestinatarioId
                filtro = p => p.DestinatarioId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 4:    //Inicio del Cuerpo
                filtro = p => p.Cuerpo.Contains(criterio) && p.Fecha >= desde && p.Fecha <= hasta;
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
 public static List <FacturaDetalles> GetList(Expression <Func <FacturaDetalles, bool> > criterioBusqueda)
 {
     using (var repositorio = new Repositorio <FacturaDetalles>())
     {
         return(repositorio.GetList(criterioBusqueda));
     }
 }
Esempio n. 8
0
        public static List <Ropas> FiltrarRopas(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <Ropas, bool> > filtro = p => true;
            Repositorio <Ropas> repositorio         = new Repositorio <Ropas>();
            List <Ropas>        list = new List <Ropas>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //Todo por fecha
                filtro = p => p.FechaRegistro >= desde && p.FechaRegistro <= hasta;
                break;

            case 2:    //ProductoId
                filtro = p => p.RopaId == id && p.FechaRegistro >= desde && p.FechaRegistro <= hasta;
                break;

            case 3:    //Descripcion
                filtro = p => p.Descripcion.Contains(criterio) && p.FechaRegistro >= desde && p.FechaRegistro <= hasta;
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 9
0
        public static List <Departamento> FiltrarDepartamentos(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <Departamento, bool> > filtro = p => true;
            Repositorio <Departamento> repositorio         = new Repositorio <Departamento>();
            List <Departamento>        list = new List <Departamento>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //DepartamentoId
                filtro = p => p.DepartamentoId == id;
                break;

            case 2:    //Nombre
                filtro = p => p.Nombre.Contains(criterio);
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 10
0
        public static List <Usuario> FiltrarUsuarios(int index, string criterio, DateTime desde, DateTime hasta)
        {
            Expression <Func <Usuario, bool> > filtro = p => true;
            Repositorio <Usuario> repositorio         = new Repositorio <Usuario>();
            List <Usuario>        list = new List <Usuario>();

            int id = ToInt(criterio);

            switch (index)
            {
            case 0:    //Todo
                break;

            case 1:    //Todo por fecha
                filtro = p => p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 2:    //UsuarioId
                filtro = p => p.UsuarioId == id && p.Fecha >= desde && p.Fecha <= hasta;
                break;

            case 3:    //Descripcion
                filtro = p => p.Nombres.Contains(criterio) && p.Fecha >= desde && p.Fecha <= hasta;
                break;
            }

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 11
0
        public static List <Usuario> FUsuarios()
        {
            Expression <Func <Usuario, bool> > filtro = p => true;
            Repositorio <Usuario> repositorio         = new Repositorio <Usuario>();
            List <Usuario>        list = new List <Usuario>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 12
0
        public static List <Ropas> FRopas()
        {
            Expression <Func <Ropas, bool> > filtro = p => true;
            Repositorio <Ropas> repositorio         = new Repositorio <Ropas>();
            List <Ropas>        list = new List <Ropas>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 13
0
        public static List <Inventarios> FInventarios()
        {
            Expression <Func <Inventarios, bool> > filtro = p => true;
            Repositorio <Inventarios> repositorio         = new Repositorio <Inventarios>();
            List <Inventarios>        list = new List <Inventarios>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 14
0
        //Lista para el Detalle.
        public static List <FacturaDetalle> ListaDetalle(int IdLista)
        {
            Repositorio <FacturaDetalle> repositorio = new Repositorio <FacturaDetalle>();
            List <FacturaDetalle>        list        = new List <FacturaDetalle>();
            int id = IdLista;

            list = repositorio.GetList(c => c.FacturaId == id);

            return(list);
        }
        public static List <CuentaBancaria> FCuentas(Expression <Func <CuentaBancaria, bool> > filtro)
        {
            filtro = p => true;
            Repositorio <CuentaBancaria> repositorio = new Repositorio <CuentaBancaria>();
            List <CuentaBancaria>        list        = new List <CuentaBancaria>();

            list = repositorio.GetList(filtro);

            return(list);
        }
        public static List <Prestamo> FPrestamos(Expression <Func <Prestamo, bool> > filtro)
        {
            filtro = p => true;
            Repositorio <Prestamo> repositorio = new Repositorio <Prestamo>();
            List <Prestamo>        list        = new List <Prestamo>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 17
0
        public static List <FacturaDetalle> FilFacturas(int id)
        {
            Expression <Func <FacturaDetalle, bool> > filtro = p => true;
            Repositorio <FacturaDetalle> repositorio         = new Repositorio <FacturaDetalle>();
            List <FacturaDetalle>        list = new List <FacturaDetalle>();

            list = repositorio.GetList(p => p.FacturaId == id);

            return(list);
        }
Esempio n. 18
0
        public static List <Factura> FFacturas()
        {
            Expression <Func <Factura, bool> > filtro = p => true;
            Repositorio <Factura> repositorio         = new Repositorio <Factura>();
            List <Factura>        list = new List <Factura>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 19
0
        public static List <Departamento> FDepartamentos()
        {
            Expression <Func <Departamento, bool> > filtro = p => true;
            Repositorio <Departamento> repositorio         = new Repositorio <Departamento>();
            List <Departamento>        list = new List <Departamento>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 20
0
        //Métodos que retornan la lista en el Imprimir de las Consultas (Reportes).
        public static List <Cliente> FClientes()
        {
            Expression <Func <Cliente, bool> > filtro = p => true;
            Repositorio <Cliente> repositorio         = new Repositorio <Cliente>();
            List <Cliente>        list = new List <Cliente>();

            list = repositorio.GetList(filtro);

            return(list);
        }
Esempio n. 21
0
 public static bool GetList(Expression <Func <Usuario, bool> > criterio, bool relaciones)
 {
     using (var db = new Repositorio <Usuario>())
     {
         if ((usuarioReturnedList = db.GetList(criterio)) != null)
         {
             return(true);
         }
         return(false);
     }
 }
Esempio n. 22
0
 public static bool GetList(Expression <Func <FormaDePago, bool> > criterio)
 {
     using (var db = new Repositorio <FormaDePago>())
     {
         if ((formaDePagoReturnedList = db.GetList(criterio)) != null)
         {
             return(true);
         }
         return(false);
     }
 }
Esempio n. 23
0
        public bool Verificar(string usuario, string contrasena)
        {
            bool paso = false;

            Repositorio <Usuarios> BLL = new Repositorio <Usuarios>();
            Expression <Func <Usuarios, bool> > filtrar = x => true;

            filtrar = t => t.Usuario.Equals(usuario) && t.Contraseña.Equals(contrasena);

            if (BLL.GetList(filtrar).Count() != 0)
            {
                paso = true;
            }

            return(paso);
        }
        public static List <Empleados> GetList(Expression <Func <Empleados, bool> > criterio)
        {
            List <Empleados> lista = null;

            using (var db = new Repositorio <Empleados>())
            {
                try
                {
                    lista = db.GetList(criterio).ToList();
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(lista);
        }
Esempio n. 25
0
        public static void Autenticar(string email, string password, Page page)
        {
            Repositorio <Usuario> repositorio          = new Repositorio <Usuario>();
            Expression <Func <Usuario, bool> > filtrar = x => true;
            Usuario usuario = new Usuario();

            filtrar = t => t.Email.Equals(email) && t.Password.Equals(password);

            if (repositorio.GetList(filtrar).Count() != 0)
            {
                FormsAuthentication.RedirectFromLoginPage(usuario.Email, true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(page, typeof(Page), "toastr_message", script: "toastr['error'] ('Usuario o Contraseña Incorrecto');", addScriptTags: true);
            }
        }
Esempio n. 26
0
        //Para verificar el inicio de sesión.
        public static void Autenticar(string email, string password, Page page)
        {
            Repositorio <Usuario> repositorio          = new Repositorio <Usuario>();
            Expression <Func <Usuario, bool> > filtrar = x => true;
            Usuario usuario = new Usuario();

            filtrar = t => t.Email.Equals(email) && t.Password.Equals(password);

            if (repositorio.GetList(filtrar).Count() != 0)
            {
                FormsAuthentication.RedirectFromLoginPage(usuario.Email, true);
            }
            else
            {
                ShowToastr(page, "Email o Contraseña incorrectos", "Error", "error");
            }
        }
Esempio n. 27
0
 public static bool GetList(Expression <Func <Producto, bool> > criterio, bool relaciones)
 {
     using (var db = new Repositorio <Producto>())
     {
         if ((productoReturnedList = db.GetList(criterio)) != null)
         {
             if (relaciones)
             {
                 foreach (var producto in productoReturnedList)
                 {
                     producto.Facturas.Count();
                 }
             }
             return(true);
         }
         return(false);
     }
 }
Esempio n. 28
0
 public static bool GetList(Expression <Func <Ruta, bool> > criterio, bool relaciones)
 {
     using (var db = new Repositorio <Ruta>())
     {
         if ((rutaReturnedList = db.GetList(criterio)) != null)
         {
             if (relaciones)
             {
                 foreach (var ruta in rutaReturnedList)
                 {
                     ruta.Clientes.Count();
                 }
             }
             return(true);
         }
         return(false);
     }
 }
Esempio n. 29
0
 public static bool GetList(Expression <Func <Pago, bool> > criterio, bool relaciones)
 {
     using (var db = new Repositorio <Pago>())
     {
         if ((pagoReturnedList = db.GetList(criterio)) != null)
         {
             if (relaciones)
             {
                 foreach (var pago in pagoReturnedList)
                 {
                     FacturasBLL.Buscar(x => x.FacturaId == pago.FacturaId, true);
                     pago.Factura = FacturasBLL.facturaReturned;
                 }
             }
             return(true);
         }
         return(false);
     }
 }
Esempio n. 30
0
 public static bool GetList(Expression <Func <Cliente, bool> > criterio, bool relaciones)
 {
     using (var db = new Repositorio <Cliente>())
     {
         if ((clienteReturnedList = db.GetList(criterio)) != null)
         {
             if (relaciones)
             {
                 foreach (var cliente in clienteReturnedList)
                 {
                     cliente.Facturas.Count();
                     RutasBLL.Buscar(x => x.RutaId == cliente.RutaId, false);
                     cliente.Ruta = RutasBLL.rutaReturned;
                 }
             }
             return(true);
         }
         return(false);
     }
 }