public ActionResult DeleteConfirmed(int id) { Zasob zasob = db.Zasobs.Find(id); db.Zasobs.Remove(zasob); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,id_firma,nazwa")] Zasob zasob) { if (ModelState.IsValid) { db.Entry(zasob).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_firma = new SelectList(db.Firmas, "id", "nazwa", zasob.id_firma); return(View(zasob)); }
public ActionResult Create([Bind(Include = "id,id_firma,nazwa")] Zasob zasob) { if (ModelState.IsValid) { db.Zasobs.Add(zasob); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.id_firma = new SelectList(db.Firmas, "id", "nazwa", zasob.id_firma); return(View(zasob)); }
// GET: Zasob/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Zasob zasob = db.Zasobs.Find(id); if (zasob == null) { return(HttpNotFound()); } return(View(zasob)); }
// GET: Zasob/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Zasob zasob = db.Zasobs.Find(id); if (zasob == null) { return(HttpNotFound()); } ViewBag.id_firma = new SelectList(db.Firmas, "id", "nazwa", zasob.id_firma); return(View(zasob)); }