示例#1
0
        public HttpResponseMessage DeleteprodName(string prodName)
        {
            ProductQuery        pq = new ProductQuery();
            HttpResponseMessage response;
            bool ret = pq.DeleteProduct(prodName, "prodName");

            if (ret)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }

            return(response);
        }
示例#2
0
        public HttpResponseMessage DeleteinStock(string inStock)
        {
            ProductQuery        pq = new ProductQuery();
            HttpResponseMessage response;
            bool ret = pq.DeleteProduct(inStock, "inStock");

            if (ret)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }

            return(response);
        }
示例#3
0
        // DELETE: api/Product/5
        public HttpResponseMessage Delete(int id)
        {
            ProductQuery        pq = new ProductQuery();
            HttpResponseMessage response;
            bool ret = pq.DeleteProduct(Convert.ToString(id), "prodID");

            if (ret)
            {
                response = Request.CreateResponse(HttpStatusCode.NoContent);
            }
            else
            {
                response = Request.CreateResponse(HttpStatusCode.NotFound);
            }

            return(response);
        }