Exemplo n.º 1
0
        public HttpResponseMessage CancelDelivery(Models.delivery_master deliveryMaster)
        {
            try
            {
                bool success = deliveryRepository.CancelDelivery(deliveryMaster);

                if (success)
                {
                    var formatter = RequestFormat.JsonFormaterString();
                    return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                        output = "success", msg = "Courier Information Updated Successfully"
                    },
                                                  formatter));
                }
                else
                {
                    var formatter = RequestFormat.JsonFormaterString();
                    return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                        output = "error", msg = "Courier Information Updated Failed"
                    },
                                                  formatter));
                }
            }
            catch (Exception ex)
            {
                var formatter = RequestFormat.JsonFormaterString();
                return(Request.CreateResponse(HttpStatusCode.OK, new Confirmation {
                    output = "error", msg = ex.ToString()
                }, formatter));
            }
        }