public async void SearchBar_TextChanged(object Ssender, TextChangedEventArgs e) { HttpClientHandler clientHandler = new HttpClientHandler(); clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return(true); }; HttpClient client = new HttpClient(clientHandler); var response = await client.GetAsync("https://qlcv-api.conveyor.cloud/api/GetListCV"); string listCVJSON = await response.Content.ReadAsStringAsync(); listCV cvobj = new listCV(); cvobj = JsonConvert.DeserializeObject <listCV>(listCVJSON); IList <CongViec> cv = new List <CongViec>(); cv = cvobj.DATA; foreach (var item in cv) { switch (item.ID_KET_QUA_CV) { case 1: item.KET_QUA_CV = "Hoàn thành"; break; case 2: item.KET_QUA_CV = "Hủy"; break; case 3: item.KET_QUA_CV = "Đang làm"; break; default: item.KET_QUA_CV = ""; break; } } LV.ItemsSource = cv; LV.ItemsSource = cv.Where(x => Convert.ToString(x.NGAY_BAT_DAU).StartsWith(e.NewTextValue) || Convert.ToString(x.NGAY_KET_THUC).StartsWith(e.NewTextValue) || x.KET_QUA_CV.StartsWith(e.NewTextValue)); }
public async void GetDSCV() { HttpClientHandler clientHandler = new HttpClientHandler(); clientHandler.ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => { return(true); }; HttpClient client = new HttpClient(clientHandler); var response = await client.GetAsync("https://qlcv-api.conveyor.cloud/api/GetListCV"); string listCVJSON = await response.Content.ReadAsStringAsync(); listCV cvobj = new listCV(); cvobj = JsonConvert.DeserializeObject <listCV>(listCVJSON); IList <CongViec> cv = new List <CongViec>(); cv = cvobj.DATA; foreach (var item in cv) { switch (item.ID_KET_QUA_CV) { case 1: item.KET_QUA_CV = "Hoàn thành"; break; case 2: item.KET_QUA_CV = "Hủy"; break; case 3: item.KET_QUA_CV = "Đang làm"; break; default: item.KET_QUA_CV = ""; break; } } LV.ItemsSource = cv; }