コード例 #1
0
 private void ShowCardPaymentOnRow(LDB_CardPaymentInfo info, int row)
 {
     GridView.Rows[row].Tag = info;
     GridView.Rows[row].Cells["colCardID"].Value         = info.CardID;
     GridView.Rows[row].Cells["colCarType"].Value        = CarTypeSetting.Current.GetDescription(info.CarType);
     GridView.Rows[row].Cells["colCardType"].Value       = info.CardType.ToString();
     GridView.Rows[row].Cells["colCarPlate"].Value       = info.CarPlate;
     GridView.Rows[row].Cells["colExitDateTime"].Value   = info.ChargeDateTime;
     GridView.Rows[row].Cells["colOperator"].Value       = info.OperatorID;
     GridView.Rows[row].Cells["colPaymentMode"].Value    = Ralid.Park.BusinessModel.Resouce.PaymentModeDescription.GetDescription(info.PaymentMode);
     GridView.Rows[row].Cells["colTariffType"].Value     = Ralid.Park.BusinessModel.Resouce.TariffTypeDescription.GetDescription(info.TariffType);
     GridView.Rows[row].Cells["colEnterDateTime"].Value  = info.EnterDateTime;
     GridView.Rows[row].Cells["colTimeSpan"].Value       = info.TimeInterval;
     GridView.Rows[row].Cells["colPaid"].Value           = info.Paid;
     GridView.Rows[row].Cells["colDiscount"].Value       = info.Discount;
     GridView.Rows[row].Cells["colHandled"].Value        = info.UpdateFlag;
     GridView.Rows[row].Cells["colTotalAccounts"].Value  = info.Accounts;
     GridView.Rows[row].Cells["colTotalPaid"].Value      = info.TotalPaid;
     GridView.Rows[row].Cells["colTotalDiscount"].Value  = info.TotalDiscount;
     GridView.Rows[row].Cells["colStation"].Value        = info.StationID;
     GridView.Rows[row].Cells["colMemo"].Value           = info.Memo;
     GridView.Rows[row].Cells["colPaymentCode"].Value    = Ralid.Park.BusinessModel.Resouce.PaymentCodeDescription.GetDescription(info.PaymentCode);
     GridView.Rows[row].Cells["colOperatorCardID"].Value = info.OperatorCardID;
     GridView.Rows[row].DefaultCellStyle.ForeColor       = info.Discount > 0 ? Color.Red : Color.Black;
 }
コード例 #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            CardPaymentRecordBll     cbll  = new CardPaymentRecordBll(AppSettings.CurrentSetting.CurrentMasterConnect);
            LDB_CardPaymentRecordBll lcbll = new LDB_CardPaymentRecordBll(LDB_AppSettings.Current.LDBConnect);

            InitProgress();
            NotifyProgress(0);
            foreach (DataGridViewRow row in GridView.Rows)
            {
                LDB_CardPaymentInfo info    = row.Tag as LDB_CardPaymentInfo;
                CardPaymentInfo     payment = LDB_InfoFactory.CreateCardPaymentInfo(info);
                CommandResult       result  = cbll.InsertRecordWithCheck(payment);
                if (result.Result == ResultCode.Successful)
                {
                    info.UpdateFlag = true;
                    lcbll.Update(info);
                    ShowCardPaymentOnRow(info, row.Index);
                    row.DefaultCellStyle.ForeColor = Color.Green;
                }
                else
                {
                    row.DefaultCellStyle.ForeColor = Color.Red;
                }
                GridView.Refresh();
                NotifyProgress(null);
            }
            NotifyProgress(this.progressBar1.Maximum);
            this.progressBar1.Visible = false;
        }
コード例 #3
0
        /// <summary>
        /// 收取卡片的停车费
        /// </summary>
        /// <param name="info">缴费卡片,为空值时从数据库中获取,主要用于写卡模式时读取到卡片的数据</param>
        /// <param name="payment">缴费记录</param>
        /// <returns></returns>
        public CommandResult PayParkFee(CardInfo info, CardPaymentInfo payment)
        {
            if (info != null)
            {
                LDB_CardPaymentInfo ldbRecord = LDB_InfoFactory.CreateLDBCardPaymentInfo(payment);
                CommandResult       result    = _Provider.Insert(ldbRecord);
                if (result.Result == ResultCode.Successful)
                {
                    if (payment.PaymentMode == PaymentMode.Prepay)
                    {
                        info.Balance -= payment.Paid;
                    }

                    //只有卡片在场或可重复出场,并且与缴费记录的进场时间相同,才会更新卡片信息
                    if ((info.IsInPark || info.CanRepeatOut) &&
                        payment.EnterDateTime.HasValue &&
                        info.LastDateTime == payment.EnterDateTime.Value)
                    {
                        //设置卡片缴费信息
                        info.SetPaidData(payment);
                    }
                }

                return(result);
            }

            return(new CommandResult(ResultCode.NoRecord, ResultCodeDecription.GetDescription(ResultCode.NoRecord)));
        }
コード例 #4
0
 public CommandResult Update(LDB_CardPaymentInfo info)
 {
     if (info.ID.HasValue)
     {
         LDB_CardPaymentInfo oldVal = _Provider.GetByID(info.ID.Value).QueryObject;
         return(_Provider.Update(info, oldVal));
     }
     return(new CommandResult(ResultCode.Fail, string.Empty));
 }
コード例 #5
0
 public CommandResult Delete(LDB_CardPaymentInfo info)
 {
     return(_Provider.Delete(info));
 }
コード例 #6
0
 public CommandResult Insert(LDB_CardPaymentInfo info)
 {
     return(_Provider.Insert(info));
 }