public HttpResponseMessage GetHours(int projectId) { return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <String>(TeamLeaderLogic.GetHours(projectId), new JsonMediaTypeFormatter()) }); }
public HttpResponseMessage GetHours(int projectId) //curl -X GET -v http://localhost:59628/api/GetHours/10/1 { return(new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <String>(TeamLeaderLogic.GetHours(projectId), new JsonMediaTypeFormatter()) }); }
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()) }); }
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()) }); }
public HttpResponseMessage UpdateProjectDetails([FromBody] JObject data) { int projectId = (int)data["projectId"]; int developHours = (int)data["developHours"]; int QAHours = (int)data["QAHours"]; int UIUXHours = (int)data["UIUXHours"]; DateTime endDate = (DateTime)data["endDate"]; bool isComplete = (bool)data["isComplete"]; return((TeamLeaderLogic.UpdateProjectDetails(projectId, developHours, QAHours, UIUXHours, endDate, isComplete)) ? new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <bool>(true, new JsonMediaTypeFormatter()) } : new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new ObjectContent <String>("Can not update in DB", new JsonMediaTypeFormatter()) }); }
public HttpResponseMessage GetWorkerHours(int teamLeaderId, int workerId) => new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <List <WorkerHours> >(TeamLeaderLogic.getWorkerHours(teamLeaderId, workerId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetWorkersHours(int projectId) => new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <List <Object> >(TeamLeaderLogic.getWorkersHours(projectId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetWorkersForProject(int teamLeaderId) => new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <List <User> >(TeamLeaderLogic.GetWorkersForProject(teamLeaderId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetProjectDeatails(int teamLeaderId) => new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <List <Project> >(TeamLeaderLogic.GetProjectDeatails(teamLeaderId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetRemainingHours(int projectId, int jobId) => new HttpResponseMessage(HttpStatusCode.OK) { Content = new ObjectContent <string>(TeamLeaderLogic.GetRemainingHours(projectId, jobId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetRemainingHours(int projectId, int jobId) => new HttpResponseMessage(HttpStatusCode.OK) { //curl -X GET -v http://localhost:59628/api/getRemainingHours/ Content = new ObjectContent <string>(TeamLeaderLogic.GetRemainingHours(projectId, jobId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetWorkerHours(int teamLeaderId, int workerId) => new HttpResponseMessage(HttpStatusCode.OK) { //curl -X GET -v http://localhost:59628/api/getWorkerHours/5/6 Content = new ObjectContent <List <Object> >(TeamLeaderLogic.getWorkerHours(teamLeaderId, workerId), new JsonMediaTypeFormatter()) };
public HttpResponseMessage GetWorkersDeatails(int teamLeaderId) => new HttpResponseMessage(HttpStatusCode.OK) { //curl -X GET -v http://localhost:59628/api/getWorkersDeatails/11 Content = new ObjectContent <List <Worker> >(TeamLeaderLogic.GetWorkersDeatails(teamLeaderId), new JsonMediaTypeFormatter()) };