예제 #1
0
        //Load products from database into the datagridview
        private void loadProduct()
        {
            try
            {
                String    query = "SELECT * FROM group_five.products";
                dbConnect db    = new dbConnect();

                dgvPDBase.DataSource = db.Select(query);
                ad.Update(dt);
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
        }
예제 #2
0
        //Load products from database into the datagridview
        private void loadPsProduct()
        {
            try
            {
                dbConnect db    = new dbConnect();
                String    query = "SELECT * FROM group_five.products WHERE QUANTITY > 0";

                dgvEProduct.DataSource = db.Select(query);
                ad.Update(dt);
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
        }
예제 #3
0
        //Search forProduct
        private void txtSearch_TextChanged(object sender, EventArgs e)
        {
            try
            {
                dbConnect db        = new dbConnect();
                String    searchKye = txtSearch.Text;
                String    query     = "SELECT * FROM group_five.products WHERE PRODUCT_ID LIKE ('" + searchKye + "%') OR PRODUCT_NAME LIKE ('" + searchKye + "%')";

                dgvEProduct.DataSource = db.Select(query);
                ad.Update(dt);

                if (txtSearch.Text == "")
                {
                    loadPsProduct();
                }
            }
            catch (Exception error)
            {
                MessageBox.Show(error.Message);
            }
        }