private void btnUpdate_Click(object sender, EventArgs e) { if (dgvJydj.SelectedRows.Count == 0) { return; } string xmbh = dgvJyjg.SelectedRows[0].Cells["xmbh"].Value.ToString().Trim(); string xmmc = dgvJyjg.SelectedRows[0].Cells["xmmc"].Value.ToString().Trim(); string xmsx = dgvJyjg.SelectedRows[0].Cells["xmsx"].Value.ToString().Trim(); string dy = dgvJyjg.SelectedRows[0].Cells["dy"].Value.ToString().Trim(); string xy = dgvJyjg.SelectedRows[0].Cells["xy"].Value.ToString().Trim(); string spy = dgvJyjg.SelectedRows[0].Cells["spy"].Value.ToString().Trim(); string xpy = dgvJyjg.SelectedRows[0].Cells["xpy"].Value.ToString().Trim(); string bl = dgvJyjg.SelectedRows[0].Cells["bl"].Value.ToString().Trim(); string xh = dgvJyjg.SelectedRows[0].Cells["xh"].Value.ToString().Trim(); string dw = dgvJyjg.SelectedRows[0].Cells["dw"].Value.ToString().Trim(); string mrz = dgvJyjg.SelectedRows[0].Cells["mrz"].Value.ToString().Trim(); if (bl == "") { bl = "1"; } int index = dgvJydj.SelectedRows[0].Index; Form_addJyxm frm = new Form_addJyxm(xmbh, cmbJyyq.Text.Trim(), xmmc, xmsx, dy, xy, spy, xpy, bl, xh, dw, mrz); DialogResult result = frm.ShowDialog(); if (result == DialogResult.Yes) { LoadDgvJyjg(dgvJydj.SelectedRows[0].Cells["djlsh"].Value.ToString().Trim()); dgvJyjg.CurrentCell = dgvJyjg.Rows[index].Cells[0]; } }
private void btnAdd_Click(object sender, EventArgs e) { Form_addJyxm frm = new Form_addJyxm(cmbJyyq.Text, cmbJyyq.SelectedValue.ToString().Trim()); DialogResult result = frm.ShowDialog(); if (result == DialogResult.Yes) { LoadDgvJyjg(dgvJydj.SelectedRows[0].Cells["djlsh"].Value.ToString().Trim()); } }
private void dgvJyjg_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.Button == MouseButtons.Right && e.ColumnIndex == 4) { string xmbh = dgvJyjg.SelectedRows[0].Cells["xmbh"].Value.ToString().Trim(); if (!jyjkBiz.HasResult(xmbh)) { MessageBox.Show("不存在结果枚举", " 提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Form_addJyxm frm = new Form_addJyxm(xmbh); DialogResult result = frm.ShowDialog(); if (result == DialogResult.Yes) { dgvJyjg.SelectedRows[0].Cells["jg"].Value = frm.StrXmjg; } } }