コード例 #1
0
        public HttpResponseMessage UpdateStatus([FromBody] Sale sale)
        {
            var response = new APIResponse <Sale>();

            try
            {
                var updateLogic = new SalesBLL();
                var newStatus   = updateLogic.UpdateSale(sale);
                response.Data           = newStatus;
                response.Message        = "Status changed correctly";
                response.HttpStatusCode = HttpStatusCode.OK;
            }
            catch (Exception e)
            {
                response.HttpStatusCode = HttpStatusCode.InternalServerError;
                response.Message        = "Error updating sale";
                response.HasError       = true;
            }

            return(Request.CreateResponse(response.HttpStatusCode, response));
        }