Exemple #1
0
        /// <summary>
        /// 현금IC
        /// </summary>
        /// <param name="payAmt">대상금액</param>
        /// <param name="taxAmt">세금액</param>
        /// <param name="modeReturn">반품여부</param>
        /// <param name="orgApprNo">원거래번호</param>
        /// <param name="orgAppDate">원거래일자</param>
        public POS_PY_P013(int payAmt, int taxAmt, bool modeReturn, BasketCashIC orgCashIC, bool allowCancel)
        {
            InitializeComponent();

            //대상금액
            m_payAmt      = payAmt;
            m_taxAmt      = taxAmt;
            m_modeReturn  = modeReturn;
            m_allowCancel = allowCancel;

            lblOrgApprDate.Visible     = lblOrgApprNo.Visible =
                txtOrgApprDate.Visible = txtOrgApprNo.Visible = modeReturn;
            lblYmd.Visible             = modeReturn;

            m_orgCashIC         = orgCashIC;
            txtOrgApprDate.Text = m_orgCashIC != null ? m_orgCashIC.RealApprProcDate : string.Empty;
            txtOrgApprNo.Text   = m_orgCashIC != null ? m_orgCashIC.ApprNo : string.Empty;
            m_modeAutoRtn       = m_orgCashIC != null ?
                                  !string.IsNullOrEmpty(m_orgCashIC.ApprNo) && !string.IsNullOrEmpty(m_orgCashIC.RealApprProcDate) :
                                  false;

            txtOrgApprNo.ReadOnly   = m_modeAutoRtn;
            txtOrgApprNo.Tag        = 12; // min length 0981400352960
            txtOrgApprDate.ReadOnly = m_modeAutoRtn;
            txtOrgApprDate.Tag      = 8;  // min length

            //2015.09.18 정광호 수정-----------------------------
            // 간소화취소 사용안함
            //btnSimpleCancel.Visible = modeReturn;
            //btnSimpleCancel.Left = 183;
            //btnClose.Left = modeReturn ? 286 : 234;
            btnSimpleCancel.Visible = false;
            //---------------------------------------------------

            // Loc added 10.26
            // 무카드 취소
            btnCancNoCard.Visible = m_modeAutoRtn;

            // Allow to close popup or not
            btnClose.Enabled = m_allowCancel; // 자동반품시 닫기 비활성화
            this.Text        = this.Text + (modeReturn ? (m_modeAutoRtn ? TITLE_AUTORTN : TITLE_MANURTN) : string.Empty);

            if (modeReturn && !m_modeAutoRtn)
            {
                txtOrgApprDate.SetFocus();
            }

            //대상금액
            txtPayAmt.Text = m_payAmt.ToString();

            //정보 조회
            m_presenter = new PYP013presenter(this);

            InitEvent();
        }
Exemple #2
0
        /// <summary>
        /// 결제완료이나 통신실패시, BASKET생성 및 완료
        /// </summary>
        /// <param name="respData"></param>
        /// <param name="errorCode"></param>
        /// <param name="errorMessage"></param>
        void OnEndPayment(PV04RespData respData, string errorCode, string errorMessage)
        {
            BasketCashIC basket = null;

            if (m_orgCashIC != null)
            {
                basket             = (BasketCashIC)(BasketCashIC.Parse(typeof(BasketCashIC), m_orgCashIC.ToString()));
                basket.ForceCancFg = respData != null ? string.Empty : "1";
                basket.CancRcvCode = respData != null ? string.Empty : errorCode;
                basket.CancRcvMsg  = respData != null ? string.Empty : errorMessage;
            }
            else
            {
                basket = new BasketCashIC()
                {
                    CancFg        = "0",
                    InputType     = "C",
                    ApprAmtIncVat = m_taxAmt.ToString(),
                    PayAmt        = m_payAmt.ToString(),
                };
            }

            #region 공통속성
            basket.OTApprNo   = txtOrgApprNo.Text;
            basket.OTSaleDate = txtOrgApprDate.Text;
            #endregion

            #region 승인받을때
            if (respData != null)
            {
                basket.CardNm          = respData.CardName;
                basket.CashICAccountNo = respData.PayAcctNo;
                basket.IssueComCd      = respData.IssuerCode;
                basket.IssueComNm      = respData.IssuerName;
                basket.MaeipComCd      = respData.MaeipCode;
                basket.MaeipComNm      = respData.MaeipName;
                basket.VanID           = respData.ApprVanCode;
                basket.ICCardSeqNo     = m_icCardSeqNo;
            }

            #endregion

            basket.ApprNo           = respData != null ? respData.ApprNo : string.Empty;
            basket.RealApprProcDate = respData != null ? respData.ApprDate : DateTime.Today.ToString("yyyyMMdd");
            basket.RealApprProcTime = respData != null ? respData.ApprTime : DateTime.Now.ToString("HHmmss");

            this.ReturnResult.Add("PAY_DATA", basket);
            if (!string.IsNullOrEmpty(errorCode) || !string.IsNullOrEmpty(errorMessage))
            {
                this.ReturnResult.Add("ERROR_CODE", errorCode);
                this.ReturnResult.Add("ERROR_MSG", errorMessage);
            }
            this.DialogResult = DialogResult.OK;
        }
        /// <summary>
        /// 현금IC 결제화면
        /// </summary>
        /// <param name="cashAmt">결제금액</param>
        /// <param name="taxAmt"></param>
        /// <param name="orgCashIC">원거래현금IC Basket</param>
        /// <param name="allowCancel">닫기버튼활성화여부</param>
        /// <param name="returnData"></param>
        /// <param name="errorCode">오류코드</param>
        /// <param name="errorMessage">오류메시지</param>
        /// <returns>DialogResult.OK:성공</returns>
        public DialogResult ShowCashICPopup(int cashAmt, int taxAmt, BasketCashIC orgCashIC,
                                            bool allowCancel, out object returnData, out string errorCode, out string errorMessage)
        {
            returnData = null;
            using (var pop = ChildManager.ShowPopup(string.Empty, "WSWD.WmallPos.POS.PY.dll",
                                                    "WSWD.WmallPos.POS.PY.VC.POS_PY_P013", cashAmt, taxAmt, StateRefund, orgCashIC, allowCancel))
            {
                var res = pop.ShowDialog(this);
                Application.DoEvents();

                returnData   = pop.ReturnResult.ContainsKey("PAY_DATA") ? pop.ReturnResult["PAY_DATA"] : null;
                errorCode    = pop.ReturnResult.ContainsKey("ERROR_CODE") ? pop.ReturnResult["ERROR_CODE"].ToString() : null;
                errorMessage = pop.ReturnResult.ContainsKey("ERROR_MSG") ? pop.ReturnResult["ERROR_MSG"].ToString() : null;
                return(res);
            }
        }