public HttpResponseMessage UpdateWorkerHours([FromBody] JObject data)
        {
            int projectWorkerId = (int)data["projectWorkerId"];
            int numHours        = (int)data["numHours"];

            return((TeamLeaderLogic.UpdateWorkerHours(projectWorkerId, numHours)) ?
                   new HttpResponseMessage(HttpStatusCode.OK) :
                   new HttpResponseMessage(HttpStatusCode.BadRequest)
            {
                Content = new ObjectContent <String>("Can not update in Data Base", new JsonMediaTypeFormatter())
            });
        }
Example #2
0
        public HttpResponseMessage UpdateWorkerHours([FromBody] JObject data)
        {
            int projectWorkerId = (int)data["projectWorkerId"];
            int numHours        = (int)data["numHours"];

            //curl -v -X PUT -H "Content-type: application/json" -d "{\"projectWorkerId\":\"1\",\"numHours\":\"30\"}"  http://localhost:59628/api/updateWorkerHours
            return((TeamLeaderLogic.UpdateWorkerHours(projectWorkerId, numHours)) ?

                   new HttpResponseMessage(HttpStatusCode.OK) :
                   new HttpResponseMessage(HttpStatusCode.BadRequest)
            {
                Content = new ObjectContent <String>("Can not update in Data Base", new JsonMediaTypeFormatter())
            });
        }