private void searchButton_Click(object sender, RoutedEventArgs e) { ResListBox.Items.Clear(); HHModel m = new HHModel(); List <Vacancy> v = m.JsonParseStringItems( m.RequestGet("http://api.hh.ru/vacancies?text=" + searchBox.Text)); foreach (Vacancy vacancy in v) { ListBoxItem item = new ListBoxItem(); item.Content = vacancy.id + " " + vacancy.name; item.Tag = vacancy.info; ResListBox.Items.Add(item); } }
private void buttonSearch_Click(object sender, EventArgs e) { List <Vacancy> vacancies = model.JsonParseStringItems(model.RequestGet("http://api.hh.ru/vacancies?text=" + searchBox.Text)); labelCount.Text = vacancies.Count() + " вакансий всего."; GridView.Rows.Clear(); foreach (Vacancy v in vacancies) { DataGridViewRow row = (DataGridViewRow)GridView.Rows[0].Clone(); row.Cells[0].Value = v.id; row.Cells[1].Value = v.name; row.Cells[2].Value = v.salary_from; row.Cells[3].Value = v.salary_to; row.Cells[4].Value = v.employer_name; row.Cells[5].Value = v.address; row.Cells[6].Value = v.info; GridView.Rows.Add(row); } }