public void Fill() { AlumnosEntities1 context = new AlumnosEntities1(); var query = context.Alumno.AsQueryable(); if (!String.IsNullOrEmpty(Filtro)) { query = query.Where(x => x.Nombres.Contains(Filtro.ToUpper())); } LstAlumnos = query.ToList(); }
public void Fill() { DBSISALMINTEntities context = new DBSISALMINTEntities(); var a = context.Producto.ToList().Count; var query = context.Producto.Where(x => x.Estado == "ACT").AsQueryable(); if (!string.IsNullOrEmpty(Filtro)) { query = query.Where(x => x.Nombre.ToUpper().Contains(Filtro.ToUpper())); } LstProducto = query.ToList(); }
private void CvFiltrable_Filter(object sender, FilterEventArgs e) { if (string.IsNullOrEmpty(Filtro)) { e.Accepted = true; return; } var buscar = e.Item as PacienteBE; if (buscar.Nombres.ToUpper().Contains(Filtro.ToUpper()) || buscar.Apellidos.ToUpper().Contains(Filtro.ToUpper()) || buscar.Dni.ToUpper().Contains(Filtro.ToUpper())) { e.Accepted = true; } else { e.Accepted = false; } }
/// <summary> /// Método para cargar los datos a listar en un DataSet /// </summary> public void LlenarDataSet() { string condicion = ""; if (!String.IsNullOrEmpty(Filtro)) { condicion = "("; for (int i = 0; i < PerfilShow.CamposId.Length; i++) { condicion = condicion + PerfilShow.CamposId[i] + " LIKE '%" + Filtro.ToUpper() + "%'"; if (i != PerfilShow.CamposId.Length - 1) { condicion = condicion + " OR "; } } if (!String.IsNullOrEmpty(ComplementoFiltro)) { condicion = condicion + " OR " + ComplementoFiltro; } } if (!String.IsNullOrEmpty(condicion)) { condicion = condicion + ") AND"; } string camp = ""; camp = "DISTINCT " + PerfilShow.Llave + "," + camp.Vector2Cadena(",", PerfilShow.Campos); String cad = String.Format("SELECT {0} FROM {1} {2} WHERE {3} delmrk = 1 {4} ORDER BY {5} ", camp, PerfilShow.Tabla, Relacion, condicion, Complemento, campoOrden); DataTable dt = DataBase.ExecuteQueryDataTable(cad, "datos", CommandType.Text, null, ConexionDB.getInstancia().Conexion(database, null)); dsGeneral.Tables.Clear(); dsGeneral.Tables.Add(dt); }