public ActionResult DeleteConfirmed(int id) { Stavka_narudzenice stavka_narudzenice = db.Stavka_narudzenice.Find(id); db.Stavka_narudzenice.Remove(stavka_narudzenice); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Stavka_narudzenice_ID,Reklama_ID,Narudzbenica_ID,Kolicina")] Stavka_narudzenice stavka_narudzenice) { if (ModelState.IsValid) { db.Entry(stavka_narudzenice).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Narudzbenica_ID = new SelectList(db.Narudzbenica, "Narudzbenica_ID", "Narudzbenica_ID", stavka_narudzenice.Narudzbenica_ID); ViewBag.Reklama_ID = new SelectList(db.Reklama, "Reklama_ID", "Naziv", stavka_narudzenice.Reklama_ID); return(View(stavka_narudzenice)); }
// GET: Stavka_narudzenice/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Stavka_narudzenice stavka_narudzenice = db.Stavka_narudzenice.Find(id); if (stavka_narudzenice == null) { return(HttpNotFound()); } return(View(stavka_narudzenice)); }
// GET: Stavka_narudzenice/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Stavka_narudzenice stavka_narudzenice = db.Stavka_narudzenice.Find(id); if (stavka_narudzenice == null) { return(HttpNotFound()); } ViewBag.Narudzbenica_ID = new SelectList(db.Narudzbenica, "Narudzbenica_ID", "Narudzbenica_ID", stavka_narudzenice.Narudzbenica_ID); ViewBag.Reklama_ID = new SelectList(db.Reklama, "Reklama_ID", "Naziv", stavka_narudzenice.Reklama_ID); return(View(stavka_narudzenice)); }