Example #1
0
        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 SelectItemFactor()
 {
     if (grdItemFactor.RowCount > 0)
     {
         _ItemFactorTemplated = new ItemFactorTemplate {
             ItemFactor = Convert.ToDecimal(grdItemFactor.SelectedRows[0].Cells["ItemFactor"].Value)
         };
         Close();
     }
 }
Example #3
0
        private void cboItemUnit_SelectedIndexChanged(object sender, EventArgs e)
        {
            var oItemFactorTemplate = new ItemFactorTemplate();

            oItemFactorTemplate.ItemSeqNo  = txtItemSeqNo.Text.Trim();
            oItemFactorTemplate.ItemUnitID = Convert.ToString(cboItemUnit.SelectedValue);
            oItemFactorTemplate.SelectOne();
            txtItemFactor.Text = string.Format(Program.FormatCurrency, oItemFactorTemplate.ItemFactor);
            oItemFactorTemplate.Dispose();
            oItemFactorTemplate = null;
        }
        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();
        }