private void Busqueda() { db = new DatosEntities(); Lista = FactoryProveedores.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); }
void CedulaRifButtonEdit_Validating(object sender, CancelEventArgs e) { DevExpress.XtraEditors.TextEdit Editor = (DevExpress.XtraEditors.TextEdit)sender; if (!Editor.IsModified) { return; } string Texto = Editor.Text; this.compraBindingSource.EndEdit(); List <Proveedore> T = FactoryProveedores.getItems(Texto); switch (T.Count) { case 0: proveedor = new Proveedore(); proveedor.CedulaRif = Basicas.CedulaRif(Texto); break; case 1: proveedor = T[0]; break; default: FrmBuscarEntidades F = new FrmBuscarEntidades(); F.BuscarProveedores(Texto); if (F.registro != null) { proveedor = (Proveedore)F.registro; proveedor = FactoryProveedores.Item(proveedor.CedulaRif); } else { proveedor = null; } break; } LeerProveedor(); }
void CedulaRifTextEdit_Validating(object sender, CancelEventArgs e) { DevExpress.XtraEditors.TextEdit Editor = (DevExpress.XtraEditors.TextEdit)sender; if (!Editor.IsModified) { return; } string Texto = Editor.Text; List <Proveedore> T = FactoryProveedores.getItems(Texto); switch (T.Count) { case 0: Editor.Text = Basicas.CedulaRif(Texto); break; case 1: registro.CedulaRif = T[0].CedulaRif; registro.NombreRazonSocial = T[0].RazonSocial; break; default: FrmBuscarEntidades F = new FrmBuscarEntidades(); F.BuscarProveedores(Texto); if (F.registro != null) { registro.CedulaRif = ((Proveedore)F.registro).CedulaRif; registro.NombreRazonSocial = ((Proveedore)F.registro).RazonSocial; } else { registro.CedulaRif = null; registro.NombreRazonSocial = null; } break; } }