private async void BtnPrikazi_Click(object sender, EventArgs e) { var pretraga = new ModeliSearchRequest() { Naziv = txtPretraga.Text }; var result = await _apiService.Get <List <Model.Modeli> >(pretraga); dgvModeli.DataSource = result; }
private async void CmbMarke_SelectedIndexChanged(object sender, EventArgs e) { cmbModel.Enabled = false; var selected = cmbMarke.SelectedItem as Model.Marke; ModeliSearchRequest req = new ModeliSearchRequest() { MarkaId = selected.MarkaId }; var modeli = await _model.Get <List <Model.Modeli> >(req); modeli.Insert(0, new AutoKuca.Model.Modeli { ModelId = 0, Naziv = "Modeli", }); cmbModel.DataSource = modeli; cmbModel.DisplayMember = "Naziv"; cmbModel.ValueMember = "ModelId"; cmbModel.SelectedIndex = 0; cmbModel.Enabled = true; }