Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="errorType"></param>
        /// <param name="errorMessage"></param>
        /// <param name="errorCode"></param>
        public void ShowErrorMessage(VANRequestErrorType errorType, string errorMessage, string errorCode, string viewTag)
        {
            ModeProcessing = false;
            bool   showErrorMsg = false;
            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);
                showErrorMsg = true;
                break;

            case VANRequestErrorType.NoInfoFound:
            case VANRequestErrorType.SomeError:
                message = string.Format("{0}{1}",
                                        string.IsNullOrEmpty(errorCode) ? string.Empty : "[" + errorCode + "] ",
                                        errorMessage);
                showErrorMsg = true;
                break;

            default:
                break;
            }

            StatusMessage = message;
            m_crPayType   = btnDeduction.Selected ? POS_PY_P014.CASHRCP_TYPE_DEDUCTION : POS_PY_P014.CASHRCP_TYPE_EVIDENCE;

            // 수동반품시
            // 승인안되면 그냥닫가할 수도 있으면 basket생성안함

            // 여전법 추가 0630
            // 자동반품 시,
            // 재시도 해야 하고
            // 강제 취소 가능함

            if (showErrorMsg)
            {
                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);

                this.InvokeIfNeeded(() =>
                {
                    if (m_addData.IsAutoReturn)
                    {
                        var res = ShowMessageBox(MessageDialogType.Question, string.Empty,
                                                 message, new string[] { LABEL_RETRY, LABEL_FORCE });

                        if (res != DialogResult.Yes)
                        {
                            // 강제취소 일때
                            // basket null으로 return함
                            this.ReturnResult.Add("ERROR_CODE", errorCode);
                            this.ReturnResult.Add("ERROR_MSG", errorMessage);
                            this.DialogResult = DialogResult.OK;
                        }
                    }
                    else
                    {
                        ShowMessageBox(MessageDialogType.Error, string.Empty,
                                       message, new string[] { LABEL_CLOSE });
                    }
                });

                /*
                 * if (this.InvokeRequired)
                 * {
                 *  this.BeginInvoke((MethodInvoker)delegate()
                 *  {
                 *      var res = ShowMessageBox(MessageDialogType.Error, string.Empty,
                 *          message, new string[] {
                 *      LABEL_CLOSE
                 *  });
                 *      //if (res != DialogResult.Yes)
                 *      //{
                 *      //    // basket null으로 return함
                 *      //    this.DialogResult = DialogResult.OK;
                 *      //}
                 *  });
                 * }
                 * else
                 * {
                 *  var res = ShowMessageBox(MessageDialogType.Error, string.Empty,
                 *      message, new string[] {
                 *      LABEL_CLOSE
                 *  });
                 *  //if (res != DialogResult.Yes)
                 *  //{
                 *  //    // basket null으로 return함
                 *  //    this.DialogResult = DialogResult.OK;
                 *  //}
                 * }      */
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 오류메시지
        /// </summary>
        /// <param name="errorType"></param>
        /// <param name="errorMessage"></param>
        /// <param name="errorCode"></param>
        /// <param name="viewTag"></param>
        public void ShowErrorMessage(VANRequestErrorType errorType, string errorMessage, string errorCode, string viewTag)
        {
            ShowProgressMessage(false);

            //2015.09.30 정광호 수정---------------------------------
            //모든 에러에 대해서 메세지 가이드대신 팝업 활성화
            //bool showErrorMsg = false;
            bool showErrorMsg = true;
            //-------------------------------------------------------

            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);
                showErrorMsg = true;
                break;

            case VANRequestErrorType.NoInfoFound:
            case VANRequestErrorType.SomeError:
                message = string.Format("{0}{1}",
                                        string.IsNullOrEmpty(errorCode) ? string.Empty : "[" + errorCode + "] ",
                                        errorMessage);
                break;

            default:
                break;
            }

            m_crPayType   = btnDeduction.Selected ? CASHRCP_TYPE_DEDUCTION : CASHRCP_TYPE_EVIDENCE;
            StatusMessage = message;

            //2015.09.30 정광호 수정---------------------------------
            //모든 에러에 대해서 메세지 가이드대신 팝업 활성화
            //StatusMessage = message;
            //-------------------------------------------------------

            if (showErrorMsg)
            {
                message += Environment.NewLine;
                message += MSG_COMM_ERROR_RETRY;

                if (this.InvokeRequired)
                {
                    this.BeginInvoke((MethodInvoker) delegate()
                    {
                        var res = ShowMessageBox(MessageDialogType.Question, string.Empty,
                                                 message, new string[] {
                            LABEL_RETRY, LABEL_CLOSE
                        });
                        if (res != DialogResult.Yes)
                        {
                            this.DialogResult = DialogResult.OK;
                        }
                    });
                }
                else
                {
                    var res = ShowMessageBox(MessageDialogType.Question, string.Empty,
                                             message, new string[] {
                        LABEL_RETRY, LABEL_CLOSE
                    });
                    if (res != DialogResult.Yes)
                    {
                        this.DialogResult = DialogResult.OK;
                    }
                }
            }

            ModeProcessing = false;

            if (this.InvokeRequired)
            {
                this.BeginInvoke((MethodInvoker) delegate()
                {
                    btnSelf.Enabled = btnClose.Enabled = true;
                });
            }
            else
            {
                btnSelf.Enabled = btnClose.Enabled = true;
            }
            //btnSelf.Enabled = btnClose.Enabled = true;
        }