Exemplo n.º 1
0
        public HttpResponseMessage GetAllPactsIdAnd(int id)
        {
            var pacts = PactsRepository.GetPactsIdAnd(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, pacts);

            return(response);
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetSinglePact(int id)
        {
            var post = PactsRepository.GetSinglePact(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, post);

            return(response);
        }
Exemplo n.º 3
0
        public HttpResponseMessage GetPactsByUserAndroid(int userId)
        {
            var pacts = PactsRepository.GetPactsByUserIdAndroid(userId);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, pacts);

            return(response);
        }
Exemplo n.º 4
0
        public HttpResponseMessage Delete(int id)
        {
            PactsRepository.DeletePact(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, "Deleted");

            return(response);
        }
Exemplo n.º 5
0
        public HttpResponseMessage PutPact(int id, [FromBody] Pact post)
        {
            var pacts = PactsRepository.UpdatePact(id, post);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, pacts);

            return(response);
        }
Exemplo n.º 6
0
        public HttpResponseMessage GetAllPacts()
        {
            List <Pact>         pacts    = PactsRepository.GetAllPacts();
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, pacts);

            return(response);
        }
Exemplo n.º 7
0
        public HttpResponseMessage GetPostsByDateFinished(string date)
        {
            var posts = PactsRepository.GetAllPactsPerDateFinishedMateix(date);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, posts);

            return(response);
        }
Exemplo n.º 8
0
        public HttpResponseMessage GetPactsByTitle(string title)
        {
            var pacts = PactsRepository.GetAllPactsPerTitle(title);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, pacts);

            return(response);
        }
Exemplo n.º 9
0
        public HttpResponseMessage GetPactsByLocation(string desc)
        {
            var pacts = PactsRepository.GetAllPactsPerDesc(desc);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, pacts);

            return(response);
        }
Exemplo n.º 10
0
        public IHttpActionResult FinalitzarPact([FromBody] Pact pact)
        {
            var pacts = PactsRepository.FinalitzarPacte(pact.Id_Pact, pact.date_finished, pact.hours);

            return(Ok(new {
                value = pacts
            }));
        }
Exemplo n.º 11
0
        public IHttpActionResult PactPact([FromBody] Pact post)
        {
            var pacts = PactsRepository.InsertPact(post);

            return(Ok(new {
                value = pacts
            }));
        }