コード例 #1
0
        public HttpResponseMessage Get()
        {
            TelefonoFax telefonofax = new TelefonoFax();

            HttpResponseMessage response = Request.CreateResponse <List <Models.TelefonoFax> >(HttpStatusCode.Created, telefonofax.Select_Todo_TelefonoFax());

            return(response);
        }
コード例 #2
0
        public HttpResponseMessage Delete(FormDataCollection form)
        {
            TelefonoFax telefonofax = new TelefonoFax();

            telefonofax.NumTelefono1 = Convert.ToInt32(form.Get("NumTel"));

            string[] respuesta = new string[2];
            respuesta[0] = telefonofax.Delete_TelefonoFax();
            respuesta[1] = form.Get("NumTel");

            HttpResponseMessage response = Request.CreateResponse <string[]>(HttpStatusCode.Created, respuesta);

            return(response);
        }
コード例 #3
0
        public HttpResponseMessage Put(FormDataCollection form)
        {
            Persona persona = new Persona();

            persona.Nombre1 = form.Get("NombrePersona");

            Identificacion identificacion = new Identificacion();

            identificacion.Numero1        = form.Get("IdentificacionPersona");
            persona.IdentificacionNumero1 = identificacion;

            persona.NombreComercial1 = form.Get("NombreComercial");

            Ubicacion ubicacionid = new Ubicacion();

            ubicacionid.ID1      = Convert.ToInt32(form.Get("UbicacionPersona"));
            persona.UbicacionID1 = ubicacionid;

            TelefonoFax telefono = new TelefonoFax();

            telefono.NumTelefono1   = Convert.ToInt32(form.Get("TelefonoPersona"));
            persona.TelefonoNumero1 = telefono;

            TelefonoFax fax = new TelefonoFax();

            fax.NumTelefono1   = Convert.ToInt32(form.Get("FaxPersona"));
            persona.FaxNumero1 = fax;

            persona.CorreoElectronico1 = form.Get("CorreoPersona");

            string[] respuesta = new string[2];
            respuesta[0] = persona.Insert_Persona();
            respuesta[1] = form.Get("IdentificacionPersona");

            HttpResponseMessage response = Request.CreateResponse <string[]>(HttpStatusCode.Created, respuesta);

            return(response);
        }