private void buttonEditar_Click(object sender, EventArgs e) { int r = this.dataGridReparacion.CurrentCell.RowIndex; frmAgregarEditarGarantia faeg = new frmAgregarEditarGarantia(true, Convert.ToInt32(this.dataGridReparacion.Rows[r].Cells["idgarantia"].Value.ToString())); faeg.actualizarDataGridEvento += new frmAgregarEditarGarantia.actualizarDataGrid(llenarDataGrid); faeg.MdiParent = this.MdiParent; faeg.Show(); }
private void buttonGarantia_Click(object sender, EventArgs e) { int r = this.dataGridReparacion.CurrentCell.RowIndex; if (Convert.ToInt32(this.dataGridReparacion.Rows[r].Cells["estado"].Value) == 2 || Convert.ToInt32(this.dataGridReparacion.Rows[r].Cells["estado"].Value) == 3) { frmAgregarEditarGarantia faeg = new frmAgregarEditarGarantia(false, Convert.ToInt32(this.dataGridReparacion.Rows[r].Cells["idreparacion"].Value)); faeg.MdiParent = this.MdiParent; faeg.Show(); } else if (Convert.ToInt32(this.dataGridReparacion.Rows[r].Cells["estado"].Value) == 4 || Convert.ToInt32(this.dataGridReparacion.Rows[r].Cells["estado"].Value) == 5) { MessageBox.Show("Esta reparación ya tiene garantía.", "Información"); return; } else { MessageBox.Show("Para aplicar una garantía la OT debe estar facturada.","Información"); return; } }