Exemple #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            switch (_curStep)
            {
            case step_welcome:
                _curStep++;
                break;

            case step_input:
                if (CheckInput())
                {
                    _curStep++;
                }
                break;

            case step_readCard:
                _curStep++;
                break;

            case step_excute:
                List <CardInfo> cards = cardView.CardSource;
                if (cards != null && cards.Count > 0)
                {
                    CardBll bll = new CardBll(AppSettings.CurrentSetting.ParkConnect);
                    this.progressBar1.Maximum = cards.Count;
                    this.progressBar1.Value   = 0;
                    //bool download = true;
                    foreach (CardInfo card in cards)
                    {
                        CommandResult ret = null;
                        if (card.Status == CardStatus.Enabled)
                        {
                            ret = bll.CardRelease(card, 0, PaymentMode.Cash, string.Empty);
                        }
                        else
                        {
                            ret = bll.AddCard(card);
                        }
                        if (ret.Result == ResultCode.Successful)
                        {
                            this.CardAdded(this, new ItemAddedEventArgs(card));
                        }
                        progressBar1.Value++;
                        lblStatus.Text = string.Format(Resources.Resource1.FrmAddCards_Processing,
                                                       progressBar1.Value, progressBar1.Maximum);
                        lblStatus.Refresh();
                    }
                }
                lblAlarm.Text = string.Format(Resources.Resource1.FrmAddCards_CardCount, 0);
                _curStep++;
                break;

            case step_recycle:
                _curStep = step_welcome;
                InitCardGrid();
                this.progressBar1.Value = 0;
                break;
            }
            ShowNextStep(_curStep);
        }
Exemple #2
0
        protected override CommandResult AddItem(object addingItem)
        {
            CommandResult result = bll.AddCard((CardInfo)addingItem);

            if (result.Result == ResultCode.Successful)
            {
                WriteCard((CardInfo)addingItem);
            }
            return(result);
        }
Exemple #3
0
        protected override CommandResult AddItem(object addingItem)
        {
            CardInfo      card   = (CardInfo)addingItem;
            CardBll       bll    = new CardBll(AppSettings.CurrentSetting.ParkConnect);
            CommandResult result = bll.AddCard(card);

            if (result.Result == ResultCode.Successful)
            {
                WriteCard(card);
            }
            return(result);
        }
Exemple #4
0
        protected override CommandResult AddItem(object addingItem)
        {
            CommandResult result = bll.AddCard((CardInfo)addingItem);

            if (result.Result == ResultCode.Successful)
            {
                WriteCard((CardInfo)addingItem);

                if (DataBaseConnectionsManager.Current.StandbyConnected)
                {
                    //备用数据连上时,同步到备用数据库
                    bll.SyncCardToDatabaseWithoutPaymentInfo((CardInfo)addingItem, AppSettings.CurrentSetting.CurrentStandbyConnect);
                }
            }
            return(result);
        }