Example #1
0
        //public string[] brandValues(string a, string b, string c) {
        //    string[] brandthings = new string[] {a,b,c };
        //    return brandthings;
        //}
        private void brandUBTN_Click(object sender, EventArgs e)
        {
            int selectedrowindex = dataGridView2.SelectedCells[0].RowIndex;

            DataGridViewRow selectedRow = dataGridView2.Rows[selectedrowindex];
            string          a           = Convert.ToString(selectedRow.Cells["brandNameDT"].Value);

            sqlCommandAB brandSql = new sqlCommandAB();
            int          id       = brandSql.getSingleValue("SELECT brandID FROM Brand WHERE( categoryName = '" + selectCat.SelectedItem.ToString() + "' AND brandName ='" + a + "')");

            if (brandNameTB.Text.Equals(""))
            {
                MessageBox.Show("Please Enter a Brand Name");
            }

            else
            {
                brandSql.updateDB("UPDATE Brand set brandName='" + (string)brandNameTB.Text + "',brandDescription='" + (string)brandDescriptionTB.Text + "' WHERE brandID='" + id + "'");
                if (sqlCommandAB.message != null)
                {
                    MessageBox.Show(sqlCommandAB.message + "Couldn't update " + a + "\nDue to netwrok Error, Please check your network and try again");
                }
                else
                {
                    MessageBox.Show("The brand  " + a + " update succefully");
                    dataGridView2.Rows.Clear();
                    CategorysAndBrand[] customer;
                    getBrandData(out customer);
                    Clear();
                }
            }
        }
Example #2
0
        private void loggedOut()
        {
            sqlCommandAB logout = new sqlCommandAB();
            int          id     = logout.getSingleValue("SELECT loginID FROM loginLog ORDER BY loginID DESC");

            logout.updateDB("UPDATE loginLog set loginEnd = getDate() WHERE loginID = '" + id + "'");
        }
Example #3
0
        public void updateInv(string pCode, int q)
        {
            sqlCommandAB upIn  = new sqlCommandAB();
            int          pqtyy = upIn.getSingleValue("SELECT pQty FROM Product WHERE pCode ='" + pCode + "'");

            upIn.updateDB("UPDATE Product set pQty =' " + (pqtyy - q) + "' WHERE pCode ='" + pCode + "'");
        }
Example #4
0
        private void updateBTN_Click(object sender, EventArgs e)
        {
            sqlCommandAB categroySql = new sqlCommandAB();

            if (CategoryNameTB.Text == "")
            {
                MessageBox.Show("Category is Blank");
            }
            else
            {
                categroySql.updateDB("UPDATE Category set categoryDescription='" + (string)Category_DescriptionTB.Text + "' WHERE categoryName='" + (string)CategoryNameTB.Text + "'");
                if (sqlCommandAB.message != null)
                {
                    MessageBox.Show(sqlCommandAB.message + "Couldn't update " + (string)CategoryNameTB.Text + "\nDue to netwrok Error, Please check your network and try again");
                }
                else
                {
                    MessageBox.Show("Category Description for  " + (string)CategoryNameTB.Text + " update succefully");
                    dataGridView2.Rows.Clear();
                    CategorysAndBrand[] customer;
                    getBrandData(out customer);
                    Clear();
                }
            }
        }
Example #5
0
        public void UpdateCustomerAccountLimit()
        {
            sqlCommandAB upC = new sqlCommandAB();

            // upC.updateDB("UPDATE Customers Set Customer_CreditBalance = '" + Convert.ToDouble(TotalCredit) + "' WHERE (Customer_Number ='" + (string)custNumberTB.Text + "')");
            upC.updateDB("UPDATE Customer set Customer_CreditLimit ='" + (getCreditB((string)custNumberTB.Text)) + (0.20) * (Convert.ToDouble(TotalCredit)) + "' WHERE Customer_Number = '" + (string)custNumberTB.Text + "'");
            //  MessageBox.Show(Convert.ToDouble(TotalCredit) + " " + (string)custNumberTB.Text);
        }
Example #6
0
        public void updateCustomerCreditLimit()
        {
            string       cNum   = (string)custNumberTB.Text;
            double       credit = Convert.ToDouble(getCreditB(cNum)) + Convert.ToDouble(amountPaidTB.Text) * 0.20;
            sqlCommandAB ab     = new sqlCommandAB();

            ab.updateDB("UPDATE Customer set Customer_CreditLimit ='" + credit + "' WHERE Customer_Number = '" + cNum + "'");
        }
Example #7
0
        private void updateCredit(double credit, string b)
        {
            sqlCommandAB ab = new sqlCommandAB();

            ab.updateDB("UPDATE Customer set Customer_CreditLimit ='" + credit + "' WHERE Customer_Number = '" + b + "'");
            if (sqlCommandAB.message != null)
            {
                MessageBox.Show("Credit Limit failed to update Customer");
            }
            else
            {
                MessageBox.Show("Credit limit set to " + credit);
                Clear();
            }
        }
Example #8
0
        private void updateBTN_Click(object sender, EventArgs e)
        {
            String  PN    = (string)tb_itemName.Text;
            Decimal StP   = Convert.ToDecimal(tb_itemSellingPrice.Text);
            Decimal SP    = Convert.ToDecimal(tb_itemStockPrice.Text);
            int     RP    = Convert.ToInt32(ReorderPoint.Text);
            int     qunti = Convert.ToInt32(qty.Text);
            String  PD    = (string)tb_itemDescription.Text;

            // MessageBox.Show("item name " + PN + " sellingPrice " + StP + " Stock Price " + SP + " Reorder point " + RP + " qauntity " + qunti + " Des " + PD + " PCode "+pCode );
            sqlCommandAB st = new sqlCommandAB();

            st.updateDB("UPDATE Product set pCostPrice = '" + SP + "', pName ='" + PN + "', pSellingPrice ='" + StP + "', pReorderQty ='" + RP + "', pQty ='" + qunti + "', pDescription ='" + PD + "' WHERE pCode = '" + pCode + "'");
            // pName = '" + PN + "'
            DialogResult dr = MessageBox.Show("Product " + PN.ToString() + " Has Been Updated");

            if (dr == DialogResult.OK)
            {
                Clear();
            }
        }
Example #9
0
        public void UpdateStaff(Staff customer)
        {
            sqlCommandAB brandSql = new sqlCommandAB();

            brandSql.updateDB("UPDATE Staff set staff_Cell = '" + customer.cell + "',staff_Remarks='" + customer.remarks + "',staff_Email ='" + customer.email + "', staff_Type='" + customer.type + "' WHERE (staff_Number = '" + customer.staffNumber + "')");
        }
Example #10
0
        public void UpdateNewCustomer(Customer customer)
        {
            sqlCommandAB brandSql = new sqlCommandAB();

            brandSql.updateDB("UPDATE Customer set Customer_Cell = '" + customer.cell + "',Customer_Tel='" + customer.tel + "',Customer_Email ='" + customer.email + "', Customer_Address='" + customer.address + "' WHERE (Customer_Number = '" + customer.username + "')");
        }
Example #11
0
        public void UpdateOrderAmount(Decimal price)
        {
            sqlCommandAB upo = new sqlCommandAB();

            upo.updateDB("UPDATE Orders  Set OrderAmount ='" + price + "' WHERE (Order_Number ='" + (string)oNumberTB.Text + "')");
        }
Example #12
0
        public void UpdateOrderDetails()
        {
            sqlCommandAB upo = new sqlCommandAB();

            upo.updateDB("UPDATE Orders  Set OrderStatus ='Installment' WHERE (Order_Number ='" + (string)oNumberTB.Text + "')");
        }
Example #13
0
        public void UpdateOrderStatus()
        {
            sqlCommandAB upo = new sqlCommandAB();

            upo.updateDB("UPDATE Orders  Set OrderStatus ='Completed' WHERE (Order_Number ='" + (string)oNumberTB.Text + "')");
        }