private void data_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (data.Rows[e.RowIndex].Cells[2].Value != "") { PCForm.action = "del"; PCForm.data = data; PCForm.r_index = e.RowIndex; PCForm.pc_tiempo = data.Rows[e.RowIndex].Cells[3].Value.ToString(); PCForm.pc_total = data.Rows[e.RowIndex].Cells[4].Value.ToString(); PCForm.pc_inicio = data.Rows[e.RowIndex].Cells[2].Value.ToString(); PCForm.pc_id = data.Rows[e.RowIndex].Cells[0].Value.ToString(); PCForm.pc_name = data.Rows[e.RowIndex].Cells[1].Value.ToString(); PCForm p = new PCForm(); p.ShowDialog(); } else { PCForm.action = "add"; PCForm.data = data; PCForm.r_index = e.RowIndex; PCForm.pc_id = data.Rows[e.RowIndex].Cells[0].Value.ToString(); PCForm.pc_name = data.Rows[e.RowIndex].Cells[1].Value.ToString(); PCForm p = new PCForm(); p.ShowDialog(); } } catch (NullReferenceException ne) { } }
private void data_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (data.Rows[e.RowIndex].Cells[2].Value != "") { PCForm.action = "del"; PCForm.data = data; PCForm.r_index = e.RowIndex; PCForm.pc_tiempo = data.Rows[e.RowIndex].Cells[3].Value.ToString(); PCForm.pc_total = data.Rows[e.RowIndex].Cells[4].Value.ToString(); PCForm.pc_inicio = data.Rows[e.RowIndex].Cells[2].Value.ToString(); PCForm.pc_id = data.Rows[e.RowIndex].Cells[0].Value.ToString(); PCForm.pc_name = data.Rows[e.RowIndex].Cells[1].Value.ToString(); PCForm p = new PCForm(); p.ShowDialog(); } else { PCForm.action = "add"; PCForm.data = data; PCForm.r_index = e.RowIndex; PCForm.pc_id= data.Rows[e.RowIndex].Cells[0].Value.ToString(); PCForm.pc_name= data.Rows[e.RowIndex].Cells[1].Value.ToString(); PCForm p = new PCForm(); p.ShowDialog(); } } catch (NullReferenceException ne) { } }