private void ItemSearching_Handler(object sender, EventArgs e)
        {
            RecordSearchCondition con = new RecordSearchCondition();

            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;
            con.CardID          = this.txtCardID.Text.Trim();
            con.Operator        = this.operatorCombobox1.SelectecOperator;
            con.StationID       = this.workStationCombobox1.Text;
            con.OwnerName       = this.txtOwnerName.Text;
            con.CarPlate        = this.txtCarPlate.Text;
            con.CardCertificate = this.txtCertificate.Text;
            CardBll bll = new CardBll(AppSettings.CurrentSetting.ParkConnect);
            List <CardLostRestoreRecord> items = bll.GetCardLostRestoreRecords(con).QueryObjects;

            ShowReportsOnGrid(items);
        }
Пример #2
0
        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);
        }