private void btn_edit_Click(object sender, EventArgs e) { try { int rid = Int16.Parse(dgv_recruit.SelectedRows[0].Cells["id"].Value.ToString()); FormRecruit fr = new FormRecruit(rid); fr.Owner = this; fr.ShowDialog(); } catch (Exception ex) { MessageBox.Show("编辑出现错误,请先选择要编辑的行。" + ex.Message); return; } }
private void dgv_recruit_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int rid = Int16.Parse(dgv_recruit.SelectedRows[0].Cells["id"].Value.ToString()); FormRecruit fr = new FormRecruit(rid); fr.Owner = this; fr.ShowDialog(); }
private void btn_add_Click(object sender, EventArgs e) { FormRecruit fr = new FormRecruit(); fr.Owner = this; fr.ShowDialog(); }