Ejemplo n.º 1
0
        private void sbtnCardExit_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.CardLoseToExit(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();
                }
            }
        }