コード例 #1
0
        private void textITEM_COUNT_TextChanged(object sender, EventArgs e)
        {
            DataTable Dt = new DataTable();

            Dt = product.CHECk_PRODUCT_QUANTITY(product_id);

            if (Dt.Rows.Count > 0)
            {
                int BDquantity = Convert.ToInt32(Dt.Rows[0][0]);
                int count;

                if (BDquantity == 0)
                {
                    MessageBox.Show("  المنتج المطلوب غير متاح " + BDquantity);
                    textBARCODE.Text = string.Empty;
                }

                if (Int32.TryParse(textITEM_COUNT.Text, out count))
                {
                    if (BDquantity < count)
                    {
                        MessageBox.Show("  الكمية المتاحة من المنتج " + BDquantity);
                        textITEM_COUNT.Text = string.Empty;
                    }
                    else if (BDquantity == count)
                    {
                        MessageBox.Show(" الكمية الحاليه ستصبح 0");
                    }
                    else if (BDquantity == 0)
                    {
                        MessageBox.Show(" تم الابلاغ مسبقا الكمية الحاليه 0");
                    }
                }
            }
        }