private void BtEliminar_Click(object sender, EventArgs e) { try { DialogResult Opcion; Opcion = MessageBox.Show("¿Realmente desea ELIMINAR los registros?", "Aplicación Eléctricos", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (Opcion == DialogResult.Yes) { string Codigo; string Rpta = ""; foreach (DataGridViewRow row in DGVALL.Rows) { if (Convert.ToBoolean(row.Cells[0].Value)) { Codigo = Convert.ToString(row.Cells[2].Value); Rpta = NInformacion.eliminarinfo(b, Convert.ToInt32(Codigo)); if (Rpta.Equals("OK")) { this.MensajeOk("Se Elimnó el registro Correctamente"); } else { this.MensajeError(Rpta); } } } this.Mostrar(); } } catch (Exception ex) { MessageBox.Show(ex.Message + ex.StackTrace); } }
private void Buscar() { if (this.LbPlanilla.Text == "Obras") { if (this.CbTipo.Text != "") { Tp = this.CbTipo.Text; } else { Tp = null; } if (this.CbElectrico.Text != "") { El = this.CbElectrico.Text; } else { El = null; } this.DGVALL.DataSource = NInformacion.BuscarObra(this.textBox1.Text, Tp, El); label5.Text = Convert.ToString(DGVALL.Rows.Count); } }
private void Mostrar() { this.DGVALL.DataSource = NInformacion.mostrarinfo(a); label5.Text = Convert.ToString(DGVALL.Rows.Count);//realiza conteo de filas }