/// <summary> /// 卡片回收 /// </summary> /// <param name="info"></param> /// <param name="recycleMoney"></param> /// <param name="memo"></param> /// <param name="keepParkingStatus">是否保持卡片运行状态</param> /// <returns></returns> public CommandResult CardRecycle(CardInfo info, decimal recycleMoney, string memo, bool keepParkingStatus) { string op = OperatorInfo.CurrentOperator.OperatorName; string station = WorkStationInfo.CurrentStation.StationName; IUnitWork unitWork = ProviderFactory.Create <IUnitWork>(_RepoUri); CardRecycleRecord record = new CardRecycleRecord { CardID = info.CardID, OwnerName = info.OwnerName, CardCertificate = info.CardCertificate, CarPlate = info.CarPlate, RecycleDateTime = DateTime.Now, CardType = info.CardType, Balance = info.Balance, ValidDate = info.ValidDate, Deposit = info.Deposit, RecycleMoney = recycleMoney, OperatorID = op, StationID = station, Memo = memo }; ICardRecycleRecordProvider recordProvider = ProviderFactory.Create <ICardRecycleRecordProvider>(_RepoUri); recordProvider.Insert(record, unitWork); info.Recycle(); if (keepParkingStatus) { UpdateCard(info, unitWork); } else { UpdateCardAll(info, unitWork); } return(unitWork.Commit()); }
/// <summary> /// 通过查询条件获取相应的卡片回收记录 /// </summary> /// <param name="search"></param> /// <returns></returns> public QueryResultList <CardRecycleRecord> GetCardRecycleRecords(RecordSearchCondition search) { ICardRecycleRecordProvider p = ProviderFactory.Create <ICardRecycleRecordProvider>(_RepoUri); return(p.GetItems(search)); }
/// <summary> /// 操作员结算 /// </summary> /// <param name="opt"></param> /// <returns></returns> public CommandResult Settle(OperatorSettleLog opt) { IUnitWork unitWork = ProviderFactory.Create <IUnitWork>(_RepoUri); IOperatorLogProvider ip = ProviderFactory.Create <IOperatorLogProvider>(_RepoUri); ip.Insert(opt, unitWork); if (opt.PaymentRecords != null && opt.PaymentRecords.Count > 0) { ICardPaymentRecordProvider provider = ProviderFactory.Create <ICardPaymentRecordProvider>(_RepoUri); foreach (CardPaymentInfo record in opt.PaymentRecords) { CardPaymentInfo original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.ReleaseRecords != null && opt.ReleaseRecords.Count > 0) { ICardReleaseRecordProvider provider = ProviderFactory.Create <ICardReleaseRecordProvider>(_RepoUri); foreach (CardReleaseRecord record in opt.ReleaseRecords) { CardReleaseRecord original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.ChargeRecords != null && opt.ChargeRecords.Count > 0) { ICardChargeRecordProvider provider = ProviderFactory.Create <ICardChargeRecordProvider>(_RepoUri); foreach (CardChargeRecord record in opt.ChargeRecords) { CardChargeRecord original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.DeferRecords != null && opt.DeferRecords.Count > 0) { ICardDeferRecordProvider provider = ProviderFactory.Create <ICardDeferRecordProvider>(_RepoUri); foreach (CardDeferRecord record in opt.DeferRecords) { CardDeferRecord original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.CardLostRecords != null && opt.CardLostRecords.Count > 0) { ICardLostRestoreRecordProvider provider = ProviderFactory.Create <ICardLostRestoreRecordProvider>(_RepoUri); foreach (CardLostRestoreRecord record in opt.CardLostRecords) { CardLostRestoreRecord original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.RecycleRecords != null && opt.RecycleRecords.Count > 0) { ICardRecycleRecordProvider provider = ProviderFactory.Create <ICardRecycleRecordProvider>(_RepoUri); foreach (CardRecycleRecord record in opt.RecycleRecords) { CardRecycleRecord original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.EventRecords != null && opt.EventRecords.Count > 0) { ICardEventProvider provider = ProviderFactory.Create <ICardEventProvider>(_RepoUri); foreach (CardEventRecord record in opt.EventRecords) { CardEventRecord original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } if (opt.AlarmRecords != null && opt.AlarmRecords.Count > 0) { IAlarmProvider provider = ProviderFactory.Create <IAlarmProvider>(_RepoUri); foreach (AlarmInfo record in opt.AlarmRecords) { AlarmInfo original = record.Clone(); record.SettleDateTime = opt.SettleDateTime; provider.Update(record, original, unitWork); } } return(unitWork.Commit()); }
public void CreateProvider() { IAlarmProvider p1 = ProviderFactory.Create <IAlarmProvider>(connStr); Assert.IsTrue(p1 != null); ICardChargeRecordProvider p2 = ProviderFactory.Create <ICardChargeRecordProvider>(connStr); Assert.IsTrue(p2 != null); ICardDeferRecordProvider p3 = ProviderFactory.Create <ICardDeferRecordProvider>(connStr); Assert.IsTrue(p3 != null); ICardDisableEnableRecordProvider p4 = ProviderFactory.Create <ICardDisableEnableRecordProvider>(connStr); Assert.IsTrue(p4 != null); ICardEventProvider p5 = ProviderFactory.Create <ICardEventProvider>(connStr); Assert.IsTrue(p5 != null); ICardLostRestoreRecordProvider p6 = ProviderFactory.Create <ICardLostRestoreRecordProvider>(connStr); Assert.IsTrue(p6 != null); ICardProvider p9 = ProviderFactory.Create <ICardProvider>(connStr); Assert.IsTrue(p9 != null); ICardRecycleRecordProvider p10 = ProviderFactory.Create <ICardRecycleRecordProvider>(connStr); Assert.IsTrue(p10 != null); ICardReleaseRecordProvider p11 = ProviderFactory.Create <ICardReleaseRecordProvider>(connStr); Assert.IsTrue(p11 != null); IEntranceProvider p12 = ProviderFactory.Create <IEntranceProvider>(connStr); Assert.IsTrue(p12 != null); IOperatorLogProvider p13 = ProviderFactory.Create <IOperatorLogProvider>(connStr); Assert.IsTrue(p13 != null); IOperatorProvider p14 = ProviderFactory.Create <IOperatorProvider>(connStr); Assert.IsTrue(p14 != null); IParkProvider p16 = ProviderFactory.Create <IParkProvider>(connStr); Assert.IsTrue(p16 != null); IRoleProvider p17 = ProviderFactory.Create <IRoleProvider>(connStr); Assert.IsTrue(p17 != null); ISnapShotProvider p18 = ProviderFactory.Create <ISnapShotProvider>(connStr); Assert.IsTrue(p18 != null); ISysParameterProvider p19 = ProviderFactory.Create <ISysParameterProvider>(connStr); Assert.IsTrue(p19 != null); IVideoSourceProvider p21 = ProviderFactory.Create <IVideoSourceProvider>(connStr); Assert.IsTrue(p21 != null); IWaitingCommandProvider p24 = ProviderFactory.Create <IWaitingCommandProvider>(connStr); Assert.IsTrue(p24 != null); IWorkstationProvider p25 = ProviderFactory.Create <IWorkstationProvider>(connStr); Assert.IsTrue(p25 != null); }