Example #1
0
        public IHttpActionResult DeactivateLine(int lineId)
        {
            if (lineId < 1)
            {
                return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.NoContent, "Sorry,Line id Can not be smaller than 1")));
            }

            Line editedLine;

            try
            {
                editedLine = _lineManager.DeactivateLine(lineId);
            }
            catch (Exception)
            {
                return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, "Something went wrong")));
            }

            if (editedLine != null)
            {
                return(Ok(editedLine));
            }
            else
            {
                return(ResponseMessage(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Sorry, could not change the customer's details")));
            }
        }