Beispiel #1
0
        private async Task Crear_demandante()
        {
            cliente = new ServiciosMule.ServiciosMuleClient("http://localhost:9092/");
            ServiciosMule.Models.EntradaAltaDemandante entrada = new ServiciosMule.Models.EntradaAltaDemandante
            {
                Dni               = inputDni.Text,
                Nombre            = inputNombre.Text,
                Apellidos         = inputApellidos.Text,
                Telefono          = inputTelefono.Text,
                Direccion         = inputDireccion.Text,
                Poblacion         = inputPoblacion.Text,
                Edad              = inputEdad.Text,
                Fecha_nacimiento  = inputNacimiento.Text,
                Fecha_renovacion  = inputRenovacion.Text,
                Email             = inputEmail.Text,
                Pass              = inputPass.Text,
                Iban              = inputIban.Text,
                Experiencia       = inputExperiencia.Text,
                Situacion_laboral = checkSituacionLaboral.IsChecked == true ? "true" : "false",
                Titulos           = inputTitulos.Text
            };

            try
            {
                var resultado = await cliente.MuleAltademandante.Post(entrada);

                string mensaje = resultado.Content.ResponseMule.Mensaje;
                respuesta_alta = mensaje.ToString();
            }
            catch (System.Net.Http.HttpRequestException)
            {
                respuesta_alta = "Error conectando con el servidor";
            }

            /*entradaInscripcionOferta.DniDemandante = tbox_inscribir_dni.Text.ToString();
             * entradaInscripcionOferta.IdOferta = tbox_inscribir_oferta.Text.ToString();
             * var peticion = await cliente.MuleInscribirseoferta.Post(entradaInscripcionOferta);
             * respuesta_inscribir = peticion.Content.ResponseMule.Mensaje.ToString();*/
        }
 public MuleAltademandantePostRequest(EntradaAltaDemandante Content = null, MediaTypeFormatter Formatter = null)
 {
     this.Content   = Content;
     this.Formatter = Formatter;
 }
        /// <summary>
        /// dar de alta nuevo demandante - /mule/altademandante
        /// </summary>
        /// <param name="entradaAltaDemandante">Tipo de dato complejo para representar los datos de un demandante</param>
        public virtual async Task <ClienteAplicacion.ServiciosMule.Models.MuleAltademandantePostResponse> Post(ClienteAplicacion.ServiciosMule.Models.EntradaAltaDemandante entradaAltaDemandante)
        {
            var url = "/mule/altademandante";

            url = url.Replace("?&", "?");

            var req = new HttpRequestMessage(HttpMethod.Post, url.StartsWith("/") ? url.Substring(1) : url);

            req.Content = new ObjectContent(typeof(ClienteAplicacion.ServiciosMule.Models.EntradaAltaDemandante), entradaAltaDemandante, new JsonMediaTypeFormatter());
            var response = await proxy.Client.SendAsync(req);

            return(new ClienteAplicacion.ServiciosMule.Models.MuleAltademandantePostResponse
            {
                RawContent = response.Content,
                RawHeaders = response.Headers,
                StatusCode = response.StatusCode,
                ReasonPhrase = response.ReasonPhrase,
                SchemaValidation = new Lazy <SchemaValidationResults>(() => new SchemaValidationResults(true), true)
            });
        }