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

            return(response);
        }
Beispiel #2
0
        public HttpResponseMessage PostTot([FromBody] contacte cont)
        {
            var contactes = ContactesRepository.InsertContacteTot(cont);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
Beispiel #3
0
        public HttpResponseMessage Delete(int id)
        {
            ContactesRepository.DeleteContacte(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);

            return(response);
        }
Beispiel #4
0
        public HttpResponseMessage GetTot(string name)
        {
            var contactes = ContactesRepository.SearchContactesByName(name);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
Beispiel #5
0
        public HttpResponseMessage GetTot()
        {
            var contactes = ContactesRepository.GetAllContactes();
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
Beispiel #6
0
        public HttpResponseMessage PostE([FromBody] email val)
        {
            var e = ContactesRepository.CreateMail(val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, e);

            return(response);
        }
Beispiel #7
0
        public HttpResponseMessage PostC([FromBody] contacte val)
        {
            var c = ContactesRepository.CreateContacte(val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, c);

            return(response);
        }
Beispiel #8
0
        public HttpResponseMessage PostT([FromBody] telefon val)
        {
            var t = ContactesRepository.CreatePhone(val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, t);

            return(response);
        }
Beispiel #9
0
        public HttpResponseMessage PutE(int id, [FromBody] email val)
        {
            var email = ContactesRepository.UpdateMail(id, val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, email);

            return(response);
        }
Beispiel #10
0
        public HttpResponseMessage PutT(int id, [FromBody] telefon val)
        {
            var tel = ContactesRepository.UpdatePhone(id, val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, tel);

            return(response);
        }
Beispiel #11
0
        public HttpResponseMessage Put(int id, [FromBody] contacte val)
        {
            var contacte = ContactesRepository.UpdateContacte(id, val);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contacte);

            return(response);
        }
Beispiel #12
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 #13
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 #14
0
        public HttpResponseMessage GetPhone(string phone)
        {
            var phones = ContactesRepository.SearchContactesByPhone(phone);

            if (phones == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, phones);

            return(response);
        }
Beispiel #15
0
        public HttpResponseMessage GetEmail(string email)
        {
            var emails = ContactesRepository.SearchContactesByEmail(email);

            if (emails == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, emails);

            return(response);
        }
Beispiel #16
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 #17
0
        public HttpResponseMessage Get(string name)
        {
            var contactes = ContactesRepository.SearchContactesByName(name);

            foreach (var c in contactes)
            {
                c.serializarEmail   = false;
                c.serializarTelefon = false;
            }
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
Beispiel #18
0
        public HttpResponseMessage DeleteT(int id)
        {
            var telefon = ContactesRepository.GetPhone(id);

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

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

            return(response);
        }
Beispiel #19
0
        public HttpResponseMessage DeleteE(int id)
        {
            var email = ContactesRepository.GetEmail(id);

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

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

            return(response);
        }
Beispiel #20
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);
        }
Beispiel #21
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 #22
0
        public HttpResponseMessage PostCTot([FromBody] contacte c)
        {
            var contactes = ContactesRepository.GetAllContactes();

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

            c.serializeMail     = true;
            c.serializeTelefons = true;

            var co = ContactesRepository.CreateContacte(c);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, co);

            return(response);
        }
Beispiel #23
0
        public HttpResponseMessage GetNom(string name)
        {
            var contactes = ContactesRepository.SearchContactesByName(name);

            if (contactes == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            foreach (var c in contactes)
            {
                c.serializeMail     = false;
                c.serializeTelefons = false;
            }
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }
Beispiel #24
0
        public HttpResponseMessage GetTot()
        {
            var contactes = ContactesRepository.GetAllContactes();

            if (contactes == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
            foreach (var c in contactes)
            {
                c.serializeMail     = true;
                c.serializeTelefons = true;
            }

            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, contactes);

            return(response);
        }