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; } } } }
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); } } } }