예제 #1
0
        private void OnRetrieveFilteredDataFromJSONStore()
        {
//			JsonObject outArr = App.WorklightClient.client.JSONStoreService.JSONStoreCollection("people").FindDocumentByID(1);
            WorklightJSONStoreQueryPart[] queryParts = new WorklightJSONStoreQueryPart[1];
            queryParts [0] = App.WorklightClient.client.JSONStoreService.JSONStoreQueryPart();
            queryParts [0].AddLike("name", "Chethan");
            WorklightJSONStoreCollection collection = App.WorklightClient.client.JSONStoreService.JSONStore.GetCollectionByName("people");

            if (collection != null)
            {
                JsonArray outArr = collection.
                                   FindDocumentsWithQueryParts(queryParts);
                DisplayAlert("Filtered JSONStore Data",
                             String.Format("JSONStore Person data is {0}",
                                           outArr != null ? outArr.ToString() : "not available"), "OK");
            }
            else
            {
                DisplayAlert("JSONStore RetrieveData", "Open JSONstore collection before attempting to retrieve data", "OK");
            }
        }
예제 #2
0
		private void OnRetrieveFilteredDataFromJSONStore()
		{
//			JsonObject outArr = App.WorklightClient.client.JSONStoreService.JSONStoreCollection("people").FindDocumentByID(1);
			WorklightJSONStoreQueryPart[] queryParts = new WorklightJSONStoreQueryPart[1];
			queryParts [0] = App.WorklightClient.client.JSONStoreService.JSONStoreQueryPart();
			queryParts [0].AddLike ("name","Chethan");
			WorklightJSONStoreCollection collection = App.WorklightClient.client.JSONStoreService.JSONStore.GetCollectionByName("people");
			if (collection != null) {
				JsonArray outArr = collection.
				FindDocumentsWithQueryParts (queryParts);
				DisplayAlert ("Filtered JSONStore Data",
					String.Format ("JSONStore Person data is {0}",
						outArr != null ? outArr.ToString () : "not available"), "OK");
			}else
				DisplayAlert ("JSONStore RetrieveData", "Open JSONstore collection before attempting to retrieve data","OK");
		}