コード例 #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (RecycleCard != null)
            {
                if (CheckInput())
                {
                    decimal money;
                    money = this.txtTurnbackMoney.DecimalValue;
                    CardBll       bll    = new CardBll(AppSettings.CurrentSetting.ParkConnect);
                    CommandResult result = bll.CardRecycle(this.RecycleCard, money, this.txtMemo.Text, !AppSettings.CurrentSetting.EnableWriteCard);
                    if (result.Result == ResultCode.Successful)
                    {
                        //写卡模式时,将卡片信息写入卡片,这里会使用循环写卡,直到成功或用户取消
                        if (this.chkWriteCard.Checked)
                        {
                            CardOperationManager.Instance.WriteCardLoop(RecycleCard);
                        }

                        if (this.ItemUpdated != null)
                        {
                            ItemUpdated(this, new ItemUpdatedEventArgs(RecycleCard));
                        }
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(result.Message);
                    }
                }
            }
        }