/// <summary> /// 반납상품교환권 등록화면 /// <param name="giftButton">해당행의 교환권번호버튼</param> /// </summary> void ShowDetailExchGiftList(WSWD.WmallPos.POS.FX.Win.UserControls.Button giftButton) { // TODO // 1. Check amount, remain 회수금액 > 0 // 2. Check 미회수입력 SaleGridCell cell = giftButton.Parent as SaleGridCell; SaleGridRow row = cell.Row; string noRtnReason = row.Cells[8].Controls[0].Text; if (!string.IsNullOrEmpty(noRtnReason)) { ShowMessageBox(WSWD.WmallPos.FX.Shared.MessageDialogType.Warning, string.Empty, ERR_MSG_NORTN_RSN_ENTER_INVALID); return; } if (string.IsNullOrEmpty(giftButton.Text)) { return; } string exchGiftNo = giftButton.Text; Int64 cashAmt = TypeHelper.ToInt64(row.Cells[5].Controls[0].Text.Replace(",", "")); //Int64 giftAmt = TypeHelper.ToInt64(row.Cells[6].Controls[0].Text.Replace(",", "")); Int64 retAmt = TypeHelper.ToInt64(row.Cells[4].Controls[0].Text.Replace(",", "")); // SHOW POUPP using (var pop = ChildManager.ShowPopup(string.Empty, "WSWD.WmallPos.POS.SL.dll", "WSWD.WmallPos.POS.SL.VC.POS_SL_P007", m_rtnPrsGiftList, giftButton.Text, retAmt - cashAmt)) { var res = pop.ShowDialog(this); if (res == DialogResult.OK) { // Update back to row data from P007 pop var retList = (List <RtnPrsGiftData>)pop.ReturnResult["GIFT_LIST"]; m_rtnPrsGiftList[giftButton.Text] = retList; // update total input gift amt; PQ11RespData data = (PQ11RespData)row.ItemData; data.RtnGiftAmt = (long)pop.ReturnResult["GIFT_TOTAL"]; row.Cells[6].Controls[0].Text = data.RtnGiftAmt.ToString(); data.RtnPrsnList = new List <RtnPrsGiftData>(); data.RtnPrsnList.AddRange(retList); } } }
/// <summary> /// For input 구상품교환권 /// </summary> /// <param name="bMsg"></param> /// 2015.08.26 정광호 수정 bMsg 구분자 추가하여 메시지관련 변경 확인 private void ResetInputs(bool bMsg) { // reset flag m_scannedGiftNo = false; //2015.08.26 정광호 수정-------------------- //****************************************** if (bMsg) { // Guide Message StatusMessage = MSG_INPUT; } //StatusMessage = MSG_INPUT; //****************************************** //2015.08.26 정광호 수정-------------------- if (this.FocusedControl != null) { InputText itNo = (InputText)this.FocusedControl; itNo.Text = string.Empty; itNo.Tag = null; SaleGridRow row = (SaleGridRow)itNo.Parent.Parent; var itCnt = (InputText)row.Cells[2].Controls[0]; var itAmt = (InputText)row.Cells[3].Controls[0]; var lblEtc = (Label)row.Cells[4].Controls[0]; itCnt.Text = itAmt.Text = lblEtc.Text = string.Empty; itCnt.ReadOnly = itAmt.ReadOnly = false; //2015.08.26 정광호 수정-------------------- //클리어시 itemdata null로 처리안해주면 상품권 스캐닝시에 하위에 입력됨 row.ItemData = null; } // Update total UpdateTotalGiftAmt(); }
/// <summary> /// 전문에서 확인성공 /// </summary> /// <param name="giftAmt"></param> /// <param name="giftOtherData"></param> private void ConfirmNewGiftData(string giftAmt, string giftOtherData, string strGiftNo) { InputText itNo = null; InputText itCnt = null; InputText itAmt = null; Label lblEtc = null; SaleGridRow curRow = null; if (m_scannedGiftNo) { // get next empty foreach (SaleGridRow row in gpPQ11.Rows) { //2015.08.27 정광호 수정--------------------------------------- //************************************************************* //상품권번호없이 직접 입력한 row에 스캐닝 값이 들어가는것을 방지 //if (row.ItemData == null) //{ // itNo = (InputText)row.Cells[1].Controls[0]; // itCnt = (InputText)row.Cells[2].Controls[0]; // itAmt = (InputText)row.Cells[3].Controls[0]; // lblEtc = (Label)row.Cells[4].Controls[0]; // curRow = row; // break; //} if (row.Cells[2].Controls[0].Text.Length <= 0 && row.Cells[3].Controls[0].Text.Length <= 0) { itNo = (InputText)row.Cells[1].Controls[0]; itCnt = (InputText)row.Cells[2].Controls[0]; itAmt = (InputText)row.Cells[3].Controls[0]; lblEtc = (Label)row.Cells[4].Controls[0]; curRow = row; break; } //************************************************************* //2015.08.27 정광호 수정--------------------------------------- } } else { //2015.08.26 정광호 수정--------------------------------------- //************************************************************* itNo = (InputText)this.FocusedControl; curRow = (SaleGridRow)itNo.Parent.Parent; itCnt = (InputText)curRow.Cells[2].Controls[0]; itAmt = (InputText)curRow.Cells[3].Controls[0]; lblEtc = (Label)curRow.Cells[4].Controls[0]; } if (itCnt != null) { //2015.08.26 정광호 수정--------------------------------------- //************************************************************* itCnt.ReadOnly = itAmt.ReadOnly = true; itNo.Text = m_inputGiftNo; itCnt.Text = "1"; itAmt.Text = giftAmt; lblEtc.Text = giftOtherData; curRow.ItemData = new RtnPrsGiftData() { GiftAmt = TypeHelper.ToInt64(giftAmt), GiftCount = 1, GiftNo = m_inputGiftNo, GiftUsage = giftOtherData }; // focus to next row if (curRow.RowIndex < gpPQ11.Rows.Length - 1) { InputText it = (InputText)gpPQ11.Rows[curRow.RowIndex + 1].Cells[1].Controls[0]; it.SetFocus(); } //************************************************************* //2015.08.26 정광호 수정--------------------------------------- } // update total UpdateTotalGiftAmt(); m_inputGiftNo = string.Empty; m_scannedGiftNo = false; }
/// <summary> /// Process ENTER, CLEAR: next previous (clear) /// ENTER KEy for GiftNo; process PG01 /// ENTER key for Amt: proces Korean won amount /// CLEAR key for GiftNo: Reset input current row /// /// </summary> /// <param name="e"></param> void POS_SL_P007_KeyEvent(WSWD.WmallPos.FX.Shared.OPOSKeyEventArgs e) { if (this.FocusedControl != null) { InputText it = (InputText)this.FocusedControl; SaleGridCell cell = (SaleGridCell)it.Parent; // 교환권번호컬럼 if (cell.ColumnIndex == 1) { // GiftNo, clear, reset input, invalid if (it.Text.Length > 0 && e.Key.OPOSKey == WSWD.WmallPos.FX.Shared.OPOSMapKeys.KEY_BKS) { //2015.08.26 정광호 수정 ResetInputs(true); //ResetInputs(); return; } if (it.Text.Length > 0 && e.Key.OPOSKey == WSWD.WmallPos.FX.Shared.OPOSMapKeys.KEY_CLEAR) { it.Text = string.Empty; e.IsHandled = true; //2015.08.26 정광호 수정 ResetInputs(true); //ResetInputs(); return; } if (it.Text.Length > 0 && e.Key.OPOSKey == WSWD.WmallPos.FX.Shared.OPOSMapKeys.KEY_ENTER) { ValidateGiftNo(false, it.Text); e.IsHandled = true; return; } if (!e.IsControlKey) { StatusMessage = MSG_INPUT; } } if (e.Key.OPOSKey == WSWD.WmallPos.FX.Shared.OPOSMapKeys.KEY_CLEAR) { SaleGridRow row = (SaleGridRow)cell.Parent; var itNo = (InputText)row.Cells[1].Controls[0]; if (it.Text.Length > 0 && !it.ReadOnly && itNo.Text.Length == 0) { e.IsHandled = true; it.Text = string.Empty; UpdateTotalGiftAmt(); return; } e.IsHandled = true; this.PreviousControl(); } else if (e.Key.OPOSKey == WSWD.WmallPos.FX.Shared.OPOSMapKeys.KEY_ENTER) { // validate number enterred if (cell.ColumnIndex == 3 && !it.ReadOnly) { var val = TypeHelper.ToInt64(it.Text.Replace(",", "")); val = ValidateMoney(val); it.Text = val.ToString(); } // update total git amount UpdateTotalGiftAmt(); e.IsHandled = true; this.NextControl(); } } }
/// <summary> /// SubFunc for UpdateItemRow /// to be called in thread or async /// </summary> /// <param name="value"></param> void ItemsGrid_UpdateItemRow(SaleGridRow row, PBItemData value) { if (row.Cells.Length == 0) { return; } PBItemData curItemData = row.ItemData as PBItemData; // update Amount - 금액다시 계산 if (curItemData == null) { curItemData = PBItemData.Empty; } bool setNull = false; if (value == null) { setNull = true; value = PBItemData.Empty; value.Properties = PBItemProperties.All; } // value.CompleteStep == Empty // 처음 Scan 된 상품이라 모든 셀의 값이 재설정한다 bool isFirstParse = (value.ScannedStep > PBItemParseStep.Empty && value.ScannedStep <= PBItemParseStep.CdItem) && value.CompletedStep == PBItemParseStep.Empty; if (isFirstParse || (value.Properties & PBItemProperties.CdClass) == PBItemProperties.CdClass) { currentItemInfo1.CdDp = value.CdDp; row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[0].Text = SLExtensions.CDDP_PB.Equals(value.CdDp) ? value.CdClass : string.Empty; row.Cells[SLExtensions.CELL_INDEX_QTY].Controls[0].Text = string.IsNullOrEmpty(value.CdClass) ? string.Empty : 1.ToString(); // Update row index row.Cells[SLExtensions.CELL_INDEX_NO].Controls[0].Text = string.IsNullOrEmpty(value.CdClass) ? string.Empty : string.Format("{0:d2}", row.RowIndex + 1); } if (isFirstParse || (value.Properties & PBItemProperties.NmClass) == PBItemProperties.NmClass) { row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[1].Text = SLExtensions.CDDP_PB.Equals(value.CdDp) ? value.NmClass : string.Empty; if (row.VisibleIndex == gpItems.SelectedVisibleIndex) { currentItemInfo1.NmClass = SLExtensions.CDDP_PB.Equals(value.CdDp) ? value.NmClass : string.Empty; } } if (isFirstParse || (value.Properties & PBItemProperties.CdItem) == PBItemProperties.CdItem) { row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[0].Text += SLExtensions.CDDP_PB.Equals(value.CdDp) ? value.CdItem : value.Barcode; } if (isFirstParse || (value.Properties & PBItemProperties.NmItem) == PBItemProperties.NmItem) { if (SLExtensions.CDDP_PB.Equals(value.CdDp)) { string name = row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[1].Text; row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[1].Text = string.Format("{0}{1}{2}", name, (!string.IsNullOrEmpty(name) && !string.IsNullOrEmpty(value.NmItem) ? "_" : string.Empty), value.NmItem); } else { row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[1].Text = value.NmItem; } if (row.VisibleIndex == gpItems.SelectedVisibleIndex) { currentItemInfo1.NmItem = value.NmItem; } } if (isFirstParse || (value.Properties & PBItemProperties.FgClass) == PBItemProperties.FgClass) { row.Cells[SLExtensions.CELL_INDEX_ITEM].Controls[0].Text += value.FgClass; } if (isFirstParse || (value.Properties & PBItemProperties.Qty) == PBItemProperties.Qty) { var qty = TypeHelper.ToInt64(value.Qty); if (qty == -1) { // 수량정정 qty = TypeHelper.ToInt64(curItemData.Qty); qty++; } /// update last value value.Qty = qty.ToString(); string qtyText = qty.MoneyToText(!string.IsNullOrEmpty(value.CdClass)); row.Cells[SLExtensions.CELL_INDEX_QTY].Controls[0].Text = string.Format("{0}{1}", StateRefund && !string.IsNullOrEmpty(qtyText) ? "-" : string.Empty, qtyText); row.Cells[SLExtensions.CELL_INDEX_QTY].Controls[0].ForeColor = Color.Empty; if (row.VisibleIndex == gpItems.SelectedVisibleIndex) { currentItemInfo1.Qty = qty; } } // 지정취소 if (isFirstParse || (value.Properties & PBItemProperties.FgCanc) == PBItemProperties.FgCanc) { if ("0".Equals(value.FgCanc)) { row.Cells[SLExtensions.CELL_INDEX_QTY].Controls[0].ForeColor = Color.Empty; } else { row.Cells[SLExtensions.CELL_INDEX_QTY].Controls[0].Text = "0"; row.Cells[SLExtensions.CELL_INDEX_QTY].Controls[0].ForeColor = Color.Red; if (row.VisibleIndex == gpItems.SelectedVisibleIndex) { currentItemInfo1.Qty = 0; } } } if (isFirstParse || (value.Properties & PBItemProperties.Price) == PBItemProperties.Price) { var nPrice = TypeHelper.ToInt64(value.UtSprc); var oPrice = TypeHelper.ToInt64(curItemData.UtSprc); if (nPrice != oPrice && oPrice > 0) { curItemData.FgUtSprcChanged = true; if (row.VisibleIndex == gpItems.SelectedVisibleIndex) { currentItemInfo1.NmClass = "&" + currentItemInfo1.NmClass; } } row.Cells[SLExtensions.CELL_INDEX_PRICE].Controls[0].Text = nPrice.MoneyToText(); if (row.VisibleIndex == gpItems.SelectedVisibleIndex) { currentItemInfo1.Price = nPrice; } } //curItemData.Merge(value); PBItemData copyItem = null; if (setNull) { copyItem = value; gpItems.SetRowData(row, value); } else { copyItem = curItemData.Copy(); copyItem.Merge(value); gpItems.SetRowData(row, copyItem); } string amtText = copyItem.AmItem.MoneyToText(); row.Cells[SLExtensions.CELL_INDEX_AMT].Controls[0].Text = string.Format("{0}{1}", StateRefund && !string.IsNullOrEmpty(amtText) ? "-" : string.Empty, amtText); }
void saleGridPanel1_RowSelected(SaleGridRow row) { label1.Text = row.RowIndex.ToString() + "/" + row.GridControl.PageIndex.ToString(); }