public ActionResult DeleteConfirmed(int id) { DokumentSadrzaj dokumentSadrzaj = db.DokumentSadrzaji.Find(id); db.DokumentSadrzaji.Remove(dokumentSadrzaj); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Naziv,Datum,Kolicina,TipUlaza")] DokumentSadrzaj dokumentSadrzaj) { if (ModelState.IsValid) { db.Entry(dokumentSadrzaj).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dokumentSadrzaj)); }
public ActionResult Create([Bind(Include = "ID,Naziv,Kolicina,TipUlaza")] DokumentSadrzaj dokumentSadrzaj) { if (ModelState.IsValid) { dokumentSadrzaj.Datum = DateTime.Now; db.DokumentSadrzaji.Add(dokumentSadrzaj); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dokumentSadrzaj)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DokumentSadrzaj dokumentSadrzaj = db.DokumentSadrzaji.Find(id); if (dokumentSadrzaj == null) { return(HttpNotFound()); } return(View(dokumentSadrzaj)); }