public ActionResult DeleteConfirmed(int id) { tblTipPregleda tblTipPregleda = db.tblTipPregledas.Find(id); db.tblTipPregledas.Remove(tblTipPregleda); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "tipPregledaID,nazivTipaPregleda,vrstaPregledaID")] tblTipPregleda tblTipPregleda) { if (ModelState.IsValid) { db.Entry(tblTipPregleda).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.vrstaPregledaID = new SelectList(db.tblVrstaPregledas, "vrstaPregledaID", "nazivVrstePregleda", tblTipPregleda.vrstaPregledaID); return(View(tblTipPregleda)); }
// GET: tblTipPregledas/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblTipPregleda tblTipPregleda = db.tblTipPregledas.Find(id); if (tblTipPregleda == null) { return(HttpNotFound()); } return(View(tblTipPregleda)); }
// GET: tblTipPregledas/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tblTipPregleda tblTipPregleda = db.tblTipPregledas.Find(id); if (tblTipPregleda == null) { return(HttpNotFound()); } ViewBag.vrstaPregledaID = new SelectList(db.tblVrstaPregledas, "vrstaPregledaID", "nazivVrstePregleda", tblTipPregleda.vrstaPregledaID); return(View(tblTipPregleda)); }
public ActionResult DeleteConfirmed(int id) { try { tblTipPregleda tblTipPregleda = db.tblTipPregledas.Find(id); db.tblTipPregledas.Remove(tblTipPregleda); db.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception) { MessageBox.Show("Podatak je povezan u drugoj tabeli i nije ga moguce obrisati!"); } return(RedirectToAction("Index")); }