private void SearchServices_Click(object sender, RoutedEventArgs e) { getAllServices = null; //get entered query String query = searchQueryTextBox.Text; //get reponse provided by the RegistryAccessClass.searchServices getAllServices = RegistryAccessClass.searchServices(query, TOKEN); //assign to the data grid allServicesDataGrid.DataContext = getAllServices.Services; }
/* * * @param query for a given service, token for validation by the authenticator * @returns ServiceDescriptionNStatusInterMed with the services and status of the service invocation(check token by validator) */ public static ServiceDescriptionNStatusInterMed searchServices(string query, int token) { assignURLtoRestClient(); descriptionNStatusInterMed = null; //Service endpoint to access search function RestRequest restRequest = new RestRequest($"api/search/{query}/{token}"); //GET request IRestResponse response = restClient.Get(restRequest); //De-serialize descriptionNStatusInterMed = JsonConvert.DeserializeObject <ServiceDescriptionNStatusInterMed>(response.Content); return(descriptionNStatusInterMed); }
/* * * * @param int token provided * @returns ServiceDescriptionNStatusInterMed * * * */ public static ServiceDescriptionNStatusInterMed getAllServices(int token) { assignURLtoRestClient(); descriptionNStatusInterMed = null; //Service endpoint to access getAllServices function RestRequest request = new RestRequest($"api/getAllServices/{token}"); //Fetching GET method type response IRestResponse response = restClient.Get(request); //De-serialize from JSON result to .NET object type descriptionNStatusInterMed = JsonConvert.DeserializeObject <ServiceDescriptionNStatusInterMed>(response.Content); return(descriptionNStatusInterMed); }
private void ViewAllServices_Click(object sender, RoutedEventArgs e) { //initalizing list getAllServices = null; DataTable allServices = new DataTable(); //geting reponse for all services getAllServices = RegistryAccessClass.getAllServices(TOKEN); if (getAllServices != null) { //assigning to data grid allServicesDataGrid.DataContext = getAllServices.Services; } else { MessageBox.Show("Error! Unable to fetch all services!"); } }