/// <summary> /// 난수받아서 처리 /// </summary> /// <param name="randNum"></param> void RequestICCardReader(string randNum) { TraceHelper.Instance.TraceWrite("RequestICCardReader", "난수: -{0}-", randNum); // request to receice ic card no using (var pop = ChildManager.ShowPopup(string.Empty, "WSWD.WmallPos.POS.PY.dll", "WSWD.WmallPos.POS.PY.VC.POS_PY_P004", randNum)) { var res = pop.ShowDialog(this); if (res == DialogResult.OK) { m_icCardTrackII = pop.ReturnResult["TRACKII"].ToString(); m_icCardSeqNo = pop.ReturnResult["IC_CARD_SEQ_NO"].ToString(); m_icCardIssuerCd = pop.ReturnResult["ISSUER_CD"].ToString(); m_icCardIssuerPosCd = pop.ReturnResult["ISSUER_POS_NO"].ToString(); m_icCardEncData = pop.ReturnResult["ENC_DATA"].ToString(); txtCardNo.Text = m_icCardSeqNo; if (ValidatePayment(false, false)) { ProcessPayment(MODE_NORMAL_TRXN); return; } } } ModeProcessing = CashICPaymentState.Ready; }
/// <summary> /// 난수가져오기 /// </summary> void RequestRandNumber() { // 처리중 ModeProcessing = CashICPaymentState.Processing; // VAN승인 - 난수 가져오기 // m_presenter.ProcessGetRanNum(m_payAmt.ToString(), m_taxAmt.ToString()); // 임시테스트 - Random 난수 string randNum = MakeRandomNumber(); RequestICCardReader(randNum); }
/// <summary> /// KEY ENTER AND CLEAR /// </summary> /// <param name="e"></param> void ValidateOnKeyEvent(OPOSKeyEventArgs e) { InputText it = null; if (e.Key.OPOSKey == OPOSMapKeys.KEY_ENTER) { if (ValidatePayment(true, false)) { e.IsHandled = true; ProcessPayment(MODE_NORMAL_TRXN); return; } if (this.FocusedControl != null) { it = (InputText)this.FocusedControl; int minLen = (int)it.Tag; if (it.Text.Length < minLen) { e.IsHandled = true; return; } this.NextControl(); } return; } if (ModeProcessing == CashICPaymentState.Errored) { ModeProcessing = CashICPaymentState.Ready; e.IsHandled = true; return; } var initState = IsInitialState(); if (initState) { ModeProcessing = CashICPaymentState.Ready; } if (this.FocusedControl == null || initState) { if (btnClose.Enabled) { e.IsHandled = true; btnClose_Click(btnClose, EventArgs.Empty); } return; } it = (InputText)this.FocusedControl; if (it.Text.Length > 0) { return; } this.PreviousControl(); }
/// <summary> /// ERROR MESSAGE /// </summary> /// <param name="errorType"></param> /// <param name="errorMessage"></param> /// <param name="errorCode"></param> public void ShowErrorMessage(VANRequestErrorType errorType, string errorMessage, string errorCode) { ShowProgressMessage(false); ModeProcessing = CashICPaymentState.Errored; string message = string.Empty; switch (errorType) { case VANRequestErrorType.None: break; case VANRequestErrorType.CommError: message = MSG_VAN_REQ_COMM_ERROR; message += string.Format("{0}{1}", string.IsNullOrEmpty(errorCode) ? string.Empty : "[" + errorCode + "] ", errorMessage); break; case VANRequestErrorType.NoInfoFound: case VANRequestErrorType.SomeError: message = string.Format("{0}{1}", string.IsNullOrEmpty(errorCode) ? string.Empty : "[" + errorCode + "] ", errorMessage); break; default: break; } StatusMessage = message; #region 자동반품시 통신오류, 강제진행, 강제취소 if ((errorType == VANRequestErrorType.CommError || errorType == VANRequestErrorType.SomeError) && m_modeReturn && m_modeAutoRtn) { // 자동반품시, 통신오류, 재시도이나 강제진행 StringBuilder sb = new StringBuilder(); sb.AppendLine(MSG_VAN_REQ_COMM_ERROR); sb.AppendLine(MSG_VAN_REQ_COMM_ERROR_RETRY); sb.Append(Environment.NewLine); sb.AppendLine("[ERROR]"); sb.AppendFormat("{0}{1}", string.IsNullOrEmpty(errorCode) ? string.Empty : "[" + errorCode + "] ", errorMessage); if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker) delegate() { var res = ShowMessageBox(MessageDialogType.Question, string.Empty, sb.ToString(), new string[] { LABEL_RETRY, LABEL_FORCE }); // 강제진행 // Basket 생성 & 닫기 if (res == DialogResult.No) { OnEndPayment(null, errorCode, errorMessage); } }); } else { var res = ShowMessageBox(MessageDialogType.Question, string.Empty, sb.ToString(), new string[] { LABEL_RETRY, LABEL_FORCE }); // 강제진행 // Basket 생성 & 닫기 if (res == DialogResult.No) { OnEndPayment(null, errorCode, errorMessage); } } } #endregion ModeProcessing = CashICPaymentState.Ready; }