Example #1
0
        //Remove product from inventory
        public bool removeProduct(ProductProperties productId)
        {
            bool result = false;

            try {
                string deleteQueryString = "DELETE FROM PRODUCT WHERE PRODUCT_ID=@PRODUCTID";
                List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >();
                tableQueryData.Add(new KeyValuePair <string, string>("@PRODUCTID", productId.Product_Id));
                result = DatabaseConnectionHandler.executeDeleteQuery(deleteQueryString, tableQueryData);
            } catch (Exception ex) { Console.WriteLine(ex.StackTrace); }
            return(result);
        }
        public bool removeDiscountData(string discountId)
        {
            bool result = false;

            if (discountId != null)
            {
                string deleteQueryString = "DELETE FROM DISCOUNT WHERE DISCOUNT_ID=@DISCOUNT_ID";

                List <KeyValuePair <string, string> > parameters = new List <KeyValuePair <string, string> >();
                parameters.Add(new KeyValuePair <string, string>("@DISCOUNT_ID", discountId));

                result = DatabaseConnectionHandler.executeDeleteQuery(deleteQueryString, parameters);
            }
            return(result);
        }