public ActionResult DeleteConfirmed(int id) { Hummel hummel = db.Hummels.Find(id); db.Hummels.Remove(hummel); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "hummelId,name,trademark,description,fileLoc,active")] Hummel hummel) { if (ModelState.IsValid) { db.Hummels.Add(hummel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(hummel)); }
public ActionResult Edit(HttpPostedFileBase file, [Bind(Include = "hummelId,name,trademark,description,fileLoc,active")] Hummel hummel) { if (ModelState.IsValid) { db.Entry(hummel).State = EntityState.Modified; db.SaveChanges(); BlobHandler bh = new BlobHandler(file.FileName); return(RedirectToAction("Index")); } return(View(hummel)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Hummel hummel = db.Hummels.Find(id); if (hummel == null) { return(HttpNotFound()); } return(View(hummel)); }