private void SearchItemFactor(string ItemSeqNo, string ItemUnitID) { using (var oitemfactor = new ItemFactorTemplate()) { oitemfactor.ItemSeqNo = ItemSeqNo; oitemfactor.ItemUnitID = ItemUnitID; var dtbItemFactor = oitemfactor.SelectAllByItemSeqNoItemUnitID(); if (dtbItemFactor.Rows.Count > 1) { ItemFactorTemplate _ItemFactorTemplate; using (var frm = new SearchItemFactorForm()) { _ItemFactorTemplate = frm.Search(ItemSeqNo, ItemUnitID); } if (_ItemFactorTemplate != null) { txtItemFactor.Text = string.Format(Program.FormatCurrency, _ItemFactorTemplate.ItemFactor); } } else if (dtbItemFactor.Rows.Count == 1) { txtItemFactor.Text = string.Format(Program.FormatCurrency, dtbItemFactor.Rows[0]["ItemFactor"]); } else { txtItemFactor.Text = string.Format(Program.FormatCurrency, 1); } } }
private void PopulateGrid(string ItemSeqNo, string ItemUnitID) { grdItemFactor.SuspendLayout(); grdItemFactor.AutoGenerateColumns = false; var ItemFactor = new ItemFactorTemplate(); ItemFactor.ItemSeqNo = ItemSeqNo; ItemFactor.ItemUnitID = ItemUnitID; var dtb = ItemFactor.SelectAllByItemSeqNoItemUnitID(); grdItemFactor.DataSource = dtb; grdItemFactor.ResumeLayout(); }