Exemple #1
0
        public async Task <string> Post()
        {
            RESPUESTA_HTTP = await PETICION_HTTP.PostAsync(URL + DIRECTORIO_API, ContenidoHttp(this));

            if (RESPUESTA_HTTP.IsSuccessStatusCode)
            {
                return(null);
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, REQUEST_ISSUES)));
            }
        }
        public async Task <string> Delete()
        {
            RESPUESTA_HTTP = await PETICION_HTTP.DeleteAsync(URL + DIRECTORIO_API + "/" + id);

            if (RESPUESTA_HTTP.IsSuccessStatusCode)
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(true, "Oferta de trabajo Eliminada con Exito !")));
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, REQUEST_ISSUES)));
            }
        }
        public async Task <string> Put()
        {
            RESPUESTA_HTTP = await PETICION_HTTP.PutAsync(URL + DIRECTORIO_API, ContenidoHttp(this));

            if (RESPUESTA_HTTP.IsSuccessStatusCode)
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(true, "Oferta de trabajo Actualizada con Exito !")));
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, REQUEST_ISSUES)));
            }
        }
Exemple #4
0
        public async Task <string> TryLogin()
        {
            var lst = await Get();

            int idUsuario = lst.ToList().
                            Where(x => x.Username == Username && x.Contraseña == Contraseña).
                            Select(x => x.ID).FirstOrDefault();

            if (idUsuario != 0 && idUsuario.ToString() != null)
            {
                return(Interaccion.Redireccion("PosterDashboard", idUsuario));
            }
            else
            {
                return(Interaccion.DevolverNotificacion(
                           new Tuple <bool, string>(false, "Username o Contraseña Incorrecta")));
            }
        }