/// <summary>
        /// 生成操作员结算汇总,如果不指定工作站,则表示汇总结果中包括操作员在所有工作站上的收费情况
        /// </summary>
        /// <param name="opt"></param>
        /// <param name="station"></param>
        /// <returns></returns>
        public OperatorSettleLog CreateOperatorLog(OperatorInfo opt, WorkStationInfo station)
        {
            if (opt != null)
            {
                OperatorSettleLog log = new OperatorSettleLog();
                log.OperatorID     = opt.OperatorName;
                log.SettleDateTime = DateTime.Now;
                if (station != null)
                {
                    log.StationID = station.StationName;
                }
                //查询条件
                RecordSearchCondition recordCon = new RecordSearchCondition();
                recordCon.RecordDateTimeRange = new DateTimeRange(log.SettleFrom == null ? new DateTime(1753, 1, 1, 12, 0, 0) : log.SettleFrom.Value, log.SettleDateTime);
                recordCon.Operator            = opt;
                recordCon.IsUnSettled         = true;
                if (station != null)
                {
                    recordCon.StationID = station.StationName;
                }
                //查询收费记录
                CardPaymentRecordBll   paymentBll     = new CardPaymentRecordBll(_RepoUri);
                List <CardPaymentInfo> paymentRecords = paymentBll.GetItems(recordCon).QueryObjects;
                log.PaymentRecords      = paymentRecords;
                log.CashParkFact        = CashParkFactSum(paymentRecords);
                log.CashOperatorCard    = CashOperatorCardSum(paymentRecords);
                log.CashParkDiscount    = CashParkDiscountSum(paymentRecords);
                log.NonCashParkFact     = NoCashParkFactSum(paymentRecords);
                log.NonCashParkDiscount = NoCashParkDiscountSum(paymentRecords);
                //查询卡片发行记录
                CardBll cbll = new CardBll(_RepoUri);
                List <CardReleaseRecord> cardReleaseRecords = cbll.GetCardReleaseRecords(recordCon).QueryObjects;
                log.ReleaseRecords    = cardReleaseRecords;
                log.CashOfCard       += CashCardReleaseSum(cardReleaseRecords);
                log.CashOfDeposit    += CashDepositSum(cardReleaseRecords);
                log.NonCashOfDeposit += NonCashDepositSum(cardReleaseRecords);
                log.NonCashOfCard    += NonCashCardReleaseSum(cardReleaseRecords);
                //查询卡片延期记录
                List <CardDeferRecord> cardDeferRecords = cbll.GetCardDeferRecords(recordCon).QueryObjects;
                log.DeferRecords   = cardDeferRecords;
                log.CashOfCard    += CashCardDeferSum(cardDeferRecords);
                log.NonCashOfCard += NonCashCardDeferSum(cardDeferRecords);
                //查询卡片充值记录
                List <CardChargeRecord> cardChargeRecords = cbll.GetCardChargeRecords(recordCon).QueryObjects;
                log.ChargeRecords  = cardChargeRecords;
                log.CashOfCard    += CashCardChargeSum(cardChargeRecords);
                log.NonCashOfCard += NonCashCardChargeSum(cardChargeRecords);
                //卡片挂失记录
                List <CardLostRestoreRecord> cardLostRecords = cbll.GetCardLostRestoreRecords(recordCon).QueryObjects;
                log.CardLostRecords   = cardLostRecords;
                log.CashOfCardLost    = CashCardLostSum(cardLostRecords);
                log.NonCashOfCardLost = NonCashCardLostSum(cardLostRecords);
                //查询卡片回收记录
                List <CardRecycleRecord> cardRecycleRecords = cbll.GetCardRecycleRecords(recordCon).QueryObjects;
                log.RecycleRecords     = cardRecycleRecords;
                log.CashOfCardRecycle += CashCardRecycleSum(cardRecycleRecords);
                //查询报警记录
                AlarmSearchCondition alarmCon = new AlarmSearchCondition();
                alarmCon.RecordDateTimeRange = new DateTimeRange(log.SettleFrom == null ? new DateTime(1753, 1, 1, 12, 0, 0) : log.SettleFrom.Value, log.SettleDateTime);
                alarmCon.Operator            = opt;
                alarmCon.IsUnSettled         = true;
                alarmCon.AlarmType           = AlarmType.Opendoor;
                if (station != null)
                {
                    alarmCon.StationID = station.StationName;
                }

                List <AlarmInfo> alarmReocrds = (new AlarmBll(_RepoUri)).GetAlarms(alarmCon).QueryObjects;
                log.OpenDoorCount = alarmReocrds.Count;
                log.AlarmRecords  = alarmReocrds;
                //查询事件
                CardEventSearchCondition eventCon = new CardEventSearchCondition();
                eventCon.RecordDateTimeRange = new DateTimeRange(log.SettleFrom == null ? new DateTime(1753, 1, 1, 12, 0, 0) : log.SettleFrom.Value, log.SettleDateTime);
                eventCon.Operator            = opt;
                eventCon.IsUnSettled         = true;
                eventCon.OnlyExitEvent       = true;
                eventCon.CardType            = CardType.TempCard; //只获取临时卡事件
                if (station != null)
                {
                    eventCon.StationID = station.StationName;
                }

                List <CardEventRecord> handledEvents = (new CardEventBll(_RepoUri)).GetCardEvents(eventCon).QueryObjects;
                log.EventRecords    = handledEvents;
                log.TempCardRecycle = TempCardRecycleSum(handledEvents);
                return(log);
            }
            else
            {
                throw new InvalidOperationException(Resource1.OperatorSettleBLL_noOperator);
            }
        }
        protected override List <CardPaymentInfo> GetingItems(ParkDataContext parking, Ralid.Park.BusinessModel.SearchCondition.SearchCondition search)
        {
            List <CardPaymentInfo>       items  = null;
            IQueryable <CardPaymentInfo> result = parking.GetTable <CardPaymentInfo>();

            if (search is RecordSearchCondition)
            {
                RecordSearchCondition condition = search as RecordSearchCondition;
                if (condition.RecordDateTimeRange != null)
                {
                    result = result.Where(c => c.ChargeDateTime >= condition.RecordDateTimeRange.Begin);
                    result = result.Where(c => c.ChargeDateTime <= condition.RecordDateTimeRange.End);
                }
                if (!string.IsNullOrEmpty(condition.CardID))
                {
                    result = result.Where(c => c.CardID == condition.CardID);
                }
                if (condition.PaymentMode != null)
                {
                    result = result.Where(c => c.PaymentMode == condition.PaymentMode.Value);
                }
                if (condition.Operator != null)
                {
                    result = result.Where(c => c.OperatorID == condition.Operator.OperatorName);
                }
                if (!string.IsNullOrEmpty(condition.StationID))
                {
                    result = result.Where(c => c.StationID == condition.StationID);
                }
                if (condition.IsUnSettled != null)
                {
                    if (condition.IsUnSettled.Value)
                    {
                        result = result.Where(c => c.SettleDateTime == null);
                    }
                    else
                    {
                        result = result.Where(c => c.SettleDateTime != null);
                    }
                }
                if (condition.SettleDateTime != null)
                {
                    result = result.Where(c => c.SettleDateTime == condition.SettleDateTime.Value);
                }
                if (!string.IsNullOrEmpty(condition.CarPlate))
                {
                    result = result.Where(c => c.CarPlate.Contains(condition.CarPlate));
                }
                if (condition.CarType != null)
                {
                    result = result.Where(c => c.CarType == condition.CarType.Value);
                }
                if (!string.IsNullOrEmpty(condition.OwnerName))
                {
                    result = result.Where(c => c.OwnerName.Contains(condition.OwnerName));
                }
                if (!string.IsNullOrEmpty(condition.CardCertificate))
                {
                    result = result.Where(c => c.CardCertificate.Contains(condition.CardCertificate));
                }
                if (condition.UpdateFlag != null)
                {
                    result = result.Where(c => c.UpdateFlag == condition.UpdateFlag);
                }
                if (search is CardPaymentRecordSearchCondition)
                {
                    CardPaymentRecordSearchCondition condition1 = search as CardPaymentRecordSearchCondition;
                    if (condition1.EnterDateTime != null)
                    {
                        result = result.Where(c => c.EnterDateTime == condition1.EnterDateTime.Value);
                    }
                    if (condition1.IsCenterCharge != null && condition1.IsCenterCharge.Value)
                    {
                        result = result.Where(c => c.IsCenterCharge == true);
                    }
                    if (condition1.IsCenterCharge != null && !condition1.IsCenterCharge.Value)
                    {
                        result = result.Where(c => c.IsCenterCharge == false);
                    }
                    if (condition1.ChargeDateTime != null)
                    {
                        result = result.Where(c => c.ChargeDateTime == condition1.ChargeDateTime.Value);
                    }
                    if (condition1.PaymentCode != null)
                    {
                        result = result.Where(c => c.PaymentCode == condition1.PaymentCode.Value);
                    }
                    if (!string.IsNullOrEmpty(condition1.OperatorCardID))
                    {
                        result = result.Where(c => c.OperatorCardID == condition1.OperatorCardID);
                    }
                }
                items = result.ToList();
                if (condition.CardType != null)
                {
                    items = items.Where(c => c.CardType == condition.CardType).ToList();
                }
            }
            else
            {
                items = new List <CardPaymentInfo>();
            }
            return(items);
        }
Beispiel #3
0
 /// <summary>
 /// 通过查询条件获取卡片事件
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public QueryResultList <CardEventRecord> GetCardEvents(RecordSearchCondition search)
 {
     return(provider.GetItems(search));
 }
 public QueryResultList <OperatorSettleLog> GetOperatorLogs(RecordSearchCondition search)
 {
     return(provider.GetItems(search));
 }
        protected override List <CardEventRecord> GetingItems(ParkDataContext parking, SearchCondition search)
        {
            List <CardEventRecord>       items  = new List <CardEventRecord>();
            IQueryable <CardEventRecord> result = parking.CardEvent;

            if (search is RecordSearchCondition)
            {
                RecordSearchCondition condition = search as RecordSearchCondition;
                if (condition.RecordDateTimeRange != null)
                {
                    result = result.Where(c => c.EventDateTime >= condition.RecordDateTimeRange.Begin).AsQueryable();
                    result = result.Where(c => c.EventDateTime <= condition.RecordDateTimeRange.End).AsQueryable();
                }
                if (!string.IsNullOrEmpty(condition.CardID))
                {
                    result = result.Where(c => c.CardID == condition.CardID);
                }
                if (condition.Operator != null)
                {
                    result = result.Where(c => c.OperatorID == condition.Operator.OperatorName);
                }
                if (!string.IsNullOrEmpty(condition.StationID))
                {
                    result = result.Where(c => c.StationID == condition.StationID);
                }
                if (!string.IsNullOrEmpty(condition.OwnerName))
                {
                    result = result.Where(c => c.OwnerName.Contains(condition.OwnerName));
                }
                if (!string.IsNullOrEmpty(condition.Department))
                {
                    result = result.Where(c => c.Department == condition.Department);
                }
                if (condition.IsUnSettled != null)
                {
                    if (condition.IsUnSettled.Value)
                    {
                        result = result.Where(c => c.SettleDateTime == null);
                    }
                    else
                    {
                        result = result.Where(c => c.SettleDateTime != null);
                    }
                }
                if (condition.SettleDateTime != null)
                {
                    result = result.Where(c => c.SettleDateTime == condition.SettleDateTime.Value);
                }
                if (condition.CarType != null)
                {
                    result = result.Where(c => c.CarType == condition.CarType);
                }
                if (!string.IsNullOrEmpty(condition.CardCertificate))
                {
                    result = result.Where(c => c.CardCertificate.Contains(condition.CardCertificate));
                }
                if (condition.UpdateFlag != null)
                {
                    result = result.Where(c => c.UpdateFlag == condition.UpdateFlag);
                }
                if (search is CardEventSearchCondition)
                {
                    CardEventSearchCondition s = search as CardEventSearchCondition;
                    if (s.CarType != null)
                    {
                        result = result.Where(item => item.CarType == s.CarType);
                    }
                    if (!string.IsNullOrEmpty(s.CarPlate))
                    {
                        result = result.Where(c => c.CarPlate.Contains(s.CarPlate));
                    }
                    if (s.OnlyExitEvent)
                    {
                        result = result.Where(item => item.IsExitEvent == true);
                    }
                    if (s.OnlyEnterEvent)
                    {
                        result = result.Where(item => item.IsExitEvent == false);
                    }
                }
                items = result.ToList();
                if (condition.CardType != null)
                {
                    items = items.Where(c => c.CardType == condition.CardType).ToList();
                }
                if (search is CardEventSearchCondition)
                {
                    CardEventSearchCondition s = search as CardEventSearchCondition;
                    if (s.Source != null && s.Source.Count > 0)
                    {
                        items = (from c in items join e in s.Source on c.EntranceID equals e.EntranceID select c).ToList();
                    }
                }
            }
            return(items);
        }
 public QueryResultList <LDB_CardPaymentInfo> GetItems(RecordSearchCondition search)
 {
     return(_Provider.GetItems(search));
 }
Beispiel #7
0
 public QueryResultList <AlarmInfo> GetAlarms(RecordSearchCondition search)
 {
     return(provider.GetItems(search));
 }
Beispiel #8
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            string cardID = this.txtCardID.Text.Trim();

            if (this.tabControl1.SelectedTab == tabPage1)
            {//卡片管理接口
                if (CheckInput())
                {
                    CardInfo info = client.GetCardByID(cardID).QueryObject;
                    if (info != null)
                    {
                        this.ucCard1.Card = info;
                    }
                    else
                    {
                        MessageBox.Show("找不到卡片!");
                        this.ucCard1.Card = null;
                    }
                }
            }
            else if (this.tabControl1.SelectedTab == tabPage2)
            {//空车位
                if (string.IsNullOrEmpty(this.txtParkID.Text))
                {
                    MessageBox.Show("必须输入parkID");
                    return;
                }
                string strParkID = this.txtParkID.Text.Trim();
                int    parkID    = 0;
                try
                {
                    parkID = Convert.ToInt32(strParkID);
                }
                catch {}
                this.txtVacant.Text = client.GetVacant(parkID).ToString();
            }
            else if (this.tabControl1.SelectedTab == tabPage3)
            {//卡片状态及停车费用
                if (CheckInput())
                {
                    CardInfo info = client.GetCardByID(cardID).QueryObject;
                    if (info != null)
                    {
                        string     descr = string.Empty;
                        CardStatus cs    = client.GetCardStatusByCardID(cardID);
                        if (cs == CardStatus.Deleted)
                        {
                            descr = "已删除";
                        }
                        else if (cs == CardStatus.Disabled)
                        {
                            descr = "禁用";
                        }
                        else if (cs == CardStatus.Enabled)
                        {
                            descr = "已发行";
                        }
                        else if (cs == CardStatus.Loss)
                        {
                            descr = "挂失";
                        }
                        else if (cs == CardStatus.Recycled)
                        {
                            descr = "待发行";
                        }
                        else if (cs == CardStatus.UnRegister)
                        {
                            descr = "此卡未登记";
                        }
                        this.txtCardStatus.Text = descr;
                        this.txtParkFee.Text    = client.GetCardLastPayment(info, null).ToString();
                    }
                }
            }
            else if (this.tabControl1.SelectedTab == tabPage4)
            {//记录查询
                RecordSearchCondition con = new RecordSearchCondition();
                con.CardID = cardID;
                if (this.tabControlRecord.SelectedTab == tabRecord1)
                {//卡片充值记录
                    List <CardChargeRecord> list = client.GetCardChargeRecords(con).QueryObjects;
                    this.cDGV_Record1.DataSource = list;
                }
                else if (this.tabControlRecord.SelectedTab == tabRecord2)
                {//卡片延期记录
                    List <CardDeferRecord> list = client.GetCardDeferRecords(con).QueryObjects;
                    this.cDGV_Record2.DataSource = list;
                }
                else if (this.tabControlRecord.SelectedTab == tabRecord3)
                {//卡片挂失恢复记录
                    List <CardLostRestoreRecord> list = client.GetCardLostRestoreRecords(con).QueryObjects;
                    this.cDGV_Record3.DataSource = list;
                }
                else if (this.tabControlRecord.SelectedTab == tabRecord4)
                {//卡片禁用启用记录
                    List <CardDisableEnableRecord> list = client.GetCardDisableEnableRecords(con).QueryObjects;
                    this.cDGV_Record4.DataSource = list;
                }
                else if (this.tabControlRecord.SelectedTab == tabRecord5)
                {//卡片回收记录
                    List <CardRecycleRecord> list = client.GetCardRecycleRecords(con).QueryObjects;
                    this.cDGV_Record5.DataSource = list;
                }
                else if (this.tabControlRecord.SelectedTab == tabRecord6)
                {//卡片发行记录
                    if (CheckInput())
                    {
                        List <CardReleaseRecord> list = client.GetCardReleaseRecords(con).QueryObjects;
                        this.cDGV_Record6.DataSource = list;
                    }
                }
                else if (this.tabControlRecord.SelectedTab == tabRecord7)
                {//卡片删除记录
                    if (CheckInput())
                    {
                        List <CardDeleteRecord> list = client.GetCardDeleteRecords(con).QueryObjects;
                        this.cDGV_Record7.DataSource = list;
                    }
                }
            }
            else if (this.tabControl1.SelectedTab == tabPage5)
            {//设备清单
                List <EntranceInfo> list = client.GetAllEntraces().QueryObjects;
                this.cDGV_Entrance.DataSource = list;
            }
            else if (this.tabControl1.SelectedTab == tabPage6)
            {//停车收费接口
                ClearCardFeePayInterface();
                QueryResult <ServiceReference1.WSCardPaymentInfo> result = client.GetCardPayment(this.txtCardID.Text, this.txtDiscountHourInput.Text, this.txtDiscountInput.Text, string.Empty, string.Empty);
                if (result.Result != ResultCode.Successful)
                {
                    MessageBox.Show(result.Message);
                }
                else
                {
                    this.lblCardID.Text           = result.QueryObject.CardID;
                    this.lblChargeTime.Text       = result.QueryObject.ChargeDateTime;
                    this.lblEnterTime.Text        = result.QueryObject.EnterDateTime;
                    this.lblEntranceName.Text     = result.QueryObject.EntranceName;
                    this.lblTimeInterval.Text     = result.QueryObject.TimeInterval;
                    this.lblCarPlate.Text         = result.QueryObject.CarPlate;
                    this.lblAccounts.Text         = result.QueryObject.Accounts;
                    this.lblLastTotalFee.Text     = result.QueryObject.LastTotalFee;
                    this.lblDiscount.Text         = result.QueryObject.Discount;
                    this.lblCurrDiscountHour.Text = result.QueryObject.CurrDiscountHour;
                    this.lblPaid.Text             = result.QueryObject.Paid;
                    this.lblMemo.Text             = result.QueryObject.Memo;

                    this.txtPaid.Text = result.QueryObject.Paid;
                }
            }
        }
Beispiel #9
0
 /// <summary>
 /// 通过查询条件获取相应的卡片删除记录
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public QueryResultList <CardDeleteRecord> GetCardDeleteRecords(RecordSearchCondition search)
 {
     return(new CardBll(AppConifg.Current.ParkingConnection).GetCardDeleteRecords(search));
 }
 public QueryResultList <APMRefundRecord> GetAPMRefundRecords(RecordSearchCondition search)
 {
     return(provider.GetItems(search));
 }
Beispiel #11
0
        /// <summary>
        /// 通过查询条件获取相应的卡片充值记录
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        public QueryResultList <CardChargeRecord> GetCardChargeRecords(RecordSearchCondition search)
        {
            QueryResultList <CardChargeRecord> ret = new CardBll(AppConifg.Current.ParkingConnection).GetCardChargeRecords(search);

            return(ret);
        }
        protected override List <CardPaymentInfo> GetingItems(ParkDataContext parking, Ralid.Park.BusinessModel.SearchCondition.SearchCondition search)
        {
            List <CardPaymentInfo>       items  = null;
            IQueryable <CardPaymentInfo> result = parking.GetTable <CardPaymentInfo>();

            if (search is CardPaymentRecordSearchCondition)
            {
                CardPaymentRecordSearchCondition condition = search as CardPaymentRecordSearchCondition;

                if (condition.RecordDateTimeRange != null)
                {
                    result = result.Where(c => c.ChargeDateTime >= condition.RecordDateTimeRange.Begin);
                    result = result.Where(c => c.ChargeDateTime <= condition.RecordDateTimeRange.End);
                }
                if (!string.IsNullOrEmpty(condition.CardID))
                {
                    result = result.Where(c => c.CardID == condition.CardID);
                }
                if (condition.EnterDateTime != null)
                {
                    result = result.Where(c => c.EnterDateTime == condition.EnterDateTime.Value);
                }
                if (condition.PaymentMode != null)
                {
                    result = result.Where(c => c.PaymentMode == condition.PaymentMode.Value);
                }
                if (condition.Operator != null)
                {
                    result = result.Where(c => c.OperatorID == condition.Operator.OperatorID);
                }
                if (!string.IsNullOrEmpty(condition.StationID))
                {
                    result = result.Where(c => c.StationID == condition.StationID);
                }
                if (!string.IsNullOrEmpty(condition.CarPalte))
                {
                    result = result.Where(c => c.CarPlate.Contains(condition.CarPalte));
                }
                if (condition.PaymentMode != null)
                {
                    result = result.Where(c => c.PaymentMode == condition.PaymentMode);
                }
                items = result.ToList();
                if (condition.CardType != null)
                {
                    items = items.Where(c => c.CardType == condition.CardType).ToList();
                }
            }
            else if (search is RecordSearchCondition)
            {
                RecordSearchCondition condition = search as RecordSearchCondition;
                if (condition.RecordDateTimeRange != null)
                {
                    result = result.Where(c => c.ChargeDateTime >= condition.RecordDateTimeRange.Begin);
                    result = result.Where(c => c.ChargeDateTime <= condition.RecordDateTimeRange.End);
                }
                if (!string.IsNullOrEmpty(condition.CardID))
                {
                    result = result.Where(c => c.CardID == condition.CardID);
                }
                if (condition.PaymentMode != null)
                {
                    result = result.Where(c => c.PaymentMode == condition.PaymentMode.Value);
                }
                if (condition.Operator != null)
                {
                    result = result.Where(c => c.OperatorID == condition.Operator.OperatorID);
                }
                if (!string.IsNullOrEmpty(condition.StationID))
                {
                    result = result.Where(c => c.StationID == condition.StationID);
                }
                items = result.ToList();
                if (condition.CardType != null)
                {
                    items = items.Where(c => c.CardType == condition.CardType).ToList();
                }
            }
            else
            {
                items = new List <CardPaymentInfo>();
            }
            return(items);
        }
Beispiel #13
0
 /// <summary>
 /// 根据查询条件获取未处理超速记录
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public QueryResultList <SpeedingRecord> GetRecords(RecordSearchCondition search)
 {
     return(provider.GetItems(search));
 }
        private List <MonthCardPaymentInfo> GetMonthCardPaymentInfoes(RecordSearchCondition recordCon)
        {
            CardBll cbll = new CardBll(AppSettings.CurrentSetting.ParkConnect);
            List <MonthCardPaymentInfo> items    = new List <MonthCardPaymentInfo>();
            List <CardReleaseRecord>    releases = cbll.GetCardReleaseRecords(recordCon).QueryObjects;

            foreach (CardReleaseRecord record in releases)
            {
                MonthCardPaymentInfo mci = new MonthCardPaymentInfo
                {
                    CardID          = record.CardID,
                    OwnerName       = record.OwnerName,
                    CarPlate        = record.CarPlate,
                    PaymentDateTime = record.ReleaseDateTime,
                    OldExpireDate   = record.ReleaseDateTime.ToString("yyyy-MM-dd"),
                    NewExpireDate   = record.ValidDate.ToString("yyyy-MM-dd"),
                    PaymentType     = "发行",
                    Cash            = record.PaymentMode == PaymentMode.Cash ? record.ReleaseMoney - record.Deposit : 0,
                    NonCash         = record.PaymentMode == PaymentMode.Cash ? 0 : record.ReleaseMoney - record.Deposit,
                };
                items.Add(mci);
                mci = new MonthCardPaymentInfo
                {
                    CardID          = record.CardID,
                    OwnerName       = record.OwnerName,
                    CarPlate        = record.CarPlate,
                    PaymentDateTime = record.ReleaseDateTime,
                    OldExpireDate   = string.Empty,
                    NewExpireDate   = string.Empty,
                    PaymentType     = "押金",
                    Cash            = record.PaymentMode == PaymentMode.Cash ? record.Deposit : 0,
                    NonCash         = record.PaymentMode == PaymentMode.Cash ? 0 : record.Deposit,
                };
                items.Add(mci);
            }

            List <CardDeferRecord> defers = cbll.GetCardDeferRecords(recordCon).QueryObjects;

            foreach (CardDeferRecord record in defers)
            {
                MonthCardPaymentInfo mci = new MonthCardPaymentInfo
                {
                    CardID          = record.CardID,
                    OwnerName       = record.OwnerName,
                    CarPlate        = record.CarPlate,
                    PaymentDateTime = record.DeferDateTime,
                    OldExpireDate   = record.OriginalDate.ToString("yyyy-MM-dd"),
                    NewExpireDate   = record.CurrentDate.ToString("yyyy-MM-dd"),
                    PaymentType     = "延期",
                    Cash            = record.PaymentMode == PaymentMode.Cash ? record.DeferMoney : 0,
                    NonCash         = record.PaymentMode == PaymentMode.Cash ? 0 : record.DeferMoney,
                };
                items.Add(mci);
            }

            List <CardChargeRecord> charges = cbll.GetCardChargeRecords(recordCon).QueryObjects;

            foreach (CardChargeRecord record in charges)
            {
                MonthCardPaymentInfo mci = new MonthCardPaymentInfo
                {
                    CardID          = record.CardID,
                    OwnerName       = record.OwnerName,
                    CarPlate        = record.CarPlate,
                    PaymentDateTime = record.ChargeDateTime,
                    OldExpireDate   = string.Empty,
                    NewExpireDate   = string.Empty,
                    PaymentType     = "充值",
                    Cash            = record.PaymentMode == PaymentMode.Cash ? record.Payment : 0,
                    NonCash         = record.PaymentMode == PaymentMode.Cash ? 0 : record.Payment,
                };
                items.Add(mci);
            }

            List <CardRecycleRecord> recycles = cbll.GetCardRecycleRecords(recordCon).QueryObjects;

            foreach (CardRecycleRecord record in recycles)
            {
                MonthCardPaymentInfo mci = new MonthCardPaymentInfo
                {
                    CardID          = record.CardID,
                    OwnerName       = record.OwnerName,
                    CarPlate        = record.CarPlate,
                    PaymentDateTime = record.RecycleDateTime,
                    OldExpireDate   = string.Empty,
                    NewExpireDate   = string.Empty,
                    PaymentType     = "返还押金",
                    Cash            = -record.RecycleMoney,
                    NonCash         = 0,
                };
                items.Add(mci);
            }

            List <CardLostRestoreRecord> lostRecords = cbll.GetCardLostRestoreRecords(recordCon).QueryObjects;

            foreach (CardLostRestoreRecord record in lostRecords)
            {
                MonthCardPaymentInfo mci = new MonthCardPaymentInfo
                {
                    CardID          = record.CardID,
                    OwnerName       = record.OwnerName,
                    CarPlate        = record.CarPlate,
                    PaymentDateTime = record.LostDateTime,
                    OldExpireDate   = string.Empty,
                    NewExpireDate   = string.Empty,
                    PaymentType     = "卡片挂失",
                    Cash            = record.PaymentMode == PaymentMode.Cash ? (record.LostCardCost != null ? record.LostCardCost.Value : 0) : 0,
                    NonCash         = record.PaymentMode != PaymentMode.Cash ? (record.LostCardCost != null ? record.LostCardCost.Value : 0) : 0,
                };
                items.Add(mci);
            }
            return(items);
        }
Beispiel #15
0
        protected override List <CardEventRecord> GetingItems(ParkDataContext parking, SearchCondition search)
        {
            List <CardEventRecord>       items  = new List <CardEventRecord>();
            IQueryable <CardEventRecord> result = parking.CardEvent;

            if (search is CardEventSearchCondition)
            {
                CardEventSearchCondition s = search as CardEventSearchCondition;
                if (s.RecordDateTimeRange != null)
                {
                    result = result.Where(c => c.EventDateTime >= s.RecordDateTimeRange.Begin).AsQueryable();
                    result = result.Where(c => c.EventDateTime <= s.RecordDateTimeRange.End).AsQueryable();
                }
                if (!string.IsNullOrEmpty(s.CardID))
                {
                    result = result.Where(c => c.CardID == s.CardID);
                }
                if (s.Operator != null)
                {
                    result = result.Where(c => c.OperatorID == s.Operator.OperatorID);
                }
                if (!string.IsNullOrEmpty(s.StationID))
                {
                    result = result.Where(c => c.StationID == s.StationID);
                }
                if (!string.IsNullOrEmpty(s.CarPlate))
                {
                    result = result.Where(c => c.CarPlate.Contains(s.CarPlate));
                }
                if (s.OnlyExitEvent)
                {
                    result = result.Where(c => c.IsExitEvent == true);
                }
                items = result.ToList();
                if (s.CardType != null)
                {
                    items = items.Where(c => c.CardType == s.CardType).ToList();
                }
                if (s.Source != null && s.Source.Count > 0)
                {
                    items = (from c in items
                             join e in s.Source
                             on c.EntranceID equals e.EntranceID
                             select c).ToList();
                }
            }
            else if (search is RecordSearchCondition)
            {
                RecordSearchCondition s = search as RecordSearchCondition;
                if (s.RecordDateTimeRange != null)
                {
                    result = result.Where(c => c.EventDateTime >= s.RecordDateTimeRange.Begin).AsQueryable();
                    result = result.Where(c => c.EventDateTime <= s.RecordDateTimeRange.End).AsQueryable();
                }
                if (!string.IsNullOrEmpty(s.CardID))
                {
                    result = result.Where(c => c.CardID == s.CardID);
                }
                if (s.Operator != null)
                {
                    result = result.Where(c => c.OperatorID == s.Operator.OperatorID);
                }
                if (!string.IsNullOrEmpty(s.StationID))
                {
                    result = result.Where(c => c.StationID == s.StationID);
                }
                items = result.ToList();
                if (s.CardType != null)
                {
                    items = items.Where(c => c.CardType == s.CardType).ToList();
                }
            }

            return(items);
        }