private void btnbuscar_Click(object sender, EventArgs e) { Seleccion seleccion = new Seleccion("Proveedores", "Select idproveedor as 'ID', nombre as 'Nombre' from Proveedores"); seleccion.ShowDialog(); if (seleccion.DialogResult == DialogResult.OK) { txtProveedor.Text = seleccion.NombreEntidad; txtIdProveedor.Text = seleccion.IDEntidad.ToString();; } }
private void btnbuscar_Click(object sender, EventArgs e) { Seleccion seleccion = new Seleccion("Empleados", "Select idempleado as 'ID', nombre +' '+ apellido as 'Nombre'," + " cargo as 'Cargo', telefono as 'Telefono' from empleados"); seleccion.ShowDialog(); if (seleccion.DialogResult == DialogResult.OK) { txtidempleado.Text = seleccion.IDEntidad.ToString(); txtsupervisor.Text = seleccion.NombreEntidad; } }
private void button3_Click(object sender, EventArgs e) { Seleccion seleccion = new Seleccion("Articulos", "Select idarticulo as 'ID', nombre_articulo as 'Articulo', cantidad as 'Cantidad', " + " marca as 'Marca', descripcion as 'Descripcion' from articulos where cantidad > 0 "); seleccion.ShowDialog(); if (seleccion.DialogResult == DialogResult.OK) { txtnoarticulo.Text = seleccion.IDEntidad.ToString(); txtDescripcion.Text = seleccion.NombreEntidad; txtCantidad.Text = "1"; } }
private void button1_Click(object sender, EventArgs e) { Seleccion seleccion = new Seleccion("Departamentos", "Select departamentos.iddepartamento as 'ID', departamentos.nombredepto as 'Departamento', " + "empleados.nombre +' '+ empleados.apellido as 'Supervisor' from Departamentos join Empleados on empleados.idempleado = departamentos.idempleado"); seleccion.ShowDialog(); if (seleccion.DialogResult == DialogResult.OK) { txtIDDepto.Text = seleccion.IDEntidad.ToString(); txtDepartamento.Text = seleccion.NombreEntidad; txtSupervisor.Text = seleccion.CampoExtra; } }