private void sbtnUnlose_Click(object sender, System.EventArgs e) { if (dataGrid1.CurrentRowIndex < 0) { MessageBox.Show("没有选中已挂失的会员!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); return; } System.Windows.Forms.DialogResult diaRes = MessageBox.Show("是否确定解挂该会员卡?", "请确认", System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Question); if (diaRes.Equals(System.Windows.Forms.DialogResult.Yes)) { string strCardID = dataGrid1[dataGrid1.CurrentRowIndex, 0].ToString(); err = null; cs.CardUnlose(strCardID, out err); if (err != null) { MessageBox.Show("会员卡解挂失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); clog.WriteLine(err); this.DgBind(); } else { MessageBox.Show("会员卡解挂成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information); this.DgBind(); } } }