コード例 #1
0
        private void FrmOperatorShift_Load(object sender, EventArgs e)
        {
            InitControls();
            if (Operator != null)
            {
                string temp = AppSettings.CurrentSetting.GetConfigContent("AutoPrintSettleInfo");
                this.chkAutoPrint.Checked = temp == "True";

                _OperatorLog            = (new OperatorSettleBLL(AppSettings.CurrentSetting.ParkConnect)).CreateOperatorLog(Operator, Station);
                _OperatorLog.HandInCash = HandInCash;
                _OperatorLog.HandInPOS  = HandInPOS;
                if (OperatorCard != null)
                {
                    _OperatorLog.CashOperatorCard = OperatorCard.ParkFee;
                }
                ShowLogInfo(_OperatorLog, 0);

                //如果设置了结算时需输入上交金额,自动保存结算记录,成功后把结算按钮的文字改成“确定",
                //并在用户点击确认时只是打印结算单,而不用再保存结算记录
                if (UserSetting.Current.InputHandInCashWhenSettle)
                {
                    OperatorSettleBLL bllOperatorLog = new OperatorSettleBLL(AppSettings.CurrentSetting.ParkConnect);
                    CommandResult     ret            = bllOperatorLog.Settle(_OperatorLog);
                    if (ret.Result == ResultCode.Successful)
                    {
                        butOK.Text = Resources.Resource1.FrmOperatorSettle_OK;
                    }
                }
            }
        }
コード例 #2
0
        private List <CardPaymentInfo> GetCardPaymentRecordsFromDeviceRecords(List <DevicePaymentRecord> deviceRecords, string entranceName)
        {
            if (deviceRecords != null)
            {
                List <CardPaymentInfo> records = new List <CardPaymentInfo>();
                CardInfo card         = null;
                CardInfo operatorCard = null;
                foreach (DevicePaymentRecord deviceRecord in deviceRecords)
                {
                    CardPaymentInfo record = new CardPaymentInfo();
                    record.PaymentCode    = deviceRecord.PaymentCode == DevicePaymentCode.Computer ? PaymentCode.Computer : PaymentCode.FunctionCard;
                    record.ChargeDateTime = deviceRecord.PaymentDateTime;
                    record.CardID         = deviceRecord.CardID;
                    record.Accounts       = deviceRecord.Amount;
                    record.Paid           = deviceRecord.Amount;
                    record.OperatorCardID = deviceRecord.FunctionCardID;
                    record.StationID      = entranceName;
                    //缴费卡片相关信息
                    CardBll _CardBll = new CardBll(AppSettings.CurrentSetting.ParkConnect);
                    if (card == null || card.CardID != record.CardID)
                    {
                        card = _CardBll.GetCardByID(record.CardID).QueryObject;
                    }
                    if (card != null)
                    {
                        record.OwnerName = card.OwnerName;
                        record.CarPlate  = card.CarPlate;
                        record.CardType  = card.CardType;
                        record.CarType   = card.CarType;
                    }
                    //收费功能卡相关信息
                    if (operatorCard == null || operatorCard.CardID != record.OperatorCardID)
                    {
                        operatorCard = _CardBll.GetCardByID(record.OperatorCardID).QueryObject;
                    }
                    if (operatorCard != null)
                    {
                        record.OperatorID = operatorCard.OwnerName;

                        OperatorSettleBLL osbll = new OperatorSettleBLL(AppSettings.CurrentSetting.ParkConnect);
                        //查找与收费时间最近的结算时间为记录结算时间,如没有找到,则该记录还没结算
                        record.SettleDateTime = osbll.GetRecentSettleDateTime(operatorCard.OwnerName, deviceRecord.PaymentDateTime);
                    }

                    record.Memo = string.Format("上传时间:{0} ;硬件记录索引:{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), deviceRecord.RecordIndex);

                    records.Add(record);
                }

                return(records);
            }
            return(null);
        }
コード例 #3
0
        private void ItemSearching_Handler(object sender, EventArgs e)
        {
            RecordSearchCondition con = new RecordSearchCondition();

            con.Operator                  = this.operatorCombobox1.SelectecOperator;
            con.RecordDateTimeRange       = new DateTimeRange();
            con.RecordDateTimeRange.Begin = this.ucDateTimeInterval1.StartDateTime;
            con.RecordDateTimeRange.End   = this.ucDateTimeInterval1.EndDateTime;

            OperatorSettleBLL        bll   = new OperatorSettleBLL(AppSettings.CurrentSetting.ParkConnect);
            List <OperatorSettleLog> items = bll.GetOperatorLogs(con).QueryObjects;

            ShowReportsOnGrid(items);
        }
コード例 #4
0
 private void butOK_Click(object sender, EventArgs e)
 {
     if (butOK.Text == Resources.Resource1.FrmOperatorSettle_OK)
     {
         if (chkAutoPrint.Checked)
         {
             btnPrint_Click(this.btnPrint, EventArgs.Empty);
         }
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         if (_OperatorLog != null)
         {
             OperatorSettleBLL bllOperatorLog = new OperatorSettleBLL(AppSettings.CurrentSetting.ParkConnect);
             CommandResult     ret            = bllOperatorLog.Settle(_OperatorLog);
             if (ret.Result == ResultCode.Successful)
             {
                 //写卡模式时,需要将操作员卡的累计停车费用清除
                 if (OperatorCard != null)
                 {
                     OperatorCard.ParkFee = 0;
                     CardOperationManager.Instance.WriteCardLoop(OperatorCard);
                 }
                 if (chkAutoPrint.Checked)
                 {
                     btnPrint_Click(this.btnPrint, EventArgs.Empty);
                 }
                 this.DialogResult = DialogResult.OK;
             }
             else
             {
                 MessageBox.Show(ret.Message);
             }
         }
     }
 }