private void rodjendaniBtn_Click(object sender, EventArgs e) { HttpResponseMessage response = klijentiService.GetActionResponse("SearchByBirthDate"); if (response.IsSuccessStatusCode) { List <Klijenti_Result> klijenti = response.Content.ReadAsAsync <List <Klijenti_Result> >().Result; KlijentiGridView.DataSource = klijenti; KlijentiGridView.ClearSelection(); } else { MessageBox.Show("Error Code" + response.StatusCode + " : Message - " + response.ReasonPhrase); } }
private void traziButton_Click(object sender, EventArgs e) { HttpResponseMessage response = klijentiService.GetActionResponse("SearchByName", imePrezimeInput.Text.Trim()); if (response.IsSuccessStatusCode) { List <Klijenti_Result> klijenti = response.Content.ReadAsAsync <List <Klijenti_Result> >().Result; KlijentiGridView.DataSource = klijenti; KlijentiGridView.ClearSelection(); } else { MessageBox.Show("Error Code" + response.StatusCode + " : Message - " + response.ReasonPhrase); } }