private void fpIssueList_ButtonClicked(object sender, EditorNotifyEventArgs e) { NZString ItemCD = new NZString(null, shtIssueList.Cells[e.Row, (int)eColView.ITEM_CODE].Value); NZString LotNo = new NZString(null, shtIssueList.Cells[e.Row, (int)eColView.LOT_NO].Value); NZString LocCD = new NZString(cboFromLoc, cboFromLoc.SelectedValue); if (e.Column == (int)eColView.ITEM_CD_BTN) { ItemFindDialog dialog = new ItemFindDialog(eSqlOperator.In, null); dialog.ShowDialog(this); if (dialog.IsSelected) { shtIssueList.Cells[e.Row, (int)eColView.ITEM_CODE].Value = dialog.SelectedItem.ITEM_CD.Value; shtIssueList.Cells[e.Row, (int)eColView.ITEM_DESC].Value = dialog.SelectedItem.ITEM_DESC.Value; shtIssueList.Cells[e.Row, (int)eColView.LOT_NO].Value = null; shtIssueList.Cells[e.Row, (int)eColView.ISSUE_QTY].Value = null; } } else if (e.Column == (int)eColView.LOT_BTN) { NZString locCD = new NZString(null, cboFromLoc.SelectedValue); LotNoFindDialog dialog = new LotNoFindDialog(ItemCD, locCD); dialog.ShowDialog(this); if (dialog.IsSelected) { shtIssueList.Cells[e.Row, (int)eColView.LOT_NO].Value = dialog.SelectedLotNo.NVL(string.Empty); LotNo = new NZString(null, shtIssueList.Cells[e.Row, (int)eColView.LOT_NO].Value); shtIssueList.Cells[e.Row, (int)eColView.ONHAND_QTY].Value = GetOnhandQty(ItemCD, LocCD, LotNo); shtIssueList.Cells[e.Row, (int)eColView.ISSUE_QTY].Value = shtIssueList.Cells[e.Row, (int)eColView.ONHAND_QTY].Value; } } }
private void fpView_ButtonClicked(object sender, EditorNotifyEventArgs e) { if (e.Column == (int)eColView.ITEM_CD_BTN) { ItemFindDialog dialog = null; if (chkFilterItem.Checked) { //if (cboSupplierCode.ToNZString().IsNull) //{ // ErrorItem error = new ErrorItem(null, TKPMessages.eValidate.VLM0105.ToString(), new object[] { this.lblSupplierCode.Text }); // MessageDialog.ShowBusiness(this, error.Message); // return; //} dialog = new ItemFindDialog(eSqlOperator.In, null, cboSupplierCode.ToNZString(), DataDefine.eDealingType.Supplier); } else { dialog = new ItemFindDialog(eSqlOperator.In, null); } dialog.ShowDialog(this); if (dialog.IsSelected) { LoadItemIntoRow(e.Row, dialog.SelectedItem.ITEM_CD); } } }
/// <summary> /// Set Default Value into selected cell, will be used when select Item Code. /// </summary> private void SetItemCDandItemDesc() { eItemType[] itemTypeEnum = { eItemType.All }; ItemFindDialog dialog = new ItemFindDialog(eSqlOperator.Equal, itemTypeEnum); dialog.ShowDialog(this); if (dialog.IsSelected) { shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.ITEM_CD].Value = dialog.SelectedItem.ITEM_CD.StrongValue; // set default into ItemCode, ItemDesc, Unit, InventoryU/M and Rate of unit. ErrorItem errItem = ValidateDupplicateItem(); if (errItem != null) { shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.ITEM_CD].Value = string.Empty; shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.ITEM_DESC].Value = string.Empty; ValidateException.ThrowErrorItem(errItem); } ValidateException.ThrowErrorItem(errItem); shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.ITEM_DESC].Value = dialog.SelectedItem.ITEM_DESC.StrongValue; //shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.UNIT].Value = dialog.SelectedItem.ORDER_UM_CLS.StrongValue; //shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.INV_UM].Value = dialog.SelectedItem.INV_UM_CLS.StrongValue; //shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.RATE].Value = dialog.SelectedItem.INV_UM_RATE.StrongValue / dialog.SelectedItem.ORDER_UM_RATE.StrongValue; } }
private string SearchItem() { eItemType[] eType = { eItemType.All }; ItemFindDialog dialog = new ItemFindDialog(eSqlOperator.Equal, eType); dialog.ShowDialog(this); if (dialog.IsSelected) { return(dialog.SelectedItem.ITEM_CD.ToString()); } return(string.Empty); }
public void HelpButton_Click(object sender, EventArgs e) { // show find dialog ItemFindDialog fdItem = null; if (CustomerCode != null && !"".Equals(CustomerCode)) { fdItem = new ItemFindDialog(m_sqlOperator, ItemType, (NZString)CustomerCode, DataDefine.eDealingType.Customer); } else { fdItem = new ItemFindDialog(m_sqlOperator, ItemType); } fdItem.ShowDialog(); if (fdItem.IsSelected) { Text = fdItem.SelectedItem.ITEM_CD.StrongValue; if (DescriptionTextBox != null) { DescriptionTextBox.Text = GetItemDescription(fdItem.SelectedItem.ITEM_CD); } if (CustomerNameTextBox != null) { CustomerNameTextBox.Text = GetCustomerData(fdItem.SelectedItem.ITEM_CD); } m_bChooseItem = true; } else { //if (DescriptionTextBox != null) //{ // DescriptionTextBox.Text = string.Empty; // SelectedItemData = null; // SelectedItemProcessData = null; //} //if (CustomerNameTextBox != null) // CustomerNameTextBox.Text = string.Empty; m_bChooseItem = false; } Focus(); }
private void fpView_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e) { try { eItemType[] itemTypeEnum = { eItemType.All }; ItemFindDialog dialog = new ItemFindDialog(eSqlOperator.Equal, itemTypeEnum); dialog.ShowDialog(this); if (dialog.IsSelected) { #region validateion int iRow = shtView.ActiveRowIndex; List <string> strItemCDList = new List <string>(); for (int i = 0; i < shtView.Rows.Count; i++) { if (i != iRow) { strItemCDList.Add(Convert.ToString(shtView.Cells[i, (int)eColumn.ITEM_CD].Value)); } } ValidateException.ThrowErrorItem(PurchaseOrderEntryValidation.CheckDupItem(dialog.SelectedItem.ITEM_CD, strItemCDList)); #endregion shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.ITEM_CD].Value = dialog.SelectedItem.ITEM_CD.ToString(); shtView.Cells[shtView.ActiveRowIndex, (int)eColumn.ITEM_DESC].Value = dialog.SelectedItem.ITEM_DESC.ToString(); } } catch (BusinessException err) { MessageDialog.ShowBusiness(this, err.Error.Message); err.Error.FocusOnControl(); } catch (ValidateException err) { MessageDialog.ShowBusiness(this, err.ErrorResults[0].Message); err.ErrorResults[0].FocusOnControl(); } }