コード例 #1
0
ファイル: FrmReleaseStock.cs プロジェクト: sammmk/ERP
        private void txt_itemCode_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    DataTable dt       = new DataTable();
                    DataTable stock    = new DataTable();
                    string    itemCode = txt_itemCode.Text;

                    //get item data and fill data
                    dt = MANAGEDB.getItemDataForStockEntry(itemCode);

                    if (dt.Rows.Count >= 1)
                    {
                        txt_itemId.Text   = dt.Rows[0]["itemId"].ToString();
                        txt_itemName.Text = dt.Rows[0]["itemName"].ToString();
                        txt_itemCode.Text = dt.Rows[0]["itemCode"].ToString();

                        //get stock entry for item
                        stock = MANAGEDB.getStockEntryForItem(dt.Rows[0]["itemCode"].ToString());

                        if (stock.Rows.Count > 0)
                        {
                            txt_inStockQty.Text   = MANAGEDB.getTotalStockAmountForItem(itemCode).ToString();
                            txt_stockIdQty.Text   = stock.Rows[0]["remainQuantity"].ToString();
                            txt_UnitPrice.Text    = stock.Rows[0]["sellingUnitPrice"].ToString();
                            txt_stockEntryId.Text = stock.Rows[0]["stockEntryId"].ToString();
                            //STOCK_ID_LIST.Add(txt_stockEntryId.Text);


                            txt_releaseQty.Focus();
                            //System.Media.SystemSounds.Beep.Play();
                            //System.Media.SystemSounds.Asterisk.Play();
                            //System.Media.SystemSounds.Exclamation.Play();
                            //System.Media.SystemSounds.Question.Play();
                            //System.Media.SystemSounds.Hand.Play();
                        }
                        else
                        {
                            COM_MESSAGE.warningMessage("There are no Remain Quantity for the item you entered", "No Items Remain");
                        }
                    }
                    else
                    {
                        txt_itemCode.Clear();
                        //System.Media.SystemSounds.Beep.Play();
                        //System.Media.SystemSounds.Asterisk.Play();
                        //System.Media.SystemSounds.Exclamation.Play();
                        //System.Media.SystemSounds.Question.Play();
                        //System.Media.SystemSounds.Hand.Play();
                    }
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
コード例 #2
0
        private void txt_itemCode_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    DataTable dt = new DataTable();

                    //get item data and fill data
                    dt = MANAGEDB.getItemDataForStockEntry(txt_itemCode.Text);

                    if (dt.Rows.Count >= 1)
                    {
                        //System.Media.SystemSounds.Beep.Play();
                        //System.Media.SystemSounds.Asterisk.Play();
                        //System.Media.SystemSounds.Exclamation.Play();
                        //System.Media.SystemSounds.Question.Play();
                        //System.Media.SystemSounds.Hand.Play();
                        btn_search.PerformClick();
                    }
                    else
                    {
                        COM_MESSAGE.warningMessage("The Item you are searching is not found", "Not Found");
                        txt_itemCode.Clear();
                        txt_itemCode.Focus();
                        //System.Media.SystemSounds.Beep.Play();
                        //System.Media.SystemSounds.Asterisk.Play();
                        //System.Media.SystemSounds.Exclamation.Play();
                        //System.Media.SystemSounds.Question.Play();
                        //System.Media.SystemSounds.Hand.Play();
                    }
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }
コード例 #3
0
ファイル: FrmStockIntake.cs プロジェクト: sammmk/ERP
        private void txt_itemCode_KeyUp(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.KeyCode == Keys.Enter)
                {
                    DataTable dt = new DataTable();

                    //get item data and fill data
                    dt = MANAGEDB.getItemDataForStockEntry(txt_itemCode.Text);

                    if (dt.Rows.Count >= 1)
                    {
                        txt_itemId.Text   = dt.Rows[0]["itemId"].ToString();
                        txt_itemName.Text = dt.Rows[0]["itemName"].ToString();

                        dropDown_stockUnit.DataSource     = MANAGEDB.getUnitDetails();
                        dropDown_stockUnit.DisplayMember  = "symbol";
                        dropDown_stockUnit.ValueMember    = "unitId";
                        dropDown_stockUnit.BindingContext = this.BindingContext;
                        dropDown_stockUnit.SelectedIndex  = dropDown_stockUnit.FindString(dt.Rows[0]["stockUnit"].ToString());
                        txt_quantity.Focus();
                        //System.Media.SystemSounds.Beep.Play();
                        //System.Media.SystemSounds.Asterisk.Play();
                        //System.Media.SystemSounds.Exclamation.Play();
                        //System.Media.SystemSounds.Question.Play();
                        //System.Media.SystemSounds.Hand.Play();
                    }
                    else
                    {
                        txt_itemCode.Clear();
                        //System.Media.SystemSounds.Beep.Play();
                        //System.Media.SystemSounds.Asterisk.Play();
                        //System.Media.SystemSounds.Exclamation.Play();
                        //System.Media.SystemSounds.Question.Play();
                        //System.Media.SystemSounds.Hand.Play();
                    }
                }
            }
            catch (Exception ex)
            {
                COM_MESSAGE.exceptionMessage(ex.Message);
            }
        }