Exemplo n.º 1
0
 public List <WSProveedores> ProveedoresF(int es)
 {
     WSFerronet.SeguridadToken token = CrearConexion();
     if (token.AutenticacionToken.Equals("-1"))
     {
         CrearConexion();
         return(ProveedoresF(es));
     }
     else
     {
         return(JsonConvert.DeserializeObject <List <WSProveedores> >(objServicio.ConsultaDeProveedores(token, es)));
     }
 }
Exemplo n.º 2
0
    public WSFerronet.SeguridadToken CrearConexion()
    {
        //objServicio.ClientCredentials.UserName.UserName = "******";
        //objServicio.ClientCredentials.UserName.Password = "******";

        WSFerronet.SeguridadToken seguridad = new WSFerronet.SeguridadToken()
        {
            username   = "******",
            contrasena = "Jwk8jiL8*N"
        };

        seguridad.AutenticacionToken = objServicio.autenticacionUsuario(seguridad);
        return(seguridad);
    }
Exemplo n.º 3
0
    public string ProductosF()
    {
        WSFerronet.SeguridadToken token = CrearConexion();
        if (token.AutenticacionToken.Equals("-1"))
        {
            CrearConexion();
            return(ProductosF());
        }
        else
        {
            List <WSTopProductos> productos = JsonConvert.DeserializeObject <List <WSTopProductos> >(objServicio.ConsultaTopProductos(token));

            Random rnd   = new Random();
            int    index = rnd.Next(0, productos.Count - 1);
            return(productos[index].Imagen.Replace("~", ""));
        }
    }