Beispiel #1
0
        public HttpResponseMessage GetContacte(int id)
        {
            var contacte = ContactesRepository.GetContacte(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contacte);

            return(response);
        }
Beispiel #2
0
        public HttpResponseMessage GetContacte(int id)
        {
            var contacte = ContactesRepository.GetContacte(id);

            contacte.serializarEmail   = false;
            contacte.serializarTelefon = false;
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contacte);

            return(response);
        }
Beispiel #3
0
        public HttpResponseMessage GetContacteTot(int id)
        {
            var contacte = ContactesRepository.GetContacte(id);
            var telefon  = TelefonsRepository.GetTelefon(contacte.contacteId);

            todo = true;
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contacte);

            return(response);
        }
Beispiel #4
0
 public HttpResponseMessage GetContacteTot(int id)
 {
     try
     {
         var contacte = ContactesRepository.GetContacte(id);
         HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contacte);
         return(response);
     } catch (Exception ex)
     {
         return(null);
     }
 }
Beispiel #5
0
        public HttpResponseMessage GetContacteTot(int id)
        {
            var contacte = ContactesRepository.GetContacte(id);

            if (contacte == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            contacte.serializeMail     = true;
            contacte.serializeTelefons = true;
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contacte);

            return(response);
        }
Beispiel #6
0
        public HttpResponseMessage DeleteCTot(int id)
        {
            var contacte = ContactesRepository.GetContacte(id);

            if (contacte == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            ContactesRepository.DeleteContacteTot(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

            return(response);
        }