public IHttpActionResult GetVrsta(int id) { VrsteProizvoda vrste = db.VrsteProizvoda.Find(id); if (vrste == null) { return(NotFound()); } return(Ok(vrste)); }
private void dodajBtn_Click(object sender, EventArgs e) { if (this.ValidateChildren()) { SortaProizvoda a = new SortaProizvoda(); VrsteProizvoda b = new VrsteProizvoda(); b = vrstaCmb.SelectedItem as VrsteProizvoda; a.VrstaID = b.VrstaID; a.Naziv = textBox1.Text; DialogResult = DialogResult.OK; HttpResponseMessage respone = sortaService.PostResponse(a); if (respone.IsSuccessStatusCode) { MessageBox.Show("Uspjesno ste dodali novu sortu"); } else { MessageBox.Show("Došlo je do greške"); } this.Close(); } }