public ActionResult Remove(int stavkaId) { Narudzba_Stavka ns = _db.Narudzba_Stavka.Find(stavkaId); if (ns != null) { _db.Narudzba_Stavka.Remove(ns); _db.SaveChanges(); } return(Ok(stavkaId)); }
public void Add([FromBody] NovaStavkaAddVM data) { Narudzba_Stavka nova = new Narudzba_Stavka(); nova.KolicinaCvjetova = data.kolicinaCvjetova; nova.KolicinaUkrasa = data.kolicinaUkrasa; nova.NarudzbaId = data.narudzbaId; nova.NarudzbaId = data.narudzbaId; nova.UkrasId = data.ukrasId; nova.VrstaCvijeta_BojaId = _db.VrstaCvijeta_Boja.Where(x => x.VrstaCvijetaId == data.vrstaCvijetaId).FirstOrDefault().Id; _db.Narudzba_Stavka.Add(nova); _db.SaveChanges(); }