private void btnEliminarSelected_Click(object sender, EventArgs e) { if (dtvProveedores.Rows.Count == 0) { MessageBox.Show("¡Aún no hay proveedores en existencia!", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { FrmCRUDProveedor crudp = new FrmCRUDProveedor(); crudp.Show(); crudp.lblCodigo.Visible = true; crudp.btnEliminar.Visible = true; crudp.btnEditar.Visible = false; crudp.btnAgregar.Visible = false; crudp.btnHabilitar.Visible = false; /***************************************/ crudp.txtNombreProV.Enabled = true; crudp.txtUbicacion.Enabled = true; crudp.txtTelefono.Enabled = true; crudp.txtEmail.Enabled = true; /**********************************************************************/ String id = dtvProveedores.CurrentRow.Cells[0].Value.ToString(); String Nombre = dtvProveedores.CurrentRow.Cells[1].Value.ToString(); String ubicacion = dtvProveedores.CurrentRow.Cells[2].Value.ToString(); String telefono = dtvProveedores.CurrentRow.Cells[3].Value.ToString(); String email = dtvProveedores.CurrentRow.Cells[4].Value.ToString(); crudp.lblCodigo.Text = id; crudp.txtNombreProV.Text = Nombre; crudp.txtUbicacion.Text = ubicacion; crudp.txtTelefono.Text = telefono; crudp.txtEmail.Text = email; } }
private void btnAgregarNuevo_Click(object sender, EventArgs e) { FrmCRUDProveedor crudp = new FrmCRUDProveedor(); crudp.Show(); crudp.lblCodigo.Visible = false; crudp.btnEliminar.Visible = false; crudp.btnEditar.Visible = false; }