private void bt_delete_Click(object sender, EventArgs e) { if (str_tjbh == "") { return; } DialogResult result = MessageBox.Show("您将删除姓名为【" + txt_xm.Text.Trim() + "】的登记信息,是否继续?", "删除登记信息", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (result == DialogResult.No) { return; } //string str_delete = xtbiz.GetXtCsz("TjDelete");//0不做任何限制,可以删除;1录入了体检数据后不允许删除;2总检后不允许删除 //int str_sumover = tjdjbiz.Get_SumOver(str_tjbh, str_tjcs);//0新录入 1录入数据了 2总检了 //if (str_delete == "1" && str_sumover > 0) //{ // MessageBox.Show("已经录入了资料的人员不允许删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} //if (str_delete == "2" && str_sumover > 1) //{ // MessageBox.Show("已经总检的人员不允许删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); // return; //} tjdjbiz.Delete_TJ_TJDJB(str_tjbh, str_tjcs); MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); str_tjbh = ""; str_tjcs = ""; this.DialogResult = DialogResult.OK; }