private void tsbtnDel_Click(object sender, EventArgs e) { if (dataGridView1.CurrentCell != null) { if (MessageBox.Show("是否删除记录?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { try { ScoreBll.ScoreDel(dataGridView1.CurrentRow.Cells[2].Value.ToString()); MessageBox.Show("删除成功"); dataGridView1.DataSource = ScoreBll.ScoreFillDs("").Tables[0]; getcolumn(); } catch (Exception ee) { MessageBox.Show("删除失败!" + ee); throw; } } } }
private void tsbtnSerch_Click(object sender, EventArgs e) { dataGridView1.DataSource = ScoreBll.ScoreFillDs(tscboPaper.ComboBox.SelectedValue.ToString()).Tables[0]; getcolumn(); }
private void frmScoreManage_Load(object sender, EventArgs e) { dataGridView1.DataSource = ScoreBll.ScoreFillDs("").Tables[0]; getcolumn(); PaperBll.FillcboPaper(tscboPaper.ComboBox); }