/// <summary> /// 타사상품권 /// </summary> /// <param name="iGetAmt">받을돈</param> /// <param name="basketOtherTickets">타사상품권 내역</param> /// <param name="_iOverCnt">Tran 개수</param> public POS_PY_P007(int iGetAmt, List <BasketPay> basket, int _iTranOverCnt, bool modeReturn, bool bAuto) { InitializeComponent(); //현재 Tran 개수 iTranOverCnt = _iTranOverCnt; //받을돈 _iGetAmt = iGetAmt; this.modeReturn = modeReturn; this._bAuto = bAuto; if (bAuto) { this.Text = this.Text + (modeReturn ? strMsg09 : string.Empty); this.btnClose.Enabled = !modeReturn; } else { this.Text = this.Text + (modeReturn ? strMsg11 : string.Empty); } //타사상품권 내역 _basketOtherTickets = new List <BasketOtherTicket>(); foreach (var item in basket) { if (item.GetType().Name.ToString() == "BasketOtherTicket") { BasketOtherTicket bp = (BasketOtherTicket)item; if (bp != null) { _basketOtherTickets.Add(bp); } } } //Form Load Event Load += new EventHandler(form_Load); }
/// <summary> /// 적용 button Event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnSave_Click(object sender, EventArgs e) { if (_bDisable) { return; } if ((modeReturn && !_bAuto) || !modeReturn) { if (grd == null || grd.RowCount <= 0) { return; } } SetControlDisable(true); try { var listBasket = new List <BasketPay>(); BasketOtherTicket bp = null; Int32 iGetAmt = _iGetAmt; Int32 iPayAmt = 0; for (int i = 0; i < grd.RowCount; i++) { DataRow dr = (System.Data.DataRow)(grd.GetRow(i).ItemData); iPayAmt = TypeHelper.ToInt32(dr["ColAmt"].ToString().Replace(",", "")); bp = new BasketOtherTicket(); bp.PayGrpCd = NetCommConstants.PAYMENT_GROUP_TKCKET; //지불 수단 그룹 코드 bp.PayDtlCd = NetCommConstants.PAYMENT_DETAIL_TICKET_OTHER; //지불 수단 상세 코드 bp.PayAmt = iPayAmt.ToString(); //지불 금액 bp.CancFg = "0"; //취소 flag bp.OtherTicketType = dr["ColTypeCd"].ToString(); //타사상품권 종류 bp.OtherTicketNo = dr["ColNum"].ToString(); //타사상품권 번호 bp.OtherTicketNm = dr["ColTypeNm"].ToString(); //타사상품권 이름 bp.TicketAmt = iPayAmt.ToString(); //권종 금액 bp.OtherTicketDivision = "01"; //상품권 구분 S (01:지로, 02:모바일) iGetAmt -= iPayAmt; if (iGetAmt < 0) { bp.BalAmt = (iGetAmt * -1).ToString(); bp.BalGrpCd = NetCommConstants.PAYMENT_GROUP_CASH; bp.BalDtlCd = NetCommConstants.PAYMENT_DETAIL_CASH; } else { bp.BalGrpCd = NetCommConstants.PAYMENT_GROUP_NONE; bp.BalDtlCd = NetCommConstants.PAYMENT_DETAIL_NONE; } listBasket.Add(bp); } if (modeReturn && _bAuto && iGetAmt > 0) { var ret = ShowMessageBox(MessageDialogType.Question, string.Empty, string.Format(strMsg10, iGetAmt)); if (ret == DialogResult.Yes) { #region 현금BASKET생성 BasketPayCash payCash = new BasketPayCash(); payCash.PayAmt = iGetAmt.ToString(); listBasket.Add(payCash); #endregion } else { return; } } this.ReturnResult.Add("PAY_DATA", listBasket); this.DialogResult = DialogResult.OK; } catch (Exception) { } finally { SetControlDisable(false); } }