Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            string r = m.WEbClientGet("http://api.hh.ru/vacancies?text=Программист");

            List <Work> work = m.JsonParseList(r);

            GridView.Rows.Clear();
            int nr;

            foreach (Work w in work)
            {
                DataGridViewRow row = (DataGridViewRow)GridView.Rows[0].Clone();

                /*row.Cells["ColID"].Value = w.id;
                 * row.Cells["CName"].Value = w.Name;
                 * row.Cells["Empl"].Value = w.employer;
                 * row.Cells["s_from"].Value = w.salary_from;
                 * row.Cells["s_to"].Value = w.salary_to;
                 */
                row.Cells[0].Value = w.id;
                row.Cells[1].Value = w.Name;
                row.Cells[2].Value = w.employer;
                row.Cells[3].Value = w.salary_from;
                row.Cells[4].Value = w.salary_to;
                row.Cells[5].Value = w.info;

                GridView.Rows.Add(row);
            }
        }
Example #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            HHModel m = new HHModel();
            string  r = m.WEbClientGet("http://api.hh.ru/vacancies?text=Программист");

            ResListBox.Items.Clear();
            List <Work> work = m.JsonParseList(r);

            foreach (Work w in work)
            {
                // ResListBox.Items.Add(w.id + " " + w.Name);
                ListBoxItem item = new ListBoxItem();
                // item.Name = w.Name;
                item.Content = w.id + " " + w.Name;
                item.Tag     = w.info;
                ResListBox.Items.Add(item);
            }

//            ResListBox.ItemsSource = work;
        }