Пример #1
0
        private void sbtnToGold_Click(object sender, System.EventArgs e)
        {
            string strCardID = txtCardID.Text.Trim();

            if (strCardID == "")
            {
                MessageBox.Show("会员卡号不可为空且小于10位,请重新填写会员卡号!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                txtCardID.Focus();
                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))
            {
                int ilastig = int.Parse(this.txtIg.Text.Trim());
                int icurig  = 0;
                if (this.txtAssTypeCode.Text.Trim() == "AT001")
                {
                    icurig = ilastig - 2000;
                }
                else
                {
                    icurig = ilastig - 1500;
                }
                err = null;
                string strresult = cs.AssUpToGoldType(this.txtAssTypeCode.Text.Trim(), this.txtAssID.Text.Trim(), strCardID, icurig, ilastig, out err);
                if (err != null || (!strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK)))
                {
                    if (err != null)
                    {
                        if (strresult.Equals(CardCommon.CardDef.ConstMsg.RFOK))
                        {
                            MessageBox.Show("升级至金卡失败,请重试!\n" + err.Message, "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            clog.WriteLine(err);
                        }
                        else
                        {
                            MessageBox.Show("升级至金卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            clog.WriteLine(err + " " + strresult);
                        }
                    }
                    else
                    {
                        if (strresult != "")
                        {
                            strresult = this.GetColCh(strresult, "ERR");
                            MessageBox.Show("升级至金卡失败,请重试!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                            clog.WriteLine("card:" + strCardID + " " + strresult);
                        }
                    }
                }
                else
                {
                    MessageBox.Show("升级至金卡成功!", "系统提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Information);
                }
                this.ClearText();
                this.sbtnToSilver.Enabled = false;
                this.sbtnToGold.Enabled   = false;
            }
        }