Ejemplo n.º 1
0
        }//OnCreate

        private async void PrepareDB()
        {
            DBGeneral dbGn = new DBGeneral();

            if (!dbGn.DbExists())
            {
                ProductsRepository repPrds  = new ProductsRepository();
                ResPoductsDTO      loadPrds = await repPrds.GetProducts(ShAppContext.UserToken);

                int a = 0;
                a++;
            }//endif
        }
Ejemplo n.º 2
0
        public async Task <ResPoductsDTO> GetProducts(string token)
        {
            string sUrl     = string.Format(Constants.URL_GET_PRODUCTS + "?offset=0&count=1000&q=");
            string sResJson = await m_httpHelper.HttpGet(sUrl, token);

            try
            {
                ResPoductsDTO obj = JsonConvert.DeserializeObject <ResPoductsDTO>(sResJson);
                return(obj);
            }
            catch (Exception e)
            {
                return(new ResPoductsDTO());
            }
        }