Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Velosiped velosiped = db.Velosipedi.Find(id);

            db.Velosipedi.Remove(velosiped);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "VelosipedID,Ime,Cena,VelosipedURL")] Velosiped velosiped)
 {
     if (ModelState.IsValid)
     {
         db.Entry(velosiped).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(velosiped));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "VelosipedID,Ime,Cena,VelosipedURL")] Velosiped velosiped)
        {
            if (ModelState.IsValid)
            {
                db.Velosipedi.Add(velosiped);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(velosiped));
        }
Exemplo n.º 4
0
        // GET: StoreManager/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Velosiped velosiped = db.Velosipedi.Find(id);

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