Пример #1
0
		static public async Task<List<Product>> search_items(string searchTerm){
			string url = SERVER_URL + "/search/"+searchTerm;
			DataCache dc = new DataCache ();
			if (dc.get (url) != null)
				return Product.listFromJson (dc.get (url));

			try {
				string data = await WebService.stringFromUrl (new Uri(url));
				dc.set (url, data);
				return Product.listFromJson (data);
			}
			catch(System.Net.WebException){
				return new List<Product>();
			}
		}
Пример #2
0
		static public async Task<List<Product>> get_member_sales(){
			string url = SERVER_URL + "/membersales/";
			DataCache dc = new DataCache ();
			if (dc.get (url) != null)
				return Product.listFromJson (dc.get (url));

			try {
				string data = await WebService.stringFromUrl (new Uri(url));
				dc.set (url, data);
				return Product.listFromJson (data);
			}
			catch(System.Net.WebException){
				return new List<Product>();
			}
		}
Пример #3
0
        static public async Task <List <Product> > search_items(string searchTerm)
        {
            string    url = SERVER_URL + "/search/" + searchTerm;
            DataCache dc  = new DataCache();

            if (dc.get(url) != null)
            {
                return(Product.listFromJson(dc.get(url)));
            }

            try {
                string data = await WebService.stringFromUrl(new Uri(url));

                dc.set(url, data);
                return(Product.listFromJson(data));
            }
            catch (System.Net.WebException) {
                return(new List <Product>());
            }
        }
Пример #4
0
        static public async Task <List <Product> > get_member_sales()
        {
            string    url = SERVER_URL + "/membersales/";
            DataCache dc  = new DataCache();

            if (dc.get(url) != null)
            {
                return(Product.listFromJson(dc.get(url)));
            }

            try {
                string data = await WebService.stringFromUrl(new Uri(url));

                dc.set(url, data);
                return(Product.listFromJson(data));
            }
            catch (System.Net.WebException) {
                return(new List <Product>());
            }
        }