Пример #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            if (_DownLoadAll)
            {
                CardBll bll = new CardBll(AppSettings.CurrentSetting.ParkConnect);
                //Cards = bll.GetAllCards().QueryObjects;

                //获取所有脱机时脱机处理的卡片,在线处理的卡片不下发,过滤掉在线处理的卡片
                CardSearchCondition search = new CardSearchCondition();
                //search.Status = CardStatus.Enabled | CardStatus.Disabled | CardStatus.Loss | CardStatus.Recycled;
                search.OnlineHandleWhenOfflineMode = false;
                Cards = bll.GetCards(search).QueryObjects;
            }
            //if (Cards != null && Cards.Count > 0 && DownLoadCard)
            //{
            //    //下发卡片时,在线处理的卡片不下发,过滤掉在线处理的卡片
            //    Cards = Cards.Where(c => !c.OnlineHandleWhenOfflineMode).ToList();

            //    //IEnumerable<CardInfo> cardsIEnum = Cards.Where(c => !c.OnlineHandleWhenOfflineMode);
            //    ////临时性的车牌名单不下发
            //    //cardsIEnum = cardsIEnum.Where(c => c.ListType == CardListType.Card || !c.CardType.IsTempCard);

            //    //Cards = cardsIEnum.ToList();
            //}
            if (Cards != null && Cards.Count > 0)
            {
                btnOk.Enabled       = false;
                btnCancel.Enabled   = true;
                this.btnCancel.Text = Resources.Resource1.Form_Stop;
                _Parks     = hardwareTree1.GetSelectedParks();
                _Entrances = hardwareTree1.GetSelectedEntrances();
                _Begin     = DateTime.Now;
                this.progressBar1.Maximum = Cards.Count * _Entrances.Count;
                this.progressBar1.Value   = 0;
                this.progressBar1.Visible = true;
                SyncCards_Thread          = new Thread(SyncAllCards);
                SyncCards_Thread.Start();
            }
            else
            {
                if (DownLoadCard)
                {
                    this.label2.Text = Resources.Resource1.FrmDownLoadAllCards_DownloadCardsNote;
                    this.label3.Text = Resources.Resource1.FrmDownLoadAllCards_NotDownloadCards;
                }
                else
                {
                    this.label3.Text = Resources.Resource1.FrmDownLoadAllCards_NotDeleteCards;
                }
            }
        }
Пример #2
0
 private void txtCarPlate_TextChanged(object sender, EventArgs e)
 {
     //车牌名单时才检查
     if (this.ucCard1.rdbCarPlateList.Checked)
     {
         string carPlate = this.ucCard1.txtCarPlate.Text.Trim(' ', '\n');
         if (!string.IsNullOrEmpty(carPlate))
         {
             CardBll             bll    = new CardBll(AppSettings.CurrentSetting.ParkConnect);
             CardSearchCondition search = new CardSearchCondition();
             search.ListType     = CardListType.CarPlate;
             search.ListCarPlate = carPlate;
             QueryResultList <CardInfo> result = bll.GetCards(search);
             if (result.Result == ResultCode.Successful &&
                 result.QueryObjects != null &&
                 result.QueryObjects.Count > 0)
             {
                 CardInfo info = result.QueryObjects[0];
                 if (!info.ReleasAble)
                 {
                     MessageBox.Show(string.Format(Resources.Resource1.UcCard_CannotRelease, carPlate));
                     this.ucCard1.txtCarPlate.Focus();
                     btnOk.Enabled = false;
                 }
                 else
                 {
                     ReleasingCard     = info;
                     this.ucCard1.Card = ReleasingCard;
                     this._isAdding    = false;
                     btnOk.Enabled     = true;
                 }
             }
             else
             {
                 this.ucCard1.txtCardID.Text = string.Empty;
                 this._isAdding = true;
                 btnOk.Enabled  = true;
             }
         }
     }
 }
Пример #3
0
        void ucPaging1_GetPageData(int index, int pagesize)
        {
            this.Cursor = Cursors.WaitCursor;
            if (_search == null)
            {
                _search = new CardSearchCondition();
            }
            _search.PageSize  = pagesize;
            _search.PageIndex = index;
            _cards            = bll.GetCards(_search).QueryObjects;

            ucPaging1.TotalCount = _search.TotalCountEx;
            ucPaging1.TotalPages = (int)Math.Ceiling(_search.TotalCountEx * 1.0M / ucPaging1.PageSize);

            cardView.CardSource = _cards;

            FreshStatusBar();

            this.Cursor = Cursors.Default;
            cardView.Focus();
        }