Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tblPodtipPregleda tblPodtipPregleda = db.tblPodtipPregledas.Find(id);

            db.tblPodtipPregledas.Remove(tblPodtipPregleda);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "podtipPregledaID,nazivPodtipaPregleda,tipPregledaID")] tblPodtipPregleda tblPodtipPregleda)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblPodtipPregleda).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.tipPregledaID = new SelectList(db.tblTipPregledas, "tipPregledaID", "nazivTipaPregleda", tblPodtipPregleda.tipPregledaID);
     return(View(tblPodtipPregleda));
 }
Пример #3
0
        // GET: tblPodtipPregledas/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPodtipPregleda tblPodtipPregleda = db.tblPodtipPregledas.Find(id);

            if (tblPodtipPregleda == null)
            {
                return(HttpNotFound());
            }
            return(View(tblPodtipPregleda));
        }
Пример #4
0
        // GET: tblPodtipPregledas/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblPodtipPregleda tblPodtipPregleda = db.tblPodtipPregledas.Find(id);

            if (tblPodtipPregleda == null)
            {
                return(HttpNotFound());
            }
            ViewBag.tipPregledaID = new SelectList(db.tblTipPregledas, "tipPregledaID", "nazivTipaPregleda", tblPodtipPregleda.tipPregledaID);
            return(View(tblPodtipPregleda));
        }
Пример #5
0
 public ActionResult DeleteConfirmed(int id)
 {
     try
     {
         tblPodtipPregleda tblPodtipPregleda = db.tblPodtipPregledas.Find(id);
         db.tblPodtipPregledas.Remove(tblPodtipPregleda);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch (Exception)
     {
         MessageBox.Show("Ovaj podatak je povezan u drugoj tabeli i nije ga moguce obrisati");
     }
     return(RedirectToAction("Index"));
 }