Ejemplo n.º 1
0
        public string addOrder(long customerID, long productID, int count)
        {
            string addOrderString = string.Format(SQLQueries.Queries["order"], customerID, productID, count);

            if (doesCustomerExist(customerID))
            {
                if (doesProductExist(productID))
                {
                    SQLCalls.ExecuteNonQuery(addOrderString);
                    return("Success!");
                }
                else
                {
                    SQLCalls.CloseConnectionAndReader();
                    return("Product Doesn't Exist");
                    //    Debug.WriteLine("Product Doesn't Exist");
                }
            }
            else
            {
                SQLCalls.CloseConnectionAndReader();
                return("Customer Doesn't Exist");
                //    Debug.WriteLine("Customer Doesn't Exist");
            }
        }
Ejemplo n.º 2
0
        public void addCustomer(string customerFirstName, string customerLastName)
        {
            string customerName      = customerFirstName.Trim() + " " + customerLastName.Trim();
            string addCustomerString = string.Format(SQLQueries.Queries["customer"], customerName);

            SQLCalls.ExecuteNonQuery(addCustomerString);
        }
Ejemplo n.º 3
0
        public void addProduct(string productName, int productPrice)
        {
            string addProductString = string.Format(SQLQueries.Queries["product"], productName, productPrice);

            SQLCalls.ExecuteNonQuery(addProductString);
        }