public ActionResult DeleteConfirmed(int id) { Mehanizm mehanizm = db.Mehanizms.Find(id); db.Mehanizms.Remove(mehanizm); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
// 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)); }