Example #1
0
        private void addProductBTN_Click(object sender, EventArgs e)
        {
            Clear();
            using (addProductForm addP = new addProductForm()) {
                addP.ShowDialog();
                addP.addProductClick += new EventHandler(addP_addProductClick);
                pCodeTB.Text          = addP.getpCodes;
                pNameTB.Text          = addP.getpNames;
                priceTB.Text          = addP.getpPrice;
                dbQuantity            = Convert.ToInt32(addP.getpQuantity);

                if (addP.getpQuantity != "" && addP.getpQuantity != null)
                {
                    AvaliableQuantity = int.Parse(addP.getpQuantity);
                }
            }
        }
Example #2
0
        public void getProduct(out addProductForm[] Cat_Array)
        {
            dataGridView3.Rows.Clear();
            sqlCommandAB brandSql = new sqlCommandAB();
            DataTable    DT       = brandSql.QueryDT("SELECT * FROM Product");
            int          rowCount = DT.Rows.Count;

            Cat_Array = new addProductForm[rowCount];
            string[] row;
            for (int j = 0; j < rowCount; j++)
            {
                string brandName = brandSql.getSingleString("SELECT brandName FROM Brand WHERE brandID = '" + Convert.ToInt32(DT.Rows[j]["brandID"]) + "'");
                row = new string[] { (string)DT.Rows[j]["pCode"], (string)DT.Rows[j]["pName"], (string)DT.Rows[j]["categoryName"], brandName, DT.Rows[j]["pSellingPrice"].ToString() };

                dataGridView3.Rows.Add(row);
                loadData();
            }
        }