Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Marshrut marshrut = db.Marshruts.Find(id);

            db.Marshruts.Remove(marshrut);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Marshrut marshrut)
 {
     if (ModelState.IsValid)
     {
         db.Entry(marshrut).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(marshrut));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,Name")] Marshrut marshrut)
        {
            if (ModelState.IsValid)
            {
                db.Marshruts.Add(marshrut);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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