Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Mehanizm mehanizm = db.Mehanizms.Find(id);

            db.Mehanizms.Remove(mehanizm);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "ID_Mehanizm,Naim,Opis,ID_Status")] Mehanizm mehanizm)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mehanizm).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ID_Status = new SelectList(db.Status, "ID_Status", "Naim", mehanizm.ID_Status);
     return(View(mehanizm));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "ID_Mehanizm,Naim,Opis,ID_Status")] Mehanizm mehanizm)
        {
            if (ModelState.IsValid)
            {
                db.Mehanizms.Add(mehanizm);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ID_Status = new SelectList(db.Status, "ID_Status", "Naim", mehanizm.ID_Status);
            return(View(mehanizm));
        }
Example #4
0
        // GET: Mehanizms/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mehanizm mehanizm = db.Mehanizms.Find(id);

            if (mehanizm == null)
            {
                return(HttpNotFound());
            }
            return(View(mehanizm));
        }
Example #5
0
        // GET: Mehanizms/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Mehanizm mehanizm = db.Mehanizms.Find(id);

            if (mehanizm == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ID_Status = new SelectList(db.Status, "ID_Status", "Naim", mehanizm.ID_Status);
            return(View(mehanizm));
        }