示例#1
0
        public void Cleanup()
        {
            List <Product> products = db_product.FindProductByPriceHigher(999.0);

            foreach (Product product in products)
            {
                db_product.DeleteProduct(product.Id);
            }
        }
        /// <summary>
        /// Deletes a product.
        /// </summary>
        /// <param name="id"></param>
        /// <param name="call_origin"></param>
        /// <returns>string</returns>
        public string Delete(int id, string call_origin)
        {
            string result;

            result = db_product.DeleteProduct(id);

            return(result);
        }
        public void Cleanup()
        {
            List <UserProduct> user_products;

            db_userproduct.DeleteByUsername(user.Username);

            foreach (Product product in products)
            {
                user_products = db_userproduct.FindUserProductByProductId(product.Id);

                foreach (UserProduct user_product in user_products)
                {
                    db_userproduct.Delete(user_product);
                }

                db_product.DeleteProduct(product.Id);
            }
        }
示例#4
0
        public void Cleanup()
        {
            //Deletes test products
            foreach (Product product in products)
            {
                db_product.DeleteProduct(product.Id);
            }

            //Deletes test orders
            foreach (Order order in orders)
            {
                db_order.DeleteOrder(order.Id);
            }

            //Deletes test userproduct
            foreach (OrderDetail order_detail in orderdetails)
            {
                db_orderdetail.DeleteOrderDetail(order_detail);
            }

            db_user.DeleteUser(user.Username);
        }