private void button2_Click(object sender, System.EventArgs e) { if (this.lg == 0 || this.lg == 4) { return; } DataTable myTb = (DataTable)this.myDataGrid1.DataSource; if (myTb.Rows.Count == 0) { MessageBox.Show("请选择要取消的手术申请", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } string str = myTb.Rows[this.myDataGrid1.CurrentRowIndex]["sno"].ToString().Trim(); string _inpatient_no = myTb.Rows[this.myDataGrid1.CurrentRowIndex]["inpatient_no"].ToString().Trim(); if (this.button2.Text == "取消申请") { if (!(myTb.Rows[this.myDataGrid1.CurrentRowIndex]["sqdjczy"].ToString() == this.YS_ID.ToString() || this.lg == 3)) { MessageBox.Show("不是你申请的手术!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (MessageBox.Show("您确认要取消当前选定的手术申请吗?", "取消手术申请", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Operate ss = new Operate(); if (ss.CancelApp(str, _inpatient_no) == true) { MessageBox.Show("取消成功", "取消手术申请", MessageBoxButtons.OK, MessageBoxIcon.Information); } bview_Click(sender, e); } } else { //add by zouchihua 2013-8-27 特殊手术审核 if (myTb.Rows[this.myDataGrid1.CurrentRowIndex]["tsss_shsj"].ToString() != "") { MessageBox.Show("特殊手术已经被上级审核,需要取消特殊手术审核后才能取消!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (MessageBox.Show("您确认要取消审核当前选定的手术申请吗?", "取消审核手术申请", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (CancelSH(str) == true) { MessageBox.Show("取消审核成功!", "取消审核", MessageBoxButtons.OK, MessageBoxIcon.Information); } bview_Click(sender, e); } } }