private void Busqueda() { db = new RestaurantEntities(); Lista = FactoryMesas.getItems(db, this.txtBuscar.Text); this.bs.DataSource = Lista; this.bs.ResetBindings(true); }
private void Busqueda() { dc = new RestaurantEntities(); Texto = this.txtBuscar.Text; switch (myLayout.ToUpper()) { case "CLIENTES": this.bindingSource.DataSource = FactoryClientes.getItems(dc, Texto); break; case "MESONEROS": this.bindingSource.DataSource = FactoryUsuarios.getItems(dc, Texto, "MESONERO"); break; case "ADMINISTRADORES": this.bindingSource.DataSource = FactoryUsuarios.getItems(dc, Texto, "ADMINISTRADOR"); break; case "CAJEROS": this.bindingSource.DataSource = FactoryUsuarios.getItems(dc, Texto, "CAJERO"); break; case "MESAS": this.bindingSource.DataSource = FactoryMesas.getItems(dc, Texto); break; case "PLATOS": this.bindingSource.DataSource = FactoryPlatos.getItems(dc, Texto); break; case "COMPRAS": this.bindingSource.DataSource = FactoryCompras.getComprasEspera(dc, Texto); break; case "FACTURAS": this.bindingSource.DataSource = FactoryFacturas.getFacturasPendientes(dc, Texto); break; case "INGREDIENTES": this.bindingSource.DataSource = FactoryIngredientes.getItems(dc, Texto); break; case "PROVEEDORES": this.bindingSource.DataSource = FactoryProveedores.getItems(dc, Texto); break; case "MESAS DISPONIBLES": this.bindingSource.DataSource = FactoryMesas.getMesasDisponibles(dc); break; } this.gridControl1.DataSource = this.bindingSource; gridControl1.ForceInitialize(); gridView1.OptionsLayout.Columns.Reset(); this.gridControl1.DefaultView.RestoreLayoutFromXml(Application.StartupPath + "\\Layouts\\" + myLayout + ".XML", DevExpress.Utils.OptionsLayoutGrid.FullLayout); }