1
0
forked from s434786/DINO_SCRUM

Added searching, added server address to app.config

This commit is contained in:
Konrad Pierzyński 2019-01-28 23:58:03 +01:00
parent 1be5d1f7c0
commit 9b3344aa72

View File

@ -102,9 +102,9 @@ namespace Magazyn
{ {
pageBlock.Text = (page+1).ToString(); pageBlock.Text = (page+1).ToString();
Task<HttpResponseMessage> response = client.GetAsync(serverUrl+"get-all?page=" + page.ToString() + "&size=" + size.ToString()); Task<HttpResponseMessage> response = client.GetAsync(serverUrl+"get-all?page=" + page.ToString() + "&size=" + size.ToString() + "&search=" + ((string.IsNullOrEmpty(searchBox.Text) || string.IsNullOrWhiteSpace(searchBox.Text)) ? "none" : searchBox.Text) );
while (response.IsCompleted != true) ; while (response.IsCompleted != true) ;
if (response.Result.StatusCode != HttpStatusCode.OK) if (response.Result.StatusCode != HttpStatusCode.OK)
{ {
ErrorWindow window = new ErrorWindow("Nastąpił błąd połączenia z serwerem."); ErrorWindow window = new ErrorWindow("Nastąpił błąd połączenia z serwerem.");
@ -112,7 +112,6 @@ namespace Magazyn
window.ShowDialog(); window.ShowDialog();
page = 0; page = 0;
size = 0;
return; return;
} }
@ -208,7 +207,8 @@ namespace Magazyn
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
{ {
//RefreshListOfFruits(); page = 0;
RefreshListOfFruits();
} }
} }
} }