Exemple #1
0
        public void getProducts()
        {
            dataGridView1.Rows.Clear();
            sqlCommandAB addProducts = new sqlCommandAB();
            DataTable    DT          = addProducts.QueryDT("SELECT * FROM Product");

            String[] row;
            for (int j = 0; j < DT.Rows.Count; j++)
            {
                string brand = addProducts.getSingleString("SELECT brandName FROM brand WHERE brandID = '" + DT.Rows[j]["brandID"] + "'");
                row = new string[] { (string)DT.Rows[j]["pName"], DT.Rows[j]["pCode"].ToString(), (string)DT.Rows[j]["categoryName"], (string)brand, "R" + DT.Rows[j]["pSellingPrice"].ToString(), DT.Rows[j]["pQty"].ToString(), DT.Rows[j]["pReorderQty"].ToString(), (string)DT.Rows[j]["pDescription"] };
                dataGridView1.Rows.Add(row);
            }
        }
Exemple #2
0
        public decimal  getCreditA(string a)
        {
            sqlCommandAB getCr = new sqlCommandAB();
            string       cr    = getCr.getSingleString("SELECT Customer_CreditLimit from Customer WHERE Customer_Number ='" + a + "'");
            decimal      credit;

            try
            {
                Decimal.TryParse(cr, out credit);
            }
            catch (Exception) {
                return(0);
            }
            return(credit);
        }
Exemple #3
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();
            }
        }