public ActionResult DeleteConfirmed(Guid id) { hard_disk hard_disk = db.hard_disk.Find(id); db.hard_disk.Remove(hard_disk); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "GID,Name,Specs,Image,Manufacture,cat_hard_disk_id")] hard_disk hard_disk) { var myrole = new Class1(); var userID = User.Identity.GetUserId(); ViewBag.currentrole = myrole.a(userID); if (ModelState.IsValid) { db.Entry(hard_disk).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.cat_hard_disk_id = new SelectList(db.CategoryHardDisks, "cat_hard_disk_id", "cat_hard_disk_name", hard_disk.cat_hard_disk_id); return(View(hard_disk)); }
public ActionResult Details(Guid?id) { var myrole = new Class1(); var userID = User.Identity.GetUserId(); ViewBag.currentrole = myrole.a(userID); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } hard_disk hard_disk = db.hard_disk.Find(id); if (hard_disk == null) { return(HttpNotFound()); } return(View(hard_disk)); }
public ActionResult Edit(Guid?id) { var myrole = new Class1(); var userID = User.Identity.GetUserId(); ViewBag.currentrole = myrole.a(userID); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } hard_disk hard_disk = db.hard_disk.Find(id); if (hard_disk == null) { return(HttpNotFound()); } ViewBag.cat_hard_disk_id = new SelectList(db.CategoryHardDisks, "cat_hard_disk_id", "cat_hard_disk_name", hard_disk.cat_hard_disk_id); return(View(hard_disk)); }