示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            biljke biljke = db.biljke.Find(id);

            db.biljke.Remove(biljke);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "id,naziv")] biljke biljke)
 {
     if (ModelState.IsValid)
     {
         db.Entry(biljke).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(biljke));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "id,naziv")] biljke biljke)
        {
            if (ModelState.IsValid)
            {
                db.biljke.Add(biljke);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(biljke));
        }
示例#4
0
        // GET: biljke/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            biljke biljke = db.biljke.Find(id);

            if (biljke == null)
            {
                return(HttpNotFound());
            }
            return(View(biljke));
        }