private void CarType_Selected(object sender, EventArgs e) { if (_ChargeRecord != null && CarTypeSetting.Current[carTypePanel1.SelectedCarType] != null) { //专门针对长隆停车场设置一种“转会员卡"车型,选择“转会员卡"车型时必须重新刷一张会员卡才能时行这个操作,并在收费说明中写入“转会员卡+会员卡号" //这个功能采用硬编码 if (CarTypeSetting.Current[carTypePanel1.SelectedCarType].Description == _ToVipCard) { FrmVipCardReader frm = new FrmVipCardReader(); if (frm.ShowDialog() == DialogResult.OK) { string cardid = frm.VipCardID; if (DataBaseConnectionsManager.Current.MasterConnected || DataBaseConnectionsManager.Current.StandbyConnected) { CardInfo card = null; if (DataBaseConnectionsManager.Current.MasterConnected) { card = (new CardBll(AppSettings.CurrentSetting.CurrentMasterConnect)).GetCardByID(cardid).QueryObject; } else { card = (new CardBll(AppSettings.CurrentSetting.CurrentStandbyConnect)).GetCardByID(cardid).QueryObject; } if (card != null && card.CardType.Name == _VipCard) { _TempCardID = _ChargeRecord.CardID; _VipCardID = cardid; } else { MessageBox.Show(string.Format("卡号为 {0} 的卡不存在或者不是会员卡,请刷会员卡", cardid), Resource1.Form_Alert); return; } } else { MessageBox.Show("数据库连接失败!"); return; } } else { return; } } //end 转会员卡功能 _ChargeRecord = CardPaymentInfoFactory.CreateCardPaymentRecord(_cardInfo, TariffSetting.Current, carTypePanel1.SelectedCarType, _ChargeRecord.ChargeDateTime); ShowCardPaymentInfo(_ChargeRecord); } }
private void ChargeType_Selected(object sender, EventArgs e) { if (_processingEvent != null && CarTypeSetting.Current[carTypePanel1.SelectedCarType] != null) { int entranceID = _processingEvent.EntranceID; int parkID = _processingEvent.ParkID; //专门针对长隆停车场设置一种“转会员卡"车型,选择“转会员卡"车型时必须重新刷一张会员卡才能时行这个操作,并在收费说明中写入“转会员卡+会员卡号" //这个功能采用硬编码 if (CarTypeSetting.Current[carTypePanel1.SelectedCarType].Description == _ToVipCard) { FrmVipCardReader frm = new FrmVipCardReader(); if (frm.ShowDialog() == DialogResult.OK) { string cardid = frm.VipCardID; CardInfo card = (new CardBll(AppSettings.CurrentSetting.ParkConnect)).GetCardByID(cardid).QueryObject; if (card != null && card.CardType.Name == _VipCard) { _TempCardID = _processingEvent.CardID; _VipCardID = cardid; } else { MessageBox.Show("卡号为 {0} 的卡不存在或者不是会员卡,请刷会员卡", Resource1.Form_Alert); return; } } else { return; } } //end 转会员卡功能 //选择车型后,表明当前的收费明细就是没有用的了,要不然用户不会重新选择车型,这也避免了用户在选择车型后立即按了收费按钮,此时由于选择车型的操作 //是异步的,所以会先处理收费事件,保存收费信息,但新车型的事件上来后用户又会选择一次收费,所以导致偶尔会有同一事件有两条收费记录的情况。 _processingEvent = null; CarTypeSwitchNotify notify = new CarTypeSwitchNotify(entranceID, carTypePanel1.SelectedCarType); if (ParkingAdapterManager.Instance[parkID] != null) { ParkingAdapterManager.Instance[parkID].SwitchCarType(notify); } } }