private void btnModificar_Click(object sender, EventArgs e) { try { fTags = new FormularioTags(); if (fTags.idTags == null || fila == null) { MessageBox.Show("Fila sin datos"); btnAgregar.Enabled = false; btnModificar.Enabled = false; } else { fTags.idTags = Convert.ToInt32(dataGridView1.Rows[fila].Cells[0].Value.ToString()); fTags.numTag = Convert.ToInt32(dataGridView1.Rows[fila].Cells[1].Value.ToString()); fTags.numSitio2 = Convert.ToInt32(dataGridView1.Rows[fila].Cells[2].Value.ToString()); fTags.tipVehiculo = dataGridView1.Rows[fila].Cells[3].Value.ToString(); fTags.placas = dataGridView1.Rows[fila].Cells[4].Value.ToString(); fTags.color = dataGridView1.Rows[fila].Cells[5].Value.ToString(); fTags.obser = dataGridView1.Rows[fila].Cells[7].Value.ToString(); fTags.cont = 2; fTags.ShowDialog(); } } catch { } }
private void btnAgregar_Click(object sender, EventArgs e) { fTags = new FormularioTags(); fTags.cont = 1; fTags.ShowDialog(); }