private void btnAdd_Click(object sender, EventArgs e) { isAdd = true; A_AddHistoryAttendance_Add Afr = new A_AddHistoryAttendance_Add(this); Afr.ShowDialog(); }
private void btnLaws_Click(object sender, EventArgs e) { isAdd = false; int a = 0; int b = 0; if (dgrd.Rows.Count > 0) { for (int j = 0; j < dgrd.Rows.Count; j++) { if (((DataGridViewCheckBoxCell)dgrd.Rows[j].Cells[0]).Value == ((DataGridViewCheckBoxCell)dgrd.Rows[j].Cells[0]).TrueValue) { a = a + 1; b = j; } } if (a != 0) { if (a > 1) { MessageBox.Show("修改只能选择一项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { if (dgrd.Rows[b].Cells[1].Value != null) { id = dgrd.Rows[b].Cells[1].Value.ToString(); } else { id = ""; } A_AddHistoryAttendance_Add Afr = new A_AddHistoryAttendance_Add(this); Afr.ShowDialog(); //DialogResult dr = Afr.ShowDialog(); //if (dr == DialogResult.OK) //{ // BindDataDataGridView(); //} } } else { MessageBox.Show("没有选择修改项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }
private void btnLaws_Click(object sender, EventArgs e) { isAdd = false; int a = 0; int b = 0; if (dgrd.Rows.Count>0) { for (int j = 0; j < dgrd.Rows.Count; j++) { if (((DataGridViewCheckBoxCell)dgrd.Rows[j].Cells[0]).Value == ((DataGridViewCheckBoxCell)dgrd.Rows[j].Cells[0]).TrueValue) { a = a + 1; b = j; } } if (a != 0) { if (a > 1) { MessageBox.Show("修改只能选择一项!","提示",MessageBoxButtons.OK,MessageBoxIcon.Asterisk); } else { if (dgrd.Rows[b].Cells[1].Value != null) { id = dgrd.Rows[b].Cells[1].Value.ToString(); } else { id = ""; } A_AddHistoryAttendance_Add Afr = new A_AddHistoryAttendance_Add(this); Afr.ShowDialog(); //DialogResult dr = Afr.ShowDialog(); //if (dr == DialogResult.OK) //{ // BindDataDataGridView(); //} } } else { MessageBox.Show("没有选择修改项!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }