예제 #1
0
 public HttpResponseMessage Update(HttpRequestMessage request, OrderDetailModel OrderDetailModel)
 {
     return(CreateHttpResponse(request, () =>
     {
         HttpResponseMessage response = null;
         if (!ModelState.IsValid)
         {
             request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
         }
         else
         {
             var OrderDetaiServvice = new OrderDetaiServvice();
             OrderDetaiServvice.Update(OrderDetailModel);
             response = request.CreateResponse(HttpStatusCode.OK);
         }
         return response;
     }));
 }
예제 #2
0
        public HttpResponseMessage Delete(HttpRequestMessage request, int OrderID, int ProductID)
        {
            return(CreateHttpResponse(request, () =>
            {
                HttpResponseMessage response = null;
                if (!ModelState.IsValid)
                {
                    response = request.CreateResponse(HttpStatusCode.BadRequest, ModelState);
                }
                else
                {
                    var OrderDetaiServvice = new OrderDetaiServvice();
                    OrderDetaiServvice.Deleteone(OrderID, ProductID);
                    response = request.CreateResponse(HttpStatusCode.OK);
                }

                return response;
            }));
        }