Ejemplo n.º 1
0
        public async Task<List<Model_Offers>> GetOffers(bool newUser,bool allowCaching)
        {
            QueryResponse = new OfferResponse();
            try
            {
                string Url;
                if (newUser)
                    Url = Network.URL_HOST_MOBIKWIK + Network.URL_ACTION_READ_FILE + "?id=newuser" + "&clientId=8";
                else
                    Url = Network.URL_HOST_MOBIKWIK + Network.URL_ACTION_OFFERS + "?context=products&clientId=6";

                sc = new ServerCall();

                if (allowCaching == false)
                    Url = Network.addParamToUri(Url, "disablecache", Environment.TickCount.ToString());


                string Response = await sc.GetjsonStream(Url);
                if (Response.Length > 0 & MKValidations.isValidJson(Response))
                    QueryResponse = JsonConvert.DeserializeObject<OfferResponse>(Response);
            }
            catch (Exception ex)
            {
                //use ex
            }
            return QueryResponse.data;
        }
Ejemplo n.º 2
0
        public void GetOffers()
        {
            QueryResponse = new OfferResponse();
            try
            {
               // bool showPopup = false;
                //if (CategoryList.Items.Count == 0)
                //    showPopup = true;
                if (AccountFunctions.fetchOffersStatus == 0 || AccountFunctions.fetchOffersStatus == 1)
                {
                  

                   // UIFunctions.showProgressIndicator("Finding latest offers for you ");
                   // FetchList(url, showPopup);
                }
            }
            catch (Exception ex) { }

        }